v0.14.0
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/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, DataForcesAndSourcesCore::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, DataForcesAndSourcesCore::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 610 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 614 of file BCs_RVELagrange_Disp.hpp.

620  :
621  OpDmatRhs(field_name,lagrang_field_name,data,ho_geometry),
622  Stress_Homo(stress_homo) {
623  }

Member Function Documentation

◆ doWork()

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

Definition at line 627 of file BCs_RVELagrange_Disp.hpp.

627  {
628  PetscFunctionBegin;
629  if(data.getIndices().size()==0) PetscFunctionReturn(0);
630  if(dAta.tRis.find(getNumeredEntFiniteElementPtr()->getEnt())==dAta.tRis.end()) PetscFunctionReturn(0);
631  // cout<<"OpRVEBCsRhs "<<endl;
632 
633 
634  auto weak_ptr_dof =
635  getNumeredEntFiniteElementPtr()->getRowDofsByPetscGlobalDofIdx(
636  data.getIndices()[0]);
637  const FENumeredDofEntity *dof_ptr;
638  if (auto ptr = weak_ptr_dof.lock())
639  dof_ptr = ptr.get();
640  else
641  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Dof not found");
642 
643  rank = dof_ptr->getNbOfCoeffs();
644  nb_row_dofs = data.getIndices().size()/rank;
645 
646  ierr = calculateDmat(side,type,data); CHKERRQ(ierr);
647 
648  Stress_Homo_elem.resize(D_mat.size2());
649 
650  // data.getFieldData() is value of Lagrange multply
651  // data.getFieldData() is reaction force (so multiply for -1 to get the force)
652  noalias(Stress_Homo_elem) = prod(trans(D_mat), -data.getFieldData());
653 
654  const int Indices6[6] = {0, 1, 2, 3, 4, 5};
655  const int Indices3[3] = {0, 1, 2};
656  switch(rank) {
657  case 3:
658  ierr = VecSetValues(Stress_Homo,6,Indices6,&(Stress_Homo_elem.data())[0],ADD_VALUES); CHKERRQ(ierr);
659  break;
660  case 1:
661  ierr = VecSetValues(Stress_Homo,3,Indices3,&(Stress_Homo_elem.data())[0],ADD_VALUES); CHKERRQ(ierr);
662  break;
663  default:
664  SETERRQ(PETSC_COMM_SELF,1,"not implemented");
665  }
666 
667  PetscFunctionReturn(0);
668  }

Member Data Documentation

◆ Stress_Homo

Vec BCs_RVELagrange_Disp::OpRVEHomoStress::Stress_Homo

Definition at line 612 of file BCs_RVELagrange_Disp.hpp.

◆ Stress_Homo_elem

VectorDouble BCs_RVELagrange_Disp::OpRVEHomoStress::Stress_Homo_elem

Definition at line 625 of file BCs_RVELagrange_Disp.hpp.


The documentation for this struct was generated from the following file:
BCs_RVELagrange_Disp::OpRVEHomoStress::Stress_Homo
Vec Stress_Homo
Definition: BCs_RVELagrange_Disp.hpp:612
BCs_RVELagrange_Disp::OpDmatRhs::D_mat
MatrixDouble D_mat
Definition: BCs_RVELagrange_Disp.hpp:234
BCs_RVELagrange_Disp::RVEBC_Data::tRis
Range tRis
Definition: BCs_RVELagrange_Disp.hpp:54
MoFEM::VecSetValues
MoFEMErrorCode VecSetValues(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.
Definition: EntitiesFieldData.hpp:1576
BCs_RVELagrange_Disp::OpDmatRhs::nb_row_dofs
int nb_row_dofs
Definition: BCs_RVELagrange_Disp.hpp:236
convert.type
type
Definition: convert.py:64
BCs_RVELagrange_Disp::OpRVEHomoStress::Stress_Homo_elem
VectorDouble Stress_Homo_elem
Definition: BCs_RVELagrange_Disp.hpp:625
BCs_RVELagrange_Disp::OpDmatRhs::rank
int rank
Definition: BCs_RVELagrange_Disp.hpp:236
BCs_RVELagrange_Disp::OpDmatRhs::calculateDmat
PetscErrorCode calculateDmat(int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
Definition: BCs_RVELagrange_Disp.hpp:238
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
BCs_RVELagrange_Disp::OpDmatRhs::OpDmatRhs
OpDmatRhs(const string field_name, const string lagrang_field_name, RVEBC_Data &data, bool ho_geometry=false)
Definition: BCs_RVELagrange_Disp.hpp:223
BCs_RVELagrange_Disp::OpDmatRhs::dAta
RVEBC_Data & dAta
Definition: BCs_RVELagrange_Disp.hpp:220
MoFEM::Exceptions::ierr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Exceptions.hpp:76
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31