v0.15.0
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
BCs_RVELagrange_Trac::OpRVEHomoStress_Assemble Struct Reference

#include "users_modules/mofem_um_homogenisation/src/BCs_RVELagrange_Trac.hpp"

Inheritance diagram for BCs_RVELagrange_Trac::OpRVEHomoStress_Assemble:
[legend]
Collaboration diagram for BCs_RVELagrange_Trac::OpRVEHomoStress_Assemble:
[legend]

Public Member Functions

 OpRVEHomoStress_Assemble (const string lagrang_field_name, Vec stress_homo, RVEBC_Data &data, CommonData &common_data)
 
PetscErrorCode doWork (int side, EntityType type, DataForcesAndSurcesCore::EntData &data)
 

Public Attributes

RVEBC_DatadAta
 
CommonDatacommonData
 
Vec stressHomo
 
VectorDouble stressVector
 

Detailed Description

Definition at line 396 of file BCs_RVELagrange_Trac.hpp.

Constructor & Destructor Documentation

◆ OpRVEHomoStress_Assemble()

BCs_RVELagrange_Trac::OpRVEHomoStress_Assemble::OpRVEHomoStress_Assemble ( const string  lagrang_field_name,
Vec  stress_homo,
RVEBC_Data data,
CommonData common_data 
)
inline

Definition at line 402 of file BCs_RVELagrange_Trac.hpp.

404 :
405 FaceElementForcesAndSourcesCore::UserDataOperator(lagrang_field_name,UserDataOperator::OPROW),
406 dAta(data),commonData(common_data),stressHomo(stress_homo) {
407 }
@ OPROW
operator doWork function is executed on FE rows

Member Function Documentation

◆ doWork()

PetscErrorCode BCs_RVELagrange_Trac::OpRVEHomoStress_Assemble::doWork ( int  side,
EntityType  type,
DataForcesAndSurcesCore::EntData &  data 
)
inline

Definition at line 412 of file BCs_RVELagrange_Trac.hpp.

412 {
413 PetscFunctionBegin;
414 if(data.getIndices().size()==0) PetscFunctionReturn(0);
415 if(dAta.tRis.find(getNumeredEntFiniteElementPtr()->getEnt())==dAta.tRis.end()) PetscFunctionReturn(0);
416 stressVector.resize(commonData.D_mat.size2());
417 //Lamda=data.getFieldData() is reaction force (so multiply for -1 to get the force)
418 noalias(stressVector) = prod(trans(commonData.D_mat),-data.getFieldData());
419 const int indices_6[6] = {0, 1, 2, 3, 4, 5};
420 const int indices_3[3] = {0, 1, 2};
421 switch(stressVector.size()) {
422 case 6:
423 ierr = VecSetValues(stressHomo,6,indices_6,&stressVector[0],ADD_VALUES); CHKERRQ(ierr);
424 break;
425 case 3:
426 ierr = VecSetValues(stressHomo,3,indices_3,&stressVector[0],ADD_VALUES); CHKERRQ(ierr);
427 break;
428 default:
429 SETERRQ(PETSC_COMM_SELF,MOFEM_NOT_IMPLEMENTED,"not implemented");
430 }
431 PetscFunctionReturn(0);
432 }
static PetscErrorCode ierr
@ MOFEM_NOT_IMPLEMENTED
Definition definitions.h:32
MoFEMErrorCode VecSetValues(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.

Member Data Documentation

◆ commonData

CommonData& BCs_RVELagrange_Trac::OpRVEHomoStress_Assemble::commonData

Definition at line 399 of file BCs_RVELagrange_Trac.hpp.

◆ dAta

RVEBC_Data& BCs_RVELagrange_Trac::OpRVEHomoStress_Assemble::dAta

Definition at line 398 of file BCs_RVELagrange_Trac.hpp.

◆ stressHomo

Vec BCs_RVELagrange_Trac::OpRVEHomoStress_Assemble::stressHomo

Definition at line 400 of file BCs_RVELagrange_Trac.hpp.

◆ stressVector

VectorDouble BCs_RVELagrange_Trac::OpRVEHomoStress_Assemble::stressVector

Definition at line 410 of file BCs_RVELagrange_Trac.hpp.


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