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

\biref operator to calculate the RVE homogenised stress More...

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

Inheritance diagram for BCs_RVELagrange_Disp::OpRVEHomoStress:
[legend]
Collaboration diagram for BCs_RVELagrange_Disp::OpRVEHomoStress:
[legend]

Public Member Functions

 OpRVEHomoStress (const string field_name, const string lagrang_field_name, Vec stress_homo, RVEBC_Data &data, bool ho_geometry=false)
 
PetscErrorCode doWork (int side, EntityType type, DataForcesAndSurcesCore::EntData &data)
 
- Public Member Functions inherited from BCs_RVELagrange_Disp::OpDmatRhs
 OpDmatRhs (const string field_name, const string lagrang_field_name, RVEBC_Data &data, bool ho_geometry=false)
 
PetscErrorCode calculateDmat (int side, EntityType type, DataForcesAndSurcesCore::EntData &data)
 

Public Attributes

Vec Stress_Homo
 
VectorDouble Stress_Homo_elem
 
- Public Attributes inherited from BCs_RVELagrange_Disp::OpDmatRhs
RVEBC_DatadAta
 
bool hoGeometry
 
VectorDouble f
 
VectorDouble applied_strain
 
MatrixDouble X_mat
 
MatrixDouble N_mat
 
MatrixDouble D_mat
 
int rank
 
int nb_row_dofs
 

Detailed Description

\biref operator to calculate the RVE homogenised stress

Definition at line 586 of file BCs_RVELagrange_Disp.hpp.

Constructor & Destructor Documentation

◆ OpRVEHomoStress()

BCs_RVELagrange_Disp::OpRVEHomoStress::OpRVEHomoStress ( const string  field_name,
const string  lagrang_field_name,
Vec  stress_homo,
RVEBC_Data data,
bool  ho_geometry = false 
)
inline

Definition at line 590 of file BCs_RVELagrange_Disp.hpp.

596 :
597 OpDmatRhs(field_name,lagrang_field_name,data,ho_geometry),
598 Stress_Homo(stress_homo) {
599 }
constexpr auto field_name
OpDmatRhs(const string field_name, const string lagrang_field_name, RVEBC_Data &data, bool ho_geometry=false)

Member Function Documentation

◆ doWork()

PetscErrorCode BCs_RVELagrange_Disp::OpRVEHomoStress::doWork ( int  side,
EntityType  type,
DataForcesAndSurcesCore::EntData &  data 
)
inline

Definition at line 603 of file BCs_RVELagrange_Disp.hpp.

603 {
604 PetscFunctionBegin;
605 if(data.getIndices().size()==0) PetscFunctionReturn(0);
606 if(dAta.tRis.find(getNumeredEntFiniteElementPtr()->getEnt())==dAta.tRis.end()) PetscFunctionReturn(0);
607 // cout<<"OpRVEBCsRhs "<<endl;
608
609
610 const FENumeredDofEntity *dof_ptr;
611 ierr = getNumeredEntFiniteElementPtr()->getRowDofsByPetscGlobalDofIdx(data.getIndices()[0],&dof_ptr); CHKERRQ(ierr);
612 rank = dof_ptr->getNbOfCoeffs();
613 nb_row_dofs = data.getIndices().size()/rank;
614
615 ierr = calculateDmat(side,type,data); CHKERRQ(ierr);
616
617 Stress_Homo_elem.resize(D_mat.size2());
618
619 // data.getFieldData() is value of Lagrange multply
620 // data.getFieldData() is reaction force (so multiply for -1 to get the force)
621 noalias(Stress_Homo_elem) = prod(trans(D_mat), -data.getFieldData());
622
623 const int Indices6[6] = {0, 1, 2, 3, 4, 5};
624 const int Indices3[3] = {0, 1, 2};
625 switch(rank) {
626 case 3:
627 ierr = VecSetValues(Stress_Homo,6,Indices6,&(Stress_Homo_elem.data())[0],ADD_VALUES); CHKERRQ(ierr);
628 break;
629 case 1:
630 ierr = VecSetValues(Stress_Homo,3,Indices3,&(Stress_Homo_elem.data())[0],ADD_VALUES); CHKERRQ(ierr);
631 break;
632 default:
633 SETERRQ(PETSC_COMM_SELF,1,"not implemented");
634 }
635
636 PetscFunctionReturn(0);
637 }
static PetscErrorCode ierr
MoFEMErrorCode VecSetValues(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.
PetscErrorCode calculateDmat(int side, EntityType type, DataForcesAndSurcesCore::EntData &data)

Member Data Documentation

◆ Stress_Homo

Vec BCs_RVELagrange_Disp::OpRVEHomoStress::Stress_Homo

Definition at line 588 of file BCs_RVELagrange_Disp.hpp.

◆ Stress_Homo_elem

VectorDouble BCs_RVELagrange_Disp::OpRVEHomoStress::Stress_Homo_elem

Definition at line 601 of file BCs_RVELagrange_Disp.hpp.


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