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

\biref operator to calculate and assemble CU More...

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

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

Public Member Functions

 OpRVEBCsRhsForceExternal_CU (const string field_name, const string lagrang_field_name, Vec f, CommonFunctions &_common_functions, RVEBC_Data &data, bool ho_geometry=false)
 
PetscErrorCode doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, DataForcesAndSurcesCore::EntData &row_data, DataForcesAndSurcesCore::EntData &col_data)
 

Public Attributes

bool hoGeometry
 
Vec F
 
RVEBC_DatadAta
 
CommonFunctions commonFunctions
 
MatrixDouble K
 
MatrixDouble transK
 
MatrixDouble N_mat_row
 
MatrixDouble N_mat_col
 
VectorDouble CU
 
VectorDouble CTLam
 

Detailed Description

\biref operator to calculate and assemble CU

Definition at line 420 of file BCs_RVELagrange_Disp.hpp.

Constructor & Destructor Documentation

◆ OpRVEBCsRhsForceExternal_CU()

BCs_RVELagrange_Disp::OpRVEBCsRhsForceExternal_CU::OpRVEBCsRhsForceExternal_CU ( const string  field_name,
const string  lagrang_field_name,
Vec  f,
CommonFunctions _common_functions,
RVEBC_Data data,
bool  ho_geometry = false 
)
inline

Definition at line 428 of file BCs_RVELagrange_Disp.hpp.

431 :
432 FaceElementForcesAndSourcesCore::UserDataOperator(
433 lagrang_field_name, field_name, UserDataOperator::OPROWCOL
434 ),
435 dAta(data),hoGeometry(ho_geometry),F(f), commonFunctions(_common_functions){
436 // This will make sure to loop over all entities
437 // (e.g. for order=2 it will make doWork to loop 16 time)
438 sYmm = false;
439 }
constexpr auto field_name
@ OPROWCOL
operator doWork is executed on FE rows &columns

Member Function Documentation

◆ doWork()

PetscErrorCode BCs_RVELagrange_Disp::OpRVEBCsRhsForceExternal_CU::doWork ( int  row_side,
int  col_side,
EntityType  row_type,
EntityType  col_type,
DataForcesAndSurcesCore::EntData &  row_data,
DataForcesAndSurcesCore::EntData &  col_data 
)
inline

Definition at line 444 of file BCs_RVELagrange_Disp.hpp.

449 {
450 PetscFunctionBegin;
451
452 try {
453 int nb_row = row_data.getIndices().size();
454 int nb_col = col_data.getIndices().size();
455
456 if(nb_row == 0) PetscFunctionReturn(0);
457 if(nb_col == 0) PetscFunctionReturn(0);
458
459
460
461 const FENumeredDofEntity *dof_ptr;
462 ierr = getNumeredEntFiniteElementPtr()->getRowDofsByPetscGlobalDofIdx(row_data.getIndices()[0],&dof_ptr); CHKERRQ(ierr);
463 int rank = dof_ptr->getNbOfCoeffs();
464 for(unsigned int gg = 0;gg<row_data.getN().size1();gg++) {
465 double area;
466 if(hoGeometry) {
467 area = norm_2(getNormalsAtGaussPt(gg))*0.5;
468 } else {
469 area = getArea();
470 }
471 double val = getGaussPts()(2,gg)*area;
472 ierr = commonFunctions.shapeMat(rank, gg, row_data, N_mat_row); CHKERRQ(ierr);
473 ierr = commonFunctions.shapeMat(rank, gg, col_data, N_mat_col); CHKERRQ(ierr);
474
475// cout<<"row_data.getN() "<<row_data.getN()<<endl;
476// cout<<"N_mat_row() "<<N_mat_row<<endl;
477//
478// cout<<"col_data.getN() "<<col_data.getN()<<endl;
479// cout<<"N_mat_col "<<N_mat_col<<endl;
480
481 if(gg==0){
482 K =val* prod(trans(N_mat_row),N_mat_col); //we don't need to define size K
483 } else {
484 K += val*prod(trans(N_mat_row),N_mat_col);
485 }
486 }
487 CU=prod(K, col_data.getFieldData());
488 CTLam=prod(trans(K),row_data.getFieldData());
489
490
491 Vec myF = F;
492 if(F == PETSC_NULL) {
493 myF = getFEMethod()->snes_f;
494 }
495
496 ierr = VecSetValues(myF,row_data.getIndices().size(),&row_data.getIndices()[0],&CU[0],ADD_VALUES); CHKERRQ(ierr);
497 ierr = VecSetValues(myF,col_data.getIndices().size(),&col_data.getIndices()[0],&CTLam[0],ADD_VALUES); CHKERRQ(ierr);
498
499 } catch (const std::exception& ex) {
500 ostringstream ss;
501 ss << "throw in method: " << ex.what() << endl;
502 SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
503 }
504
505 PetscFunctionReturn(0);
506 }
static PetscErrorCode ierr
const FTensor::Tensor2< T, Dim, Dim > Vec
MoFEMErrorCode VecSetValues(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.
PetscErrorCode shapeMat(int rank, unsigned int gg, DataForcesAndSurcesCore::EntData &col_data, MatrixDouble &N_mat)

Member Data Documentation

◆ commonFunctions

CommonFunctions BCs_RVELagrange_Disp::OpRVEBCsRhsForceExternal_CU::commonFunctions

Definition at line 425 of file BCs_RVELagrange_Disp.hpp.

◆ CTLam

VectorDouble BCs_RVELagrange_Disp::OpRVEBCsRhsForceExternal_CU::CTLam

Definition at line 442 of file BCs_RVELagrange_Disp.hpp.

◆ CU

VectorDouble BCs_RVELagrange_Disp::OpRVEBCsRhsForceExternal_CU::CU

Definition at line 442 of file BCs_RVELagrange_Disp.hpp.

◆ dAta

RVEBC_Data& BCs_RVELagrange_Disp::OpRVEBCsRhsForceExternal_CU::dAta

Definition at line 424 of file BCs_RVELagrange_Disp.hpp.

◆ F

Vec BCs_RVELagrange_Disp::OpRVEBCsRhsForceExternal_CU::F

Definition at line 423 of file BCs_RVELagrange_Disp.hpp.

◆ hoGeometry

bool BCs_RVELagrange_Disp::OpRVEBCsRhsForceExternal_CU::hoGeometry

Definition at line 422 of file BCs_RVELagrange_Disp.hpp.

◆ K

MatrixDouble BCs_RVELagrange_Disp::OpRVEBCsRhsForceExternal_CU::K

Definition at line 441 of file BCs_RVELagrange_Disp.hpp.

◆ N_mat_col

MatrixDouble BCs_RVELagrange_Disp::OpRVEBCsRhsForceExternal_CU::N_mat_col

Definition at line 441 of file BCs_RVELagrange_Disp.hpp.

◆ N_mat_row

MatrixDouble BCs_RVELagrange_Disp::OpRVEBCsRhsForceExternal_CU::N_mat_row

Definition at line 441 of file BCs_RVELagrange_Disp.hpp.

◆ transK

MatrixDouble BCs_RVELagrange_Disp::OpRVEBCsRhsForceExternal_CU::transK

Definition at line 441 of file BCs_RVELagrange_Disp.hpp.


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