v0.14.0
Public Member Functions | Public Attributes | List of all members
BCs_RVELagrange_Disp::OpRVEBCsRhsHomoC Struct Reference

\biref operator to calculate the RHS for the calculation of the homgoensied stiffness matrix More...

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

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

Public Member Functions

 OpRVEBCsRhsHomoC (const string field_name, const string lagrang_field_name, vector< Vec > &f, 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

vector< Vec > & F
 
- 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 RHS for the calculation of the homgoensied stiffness matrix

Definition at line 365 of file BCs_RVELagrange_Disp.hpp.

Constructor & Destructor Documentation

◆ OpRVEBCsRhsHomoC()

BCs_RVELagrange_Disp::OpRVEBCsRhsHomoC::OpRVEBCsRhsHomoC ( const string  field_name,
const string  lagrang_field_name,
vector< Vec > &  f,
RVEBC_Data data,
bool  ho_geometry = false 
)
inline

Definition at line 369 of file BCs_RVELagrange_Disp.hpp.

372  :
373  OpDmatRhs(field_name,lagrang_field_name,data,ho_geometry),F(f) {
374  }

Member Function Documentation

◆ doWork()

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

Definition at line 376 of file BCs_RVELagrange_Disp.hpp.

376  {
377  PetscFunctionBegin;
378 
379  nb_row_dofs = data.getIndices().size();
380 
381  if(nb_row_dofs ==0) PetscFunctionReturn(0);
382  if(dAta.tRis.find(getNumeredEntFiniteElementPtr()->getEnt())==dAta.tRis.end()) PetscFunctionReturn(0);
383 
384  auto weak_ptr_dof =
385  getNumeredEntFiniteElementPtr()->getRowDofsByPetscGlobalDofIdx(
386  data.getIndices()[0]);
387  const FENumeredDofEntity *dof_ptr;
388  if (auto ptr = weak_ptr_dof.lock())
389  dof_ptr = ptr.get();
390  else
391  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Dof not found");
392 
393  rank = dof_ptr->getNbOfCoeffs();
394  nb_row_dofs /= rank;
395 
396  ierr = calculateDmat(side,type,data); CHKERRQ(ierr);
397 
398  applied_strain.resize(D_mat.size2(),false);
399  f.resize(D_mat.size1(),false);
400 
401  int size = (rank == 3) ? 6 : 3;
402  for(int ii = 0;ii<size;ii++) {
403  applied_strain.clear();
404  applied_strain[ii] = 1.0;
405  noalias(f) = prod(D_mat, applied_strain);
406  ierr = VecSetValues(
407  F[ii],data.getIndices().size(),&data.getIndices()[0],&f[0],ADD_VALUES
408  ); CHKERRQ(ierr);
409  }
410 
411  PetscFunctionReturn(0);
412 
413  }

Member Data Documentation

◆ F

vector<Vec>& BCs_RVELagrange_Disp::OpRVEBCsRhsHomoC::F

Definition at line 367 of file BCs_RVELagrange_Disp.hpp.


The documentation for this struct was generated from the following file:
BCs_RVELagrange_Disp::OpDmatRhs::D_mat
MatrixDouble D_mat
Definition: BCs_RVELagrange_Disp.hpp:234
BCs_RVELagrange_Disp::OpDmatRhs::f
VectorDouble f
Definition: BCs_RVELagrange_Disp.hpp:233
BCs_RVELagrange_Disp::RVEBC_Data::tRis
Range tRis
Definition: BCs_RVELagrange_Disp.hpp:54
BCs_RVELagrange_Disp::OpRVEBCsRhsHomoC::F
vector< Vec > & F
Definition: BCs_RVELagrange_Disp.hpp:367
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::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
BCs_RVELagrange_Disp::OpDmatRhs::applied_strain
VectorDouble applied_strain
Definition: BCs_RVELagrange_Disp.hpp:233