v0.13.1
Public Member Functions | Public Attributes | List of all members
BCs_RVELagrange_Periodic::OpRVEBCsPeriodicRhs Struct Reference

#include <users_modules/homogenisation/src/BCs_RVELagrange_Periodic.hpp>

Inheritance diagram for BCs_RVELagrange_Periodic::OpRVEBCsPeriodicRhs:
[legend]
Collaboration diagram for BCs_RVELagrange_Periodic::OpRVEBCsPeriodicRhs:
[legend]

Public Member Functions

 OpRVEBCsPeriodicRhs (const string field_name, const string lagrang_field_name, vector< Vec > &f, RVEBC_Data_Periodic &data, CommonDataPeriodic &common_data_periodic, CommonFunctionsPeriodic &common_functions_periodic, bool ho_geometry=false)
 
PetscErrorCode doWork (int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
 
- Public Member Functions inherited from BCs_RVELagrange_Periodic::OpDmatRhs
 OpDmatRhs (const string field_name, const string lagrang_field_name, RVEBC_Data_Periodic &data, CommonDataPeriodic &common_data_periodic, CommonFunctionsPeriodic &common_functions_periodic, bool ho_geometry=false)
 
PetscErrorCode calculateDmat (int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
 

Public Attributes

vector< Vec > & F
 
VectorDouble appliedStrain
 
VectorDouble nF
 
- Public Attributes inherited from BCs_RVELagrange_Periodic::OpDmatRhs
RVEBC_Data_PeriodicdAta
 
bool hoGeometry
 
CommonDataPeriodiccommonDataPeriodic
 
CommonFunctionsPeriodiccommonFunctionsPeriodic
 
ublas::vector< MatrixDouble > X_mat
 
MatrixDouble N_mat
 

Detailed Description

Definition at line 597 of file BCs_RVELagrange_Periodic.hpp.

Constructor & Destructor Documentation

◆ OpRVEBCsPeriodicRhs()

BCs_RVELagrange_Periodic::OpRVEBCsPeriodicRhs::OpRVEBCsPeriodicRhs ( const string  field_name,
const string  lagrang_field_name,
vector< Vec > &  f,
RVEBC_Data_Periodic data,
CommonDataPeriodic common_data_periodic,
CommonFunctionsPeriodic common_functions_periodic,
bool  ho_geometry = false 
)

Definition at line 601 of file BCs_RVELagrange_Periodic.hpp.

609 :
610 OpDmatRhs(
611 field_name,lagrang_field_name,data,common_data_periodic,common_functions_periodic,ho_geometry
612 ),
613 F(f) {
614 }
constexpr auto field_name
OpDmatRhs(const string field_name, const string lagrang_field_name, RVEBC_Data_Periodic &data, CommonDataPeriodic &common_data_periodic, CommonFunctionsPeriodic &common_functions_periodic, bool ho_geometry=false)

Member Function Documentation

◆ doWork()

PetscErrorCode BCs_RVELagrange_Periodic::OpRVEBCsPeriodicRhs::doWork ( int  side,
EntityType  type,
DataForcesAndSourcesCore::EntData data 
)

Definition at line 619 of file BCs_RVELagrange_Periodic.hpp.

619 {
620 PetscFunctionBegin;
621 if(data.getIndices().size()==0) PetscFunctionReturn(0);
622 if(type == MBEDGE && side >= 3) PetscFunctionReturn(0); //ignore second triangel edges (cananical number 6 to 8)
623 if(type == MBTRI && side == 4) PetscFunctionReturn(0); //ignore second triangel face (cananical number 4)
624
625
626 ierr = calculateDmat(side,type,data); CHKERRQ(ierr);
627
628// if(type == MBVERTEX) {
629// cout<<"\n\nNew element "<<endl;
630// }
631// cout<<"type "<<type << " side "<< side <<endl;
632// cout<< "commonDataPeriodic.D_mat[0] "<<commonDataPeriodic.D_mat[0]<<endl;
633// cout<< "commonDataPeriodic.D_mat[1] "<<commonDataPeriodic.D_mat[1]<<endl<<endl;
634// string aaa;
635// cin >> aaa;
636
637
638 ublas::vector<int> rowvec;
639 if(type == MBVERTEX) {
640 int nb=data.getIndices().size()/2; //for one face
641 rowvec.resize(nb);
642 for(int ii=0; ii<nb; ii++){
643 rowvec[ii]=data.getIndices()[ii];
644 }
645 } else{
646 rowvec=data.getIndices();
647 }
648
649 appliedStrain.resize(commonDataPeriodic.D_mat[0].size2(),false);
650
651 int rank = data.getFieldDofs()[0]->getNbOfCoeffs();
652 int size = (rank == 3) ? 6 : 3;
653 for(int ii = 0;ii<size;ii++) {
654 appliedStrain.clear();
655 appliedStrain[ii] = 1.0;
657 ierr = VecSetValues(F[ii],rowvec.size(),&rowvec[0],&nF[0],ADD_VALUES); CHKERRQ(ierr);
659 ierr = VecSetValues(F[ii],rowvec.size(),&rowvec[0],&nF[0],ADD_VALUES); CHKERRQ(ierr);
660 }
661
662 PetscFunctionReturn(0);
663 }
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Exceptions.hpp:87
PetscErrorCode calculateDmat(int side, EntityType type, DataForcesAndSourcesCore::EntData &data)

Member Data Documentation

◆ appliedStrain

VectorDouble BCs_RVELagrange_Periodic::OpRVEBCsPeriodicRhs::appliedStrain

Definition at line 616 of file BCs_RVELagrange_Periodic.hpp.

◆ F

vector<Vec>& BCs_RVELagrange_Periodic::OpRVEBCsPeriodicRhs::F

Definition at line 599 of file BCs_RVELagrange_Periodic.hpp.

◆ nF

VectorDouble BCs_RVELagrange_Periodic::OpRVEBCsPeriodicRhs::nF

Definition at line 617 of file BCs_RVELagrange_Periodic.hpp.


The documentation for this struct was generated from the following file: