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

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

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

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

Public Member Functions

 OpRVEBCsRhs (const string field_name, const string lagrang_field_name, Vec f, VectorDouble given_strain, boost::ptr_vector< MethodForForceScaling > &methods_op, 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 F
 
VectorDouble givenStrain
 
boost::ptr_vector< MethodForForceScaling > & methodsOp
 
- 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 of the constrain for the RVE boundary conditions

Definition at line 305 of file BCs_RVELagrange_Disp.hpp.

Constructor & Destructor Documentation

◆ OpRVEBCsRhs()

BCs_RVELagrange_Disp::OpRVEBCsRhs::OpRVEBCsRhs ( const string  field_name,
const string  lagrang_field_name,
Vec  f,
VectorDouble  given_strain,
boost::ptr_vector< MethodForForceScaling > &  methods_op,
RVEBC_Data data,
bool  ho_geometry = false 
)
inline

Definition at line 310 of file BCs_RVELagrange_Disp.hpp.

313 :
314 OpDmatRhs(field_name,lagrang_field_name,data,ho_geometry),F(f),givenStrain(given_strain),methodsOp(methods_op) {
315 }
constexpr auto field_name
OpDmatRhs(const string field_name, const string lagrang_field_name, RVEBC_Data &data, bool ho_geometry=false)
boost::ptr_vector< MethodForForceScaling > & methodsOp

Member Function Documentation

◆ doWork()

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

Definition at line 317 of file BCs_RVELagrange_Disp.hpp.

317 {
318 PetscFunctionBegin;
319
320 nb_row_dofs = data.getIndices().size();
321
322 if(nb_row_dofs ==0) PetscFunctionReturn(0);
323 if(dAta.tRis.find(getNumeredEntFiniteElementPtr()->getEnt())==dAta.tRis.end()) PetscFunctionReturn(0);
324
325 auto weak_ptr_dof =
326 getNumeredEntFiniteElementPtr()->getRowDofsByPetscGlobalDofIdx(
327 data.getIndices()[0]);
328 const FENumeredDofEntity *dof_ptr;
329 if (auto ptr = weak_ptr_dof.lock())
330 dof_ptr = ptr.get();
331 else
332 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Dof not found");
333
334 rank = dof_ptr->getNbOfCoeffs();
335 nb_row_dofs /= rank;
336
337 ierr = calculateDmat(side,type,data); CHKERRQ(ierr);
338
339 //This is to scale givenStrain vector to apply the strian in steps
340 VectorDouble scaled_given_strain;
341 scaled_given_strain.resize(6);
342 scaled_given_strain=givenStrain;
343// cout <<"givenStrain Before = "<<scaled_given_strain<<endl;
344 ierr = MethodForForceScaling::applyScale(getFEMethod(),methodsOp,scaled_given_strain); CHKERRQ(ierr);
345// cout <<"givenStrain After = "<<scaled_given_strain<<endl;
346 f.resize(D_mat.size1(),false);
347 noalias(f) = prod(D_mat, scaled_given_strain);
348 f*=-1;
349
350// cout <<"f = "<<f<<endl;
351// string wait;
352// cin>>wait;
353
354 Vec myF = F;
355 if(F == PETSC_NULL) {
356 myF = getFEMethod()->snes_f;
357 }
358
359 ierr = VecSetValues(myF,data.getIndices().size(),&data.getIndices()[0],&f[0],ADD_VALUES); CHKERRQ(ierr);
360 PetscFunctionReturn(0);
361 }
static PetscErrorCode ierr
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
const FTensor::Tensor2< T, Dim, Dim > Vec
UBlasVector< double > VectorDouble
Definition: Types.hpp:68
MoFEMErrorCode VecSetValues(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.
PetscErrorCode calculateDmat(int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
static MoFEMErrorCode applyScale(const FEMethod *fe, boost::ptr_vector< MethodForForceScaling > &methods_op, VectorDouble &nf)

Member Data Documentation

◆ F

Vec BCs_RVELagrange_Disp::OpRVEBCsRhs::F

Definition at line 306 of file BCs_RVELagrange_Disp.hpp.

◆ givenStrain

VectorDouble BCs_RVELagrange_Disp::OpRVEBCsRhs::givenStrain

Definition at line 307 of file BCs_RVELagrange_Disp.hpp.

◆ methodsOp

boost::ptr_vector<MethodForForceScaling>& BCs_RVELagrange_Disp::OpRVEBCsRhs::methodsOp

Definition at line 308 of file BCs_RVELagrange_Disp.hpp.


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