v0.14.0
Public Member Functions | Public Attributes | List of all members
BCs_RVELagrange_Trac::OpRVEBCsRhs_Cal Struct Reference

\biref operator to calculate the RHS of the constrain for the RVE boundary conditions More...

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

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

Public Member Functions

 OpRVEBCsRhs_Cal (const string field_name, RVEBC_Data &data, CommonData &common_data, CommonFunctions &common_functions, bool ho_geometry=false)
 
PetscErrorCode doWork (int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
 

Public Attributes

RVEBC_DatadAta
 
bool hoGeometry
 
CommonDatacommonData
 
CommonFunctionscommonFunctions
 
MatrixDouble X_mat
 
MatrixDouble N_mat
 
MatrixDouble NTX
 
MatrixDouble H_mat
 

Detailed Description

\biref operator to calculate the RHS of the constrain for the RVE boundary conditions

Definition at line 263 of file BCs_RVELagrange_Trac.hpp.

Constructor & Destructor Documentation

◆ OpRVEBCsRhs_Cal()

BCs_RVELagrange_Trac::OpRVEBCsRhs_Cal::OpRVEBCsRhs_Cal ( const string  field_name,
RVEBC_Data data,
CommonData common_data,
CommonFunctions common_functions,
bool  ho_geometry = false 
)
inline

Definition at line 270 of file BCs_RVELagrange_Trac.hpp.

272  :
274  dAta(data),
275  hoGeometry(ho_geometry),
276  commonData(common_data),
278  }

Member Function Documentation

◆ doWork()

PetscErrorCode BCs_RVELagrange_Trac::OpRVEBCsRhs_Cal::doWork ( int  side,
EntityType  type,
DataForcesAndSourcesCore::EntData data 
)
inline

Definition at line 282 of file BCs_RVELagrange_Trac.hpp.

282  {
283  PetscFunctionBegin;
284 
285  if(type!=MBVERTEX) PetscFunctionReturn(0);
286  if(data.getIndices().size()==0) PetscFunctionReturn(0);
287 
288  auto weak_ptr_dof =
289  getNumeredEntFiniteElementPtr()->getRowDofsByPetscGlobalDofIdx(
290  data.getIndices()[0]);
291  const FENumeredDofEntity *dof_ptr;
292  if (auto ptr = weak_ptr_dof.lock())
293  dof_ptr = ptr.get();
294  else
295  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Dof not found");
296 
297  int rank = dof_ptr->getNbOfCoeffs();
298 
299  double x,y,z;
300  for(unsigned int gg = 0;gg<data.getN().size1();gg++) {
301  double area;
302  if(hoGeometry) {
303  area = norm_2(getNormalsAtGaussPts(gg))*0.5;
304  } else {
305  area = getArea();
306  }
307  double val = getGaussPts()(2,gg)*area;
308 
309  x = getCoordsAtGaussPts()(gg,0);
310  y = getCoordsAtGaussPts()(gg,1);
311  z = getCoordsAtGaussPts()(gg,2);
312 
313  switch(rank) {
314  case 3: //mech problem
315  X_mat.resize(rank,6,false);
316  X_mat.clear();
317  X_mat(0,0) = 2.0*x; X_mat(0,3) = y; X_mat(0,5) = z;
318  X_mat(1,1) = 2.0*y; X_mat(1,3) = x; X_mat(1,4) = z;
319  X_mat(2,2) = 2.0*z; X_mat(2,4) = y; X_mat(2,5) = x;
320  X_mat=0.5*X_mat;
321  break;
322  case 1: //moisture transport or thermal problem
323  X_mat.resize(rank,3,false);
324  X_mat.clear();
325  X_mat(0,0) = x;
326  X_mat(0,1) = y;
327  X_mat(0,2) = z;
328  break;
329  default:
330  SETERRQ(PETSC_COMM_SELF,MOFEM_NOT_IMPLEMENTED,"not implemented");
331  }
332  ierr = commonFunctions.shapeMat(rank, gg, data, N_mat); CHKERRQ(ierr);
333  ierr = commonFunctions.hMat(getNormalsAtGaussPts(gg), rank, N_mat, H_mat); CHKERRQ(ierr);
334 
335  if(gg==0) {
336  NTX = val*prod(trans(N_mat),X_mat);
337  commonData.D_mat = prod(H_mat, NTX);
338  } else {
339  noalias(NTX) = val*prod(trans(N_mat),X_mat);
340  commonData.D_mat += prod(H_mat, NTX);
341  }
342  }
343 
344  PetscFunctionReturn(0);
345  }

Member Data Documentation

◆ commonData

CommonData& BCs_RVELagrange_Trac::OpRVEBCsRhs_Cal::commonData

Definition at line 267 of file BCs_RVELagrange_Trac.hpp.

◆ commonFunctions

CommonFunctions& BCs_RVELagrange_Trac::OpRVEBCsRhs_Cal::commonFunctions

Definition at line 268 of file BCs_RVELagrange_Trac.hpp.

◆ dAta

RVEBC_Data& BCs_RVELagrange_Trac::OpRVEBCsRhs_Cal::dAta

Definition at line 265 of file BCs_RVELagrange_Trac.hpp.

◆ H_mat

MatrixDouble BCs_RVELagrange_Trac::OpRVEBCsRhs_Cal::H_mat

Definition at line 280 of file BCs_RVELagrange_Trac.hpp.

◆ hoGeometry

bool BCs_RVELagrange_Trac::OpRVEBCsRhs_Cal::hoGeometry

Definition at line 266 of file BCs_RVELagrange_Trac.hpp.

◆ N_mat

MatrixDouble BCs_RVELagrange_Trac::OpRVEBCsRhs_Cal::N_mat

Definition at line 280 of file BCs_RVELagrange_Trac.hpp.

◆ NTX

MatrixDouble BCs_RVELagrange_Trac::OpRVEBCsRhs_Cal::NTX

Definition at line 280 of file BCs_RVELagrange_Trac.hpp.

◆ X_mat

MatrixDouble BCs_RVELagrange_Trac::OpRVEBCsRhs_Cal::X_mat

Definition at line 280 of file BCs_RVELagrange_Trac.hpp.


The documentation for this struct was generated from the following file:
BCs_RVELagrange_Trac::OpRVEBCsRhs_Cal::commonData
CommonData & commonData
Definition: BCs_RVELagrange_Trac.hpp:267
BCs_RVELagrange_Trac::CommonFunctions::hMat
PetscErrorCode hMat(VectorDouble face_normal, int rank, MatrixDouble &n_mat, MatrixDouble &h_mat)
Definition: BCs_RVELagrange_Trac.hpp:58
BCs_RVELagrange_Trac::OpRVEBCsRhs_Cal::N_mat
MatrixDouble N_mat
Definition: BCs_RVELagrange_Trac.hpp:280
BCs_RVELagrange_Trac::OpRVEBCsRhs_Cal::NTX
MatrixDouble NTX
Definition: BCs_RVELagrange_Trac.hpp:280
convert.type
type
Definition: convert.py:64
MoFEM::ForcesAndSourcesCore::UserDataOperator::OPCOL
@ OPCOL
operator doWork function is executed on FE columns
Definition: ForcesAndSourcesCore.hpp:568
BCs_RVELagrange_Trac::OpRVEBCsRhs_Cal::H_mat
MatrixDouble H_mat
Definition: BCs_RVELagrange_Trac.hpp:280
BCs_RVELagrange_Disp::common_functions
CommonFunctions common_functions
Definition: BCs_RVELagrange_Disp.hpp:434
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
BCs_RVELagrange_Trac::OpRVEBCsRhs_Cal::dAta
RVEBC_Data & dAta
Definition: BCs_RVELagrange_Trac.hpp:265
UserDataOperator
ForcesAndSourcesCore::UserDataOperator UserDataOperator
Definition: HookeElement.hpp:75
BCs_RVELagrange_Trac::OpRVEBCsRhs_Cal::commonFunctions
CommonFunctions & commonFunctions
Definition: BCs_RVELagrange_Trac.hpp:268
MoFEM::Exceptions::ierr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Exceptions.hpp:76
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
BCs_RVELagrange_Trac::OpRVEBCsRhs_Cal::hoGeometry
bool hoGeometry
Definition: BCs_RVELagrange_Trac.hpp:266
BCs_RVELagrange_Trac::OpRVEBCsRhs_Cal::X_mat
MatrixDouble X_mat
Definition: BCs_RVELagrange_Trac.hpp:280
MOFEM_NOT_IMPLEMENTED
@ MOFEM_NOT_IMPLEMENTED
Definition: definitions.h:32
BCs_RVELagrange_Trac::CommonData::D_mat
MatrixDouble D_mat
Definition: BCs_RVELagrange_Trac.hpp:27
BCs_RVELagrange_Trac::CommonFunctions::shapeMat
PetscErrorCode shapeMat(int rank, unsigned int gg, DataForcesAndSourcesCore::EntData &col_data, MatrixDouble &n)
Definition: BCs_RVELagrange_Trac.hpp:33