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

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

Inherits FlatPrismElementForcesAndSurcesCore::UserDataOperator.

Collaboration diagram for BCs_RVELagrange_Periodic::OpRVEBCsPeriodicCalCU:
[legend]

Public Member Functions

 OpRVEBCsPeriodicCalCU (const string field_name, RVEBC_Data_Periodic &data, Vec f, CommonDataPeriodic &common_data_periodic, CommonFunctionsPeriodic &common_functions_periodic, bool ho_geometry=false)
 
PetscErrorCode doWork (int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
 

Public Attributes

Vec F
 
RVEBC_Data_PeriodicdAta
 
bool hoGeometry
 
CommonDataPeriodiccommonDataPeriodic
 
CommonFunctionsPeriodiccommonFunctionsPeriodic
 
ublas::vector< int > row_ind
 
VectorDouble fe1
 
VectorDouble fe2
 
MatrixDouble N_mat
 

Detailed Description

Definition at line 825 of file BCs_RVELagrange_Periodic.hpp.

Constructor & Destructor Documentation

◆ OpRVEBCsPeriodicCalCU()

BCs_RVELagrange_Periodic::OpRVEBCsPeriodicCalCU::OpRVEBCsPeriodicCalCU ( const string  field_name,
RVEBC_Data_Periodic data,
Vec  f,
CommonDataPeriodic common_data_periodic,
CommonFunctionsPeriodic common_functions_periodic,
bool  ho_geometry = false 
)

Definition at line 833 of file BCs_RVELagrange_Periodic.hpp.

840 :
842 field_name,UserDataOperator::OPROW
843 ),
844 F(f),
845 dAta(data),
846 hoGeometry(ho_geometry),
847 commonDataPeriodic(common_data_periodic),
848 commonFunctionsPeriodic(common_functions_periodic) {
849 }
ForcesAndSourcesCore::UserDataOperator UserDataOperator
constexpr auto field_name

Member Function Documentation

◆ doWork()

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

Definition at line 857 of file BCs_RVELagrange_Periodic.hpp.

857 {
858 PetscFunctionBegin;
859// cout<<" OpRVEBCsPeriodicCalCU "<<endl;
860 if(data.getIndices().size()==0) PetscFunctionReturn(0);
861 if(type == MBQUAD) PetscFunctionReturn(0);
862 if(type == MBEDGE && side >= 3) PetscFunctionReturn(0); //ignore second triangel edges (cananical number 6 to 8)
863 if(type == MBTRI && side == 4) PetscFunctionReturn(0); //ignore second triangel face (cananical number 4)
864
865 int rank = data.getFieldDofs()[0]->getNbOfCoeffs();
866
867 if(type == MBVERTEX) {
868 int nb=data.getIndices().size()/2; //for one face for nodes only (total indieces are for both faces)
869 row_ind.resize(nb); //1st face of prism -- nodes
870 for(int ii=0; ii<nb; ii++){
871 row_ind[ii]=data.getIndices()[ii];
872 }
873 }
874
875 for(unsigned int gg = 0;gg<data.getN().size1();gg++) {
876 double area;
877 VectorDouble normal_f3 = getNormalsAtGaussPtsF3(gg);
878 area = cblas_dnrm2(3,&normal_f3[0],1)*0.5;
879 double val = getGaussPts()(2,gg)*area;
880
881 if(type == MBVERTEX) {
882 ierr = commonFunctionsPeriodic.shapeMat(rank, gg, data, N_mat, 2); CHKERRQ(ierr);}
883 else {
884 ierr = commonFunctionsPeriodic.shapeMat(rank, gg, data, N_mat); CHKERRQ(ierr);}
885
886 if(gg==0){
887 fe1=-val*prod(trans(N_mat), commonDataPeriodic.DispAtGaussPts[0][gg]);
888 fe2= val*prod(trans(N_mat), commonDataPeriodic.DispAtGaussPts[1][gg]);}
889 else{
890 fe1+=-val*prod(trans(N_mat), commonDataPeriodic.DispAtGaussPts[0][gg]);
891 fe2+= val*prod(trans(N_mat), commonDataPeriodic.DispAtGaussPts[1][gg]);}
892 }
893
894 if(type == MBVERTEX) {
895 ierr = VecSetValues(F,row_ind.size(),&row_ind[0],&fe1[0],ADD_VALUES); CHKERRQ(ierr);
896 ierr = VecSetValues(F,row_ind.size(),&row_ind[0],&fe2[0],ADD_VALUES); CHKERRQ(ierr);}
897 else{
898 ierr = VecSetValues(F,data.getIndices().size(),&data.getIndices()[0],&fe1[0],ADD_VALUES); CHKERRQ(ierr);
899 ierr = VecSetValues(F,data.getIndices().size(),&data.getIndices()[0],&fe2[0],ADD_VALUES); CHKERRQ(ierr);}
900
901 PetscFunctionReturn(0);
902 }
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Exceptions.hpp:87
UBlasVector< double > VectorDouble
Definition: Types.hpp:79
ublas::vector< ublas::vector< VectorDouble > > DispAtGaussPts
PetscErrorCode shapeMat(int rank, unsigned int gg, DataForcesAndSourcesCore::EntData &col_data, MatrixDouble &N_mat, int div=1)

Member Data Documentation

◆ commonDataPeriodic

CommonDataPeriodic& BCs_RVELagrange_Periodic::OpRVEBCsPeriodicCalCU::commonDataPeriodic

Definition at line 830 of file BCs_RVELagrange_Periodic.hpp.

◆ commonFunctionsPeriodic

CommonFunctionsPeriodic& BCs_RVELagrange_Periodic::OpRVEBCsPeriodicCalCU::commonFunctionsPeriodic

Definition at line 831 of file BCs_RVELagrange_Periodic.hpp.

◆ dAta

RVEBC_Data_Periodic& BCs_RVELagrange_Periodic::OpRVEBCsPeriodicCalCU::dAta

Definition at line 828 of file BCs_RVELagrange_Periodic.hpp.

◆ F

Vec BCs_RVELagrange_Periodic::OpRVEBCsPeriodicCalCU::F

Definition at line 827 of file BCs_RVELagrange_Periodic.hpp.

◆ fe1

VectorDouble BCs_RVELagrange_Periodic::OpRVEBCsPeriodicCalCU::fe1

Definition at line 853 of file BCs_RVELagrange_Periodic.hpp.

◆ fe2

VectorDouble BCs_RVELagrange_Periodic::OpRVEBCsPeriodicCalCU::fe2

Definition at line 853 of file BCs_RVELagrange_Periodic.hpp.

◆ hoGeometry

bool BCs_RVELagrange_Periodic::OpRVEBCsPeriodicCalCU::hoGeometry

Definition at line 829 of file BCs_RVELagrange_Periodic.hpp.

◆ N_mat

MatrixDouble BCs_RVELagrange_Periodic::OpRVEBCsPeriodicCalCU::N_mat

Definition at line 854 of file BCs_RVELagrange_Periodic.hpp.

◆ row_ind

ublas::vector<int> BCs_RVELagrange_Periodic::OpRVEBCsPeriodicCalCU::row_ind

Definition at line 852 of file BCs_RVELagrange_Periodic.hpp.


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