v0.14.0
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Private Attributes | List of all members
SimpleContactProblem::OpContactMaterialVolOnSideLhs Struct Reference

Operator used as base struct for OpContactMaterialVolOnSideLhs_dX_dx OpContactMaterialVolOnSideLhs_dX_dX operators that use side volume element adjacent to current contact prism needed to evaluate of deformation gradient tensor derivative. More...

#include <users_modules/mortar_contact/src/SimpleContact.hpp>

Inheritance diagram for SimpleContactProblem::OpContactMaterialVolOnSideLhs:
[legend]
Collaboration diagram for SimpleContactProblem::OpContactMaterialVolOnSideLhs:
[legend]

Public Member Functions

MoFEMErrorCode doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
 
virtual MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
 
MoFEMErrorCode aSsemble (EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
 
 OpContactMaterialVolOnSideLhs (const string field_name_1, const string field_name_2, boost::shared_ptr< CommonDataSimpleContact > common_data_contact, const bool is_master)
 LHS-operator for the contact element (material configuration) More...
 

Public Attributes

MatrixDouble matLhs
 
boost::shared_ptr< CommonDataSimpleContactcommonDataSimpleContact
 
VectorInt rowIndices
 
VectorInt colIndices
 
int row_nb_dofs
 
int col_nb_dofs
 
int nb_gauss_pts
 
int nb_base_fun_row
 
int nb_base_fun_col
 
boost::shared_ptr< VectorDouble > tangentOne
 
boost::shared_ptr< VectorDouble > tangentTwo
 
boost::shared_ptr< VectorDouble > normalVector
 
double aRea
 

Private Attributes

bool isMaster
 

Detailed Description

Operator used as base struct for OpContactMaterialVolOnSideLhs_dX_dx OpContactMaterialVolOnSideLhs_dX_dX operators that use side volume element adjacent to current contact prism needed to evaluate of deformation gradient tensor derivative.

Definition at line 594 of file SimpleContact.hpp.

Constructor & Destructor Documentation

◆ OpContactMaterialVolOnSideLhs()

SimpleContactProblem::OpContactMaterialVolOnSideLhs::OpContactMaterialVolOnSideLhs ( const string  field_name_1,
const string  field_name_2,
boost::shared_ptr< CommonDataSimpleContact common_data_contact,
const bool  is_master 
)
inline

LHS-operator for the contact element (material configuration)

Parameters
field_name_1String of field name for spatial positions for rows
field_name_2String of field name for spatial positions for columns
common_data_contactPointer to the common data for simple contact element
is_masterBool parameter to distinguish between master and slave sides

Definition at line 644 of file SimpleContact.hpp.

648 : MoFEM::VolumeElementForcesAndSourcesCoreOnContactPrismSide::
649 UserDataOperator(field_name_1, field_name_2,
650 UserDataOperator::OPROWCOL),
651 commonDataSimpleContact(common_data_contact), isMaster(is_master) {
652 sYmm = false; // This will make sure to loop over all entities
653 normalVector = boost::make_shared<VectorDouble>();
654 tangentOne = boost::make_shared<VectorDouble>();
655 tangentTwo = boost::make_shared<VectorDouble>();
656 }
boost::shared_ptr< VectorDouble > normalVector
boost::shared_ptr< VectorDouble > tangentOne
boost::shared_ptr< CommonDataSimpleContact > commonDataSimpleContact
boost::shared_ptr< VectorDouble > tangentTwo

Member Function Documentation

◆ aSsemble()

MoFEMErrorCode SimpleContactProblem::OpContactMaterialVolOnSideLhs::aSsemble ( EntitiesFieldData::EntData row_data,
EntitiesFieldData::EntData col_data 
)

Definition at line 4402 of file SimpleContact.cpp.

4403 {
4404
4406
4407 // get pointer to first global index on row
4408 const int *row_indices = &*row_data.getIndices().data().begin();
4409 // get pointer to first global index on column
4410 const int *col_indices = &*col_data.getIndices().data().begin();
4411
4412 auto &data = *commonDataSimpleContact;
4413 if (!data.forcesOnlyOnEntitiesRow.empty()) {
4414 rowIndices.resize(row_nb_dofs, false);
4415 noalias(rowIndices) = row_data.getIndices();
4416 row_indices = &rowIndices[0];
4417 VectorDofs &dofs = row_data.getFieldDofs();
4418 VectorDofs::iterator dit = dofs.begin();
4419 for (int ii = 0; dit != dofs.end(); ++dit, ++ii) {
4420 if (data.forcesOnlyOnEntitiesRow.find((*dit)->getEnt()) ==
4421 data.forcesOnlyOnEntitiesRow.end()) {
4422 rowIndices[ii] = -1;
4423 }
4424 }
4425 }
4426
4427 // assemble local matrix
4428 CHKERR MatSetValues(getSNESB(), row_nb_dofs, row_indices, col_nb_dofs,
4429 col_indices, &*matLhs.data().begin(), ADD_VALUES);
4430
4432}
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
#define CHKERR
Inline error check.
Definition: definitions.h:535
MoFEMErrorCode MatSetValues(Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const double *ptr, InsertMode iora)
Assemble PETSc matrix.
ublas::vector< FEDofEntity *, DofsAllocator > VectorDofs
const VectorDofs & getFieldDofs() const
get dofs data stature FEDofEntity
const VectorInt & getIndices() const
Get global indices of dofs on entity.

◆ doWork()

MoFEMErrorCode SimpleContactProblem::OpContactMaterialVolOnSideLhs::doWork ( int  row_side,
int  col_side,
EntityType  row_type,
EntityType  col_type,
EntitiesFieldData::EntData row_data,
EntitiesFieldData::EntData col_data 
)

Definition at line 4356 of file SimpleContact.cpp.

4358 {
4359
4361 if (row_type != MBVERTEX)
4363 row_nb_dofs = row_data.getIndices().size();
4364 if (!row_nb_dofs)
4366 col_nb_dofs = col_data.getIndices().size();
4367 if (!col_nb_dofs)
4369 nb_gauss_pts = row_data.getN().size1();
4370
4371 nb_base_fun_row = row_data.getFieldData().size() / 3;
4372 nb_base_fun_col = col_data.getFieldData().size() / 3;
4373
4374 matLhs.resize(3 * nb_base_fun_row, 3 * nb_base_fun_col, false);
4375 matLhs.clear();
4376
4377 normalVector->resize(3, false);
4378 tangentOne->resize(3, false);
4379 tangentTwo->resize(3, false);
4380
4381 if (isMaster) {
4382 normalVector = commonDataSimpleContact->normalVectorMasterPtr;
4383 tangentOne = commonDataSimpleContact->tangentOneVectorMasterPtr;
4384 tangentTwo = commonDataSimpleContact->tangentOneVectorMasterPtr;
4385 aRea = commonDataSimpleContact->areaMaster;
4386 } else {
4387 normalVector = commonDataSimpleContact->normalVectorSlavePtr;
4388 tangentOne = commonDataSimpleContact->tangentOneVectorSlavePtr;
4389 tangentTwo = commonDataSimpleContact->tangentOneVectorSlavePtr;
4390 aRea = commonDataSimpleContact->areaSlave;
4391 }
4392
4393 // integrate local matrix for entity block
4394 CHKERR iNtegrate(row_data, col_data);
4395
4396 // assemble local matrix
4397 CHKERR aSsemble(row_data, col_data);
4398
4400}
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
const VectorDouble & getFieldData() const
get dofs values
MoFEMErrorCode aSsemble(EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
virtual MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)

◆ iNtegrate()

virtual MoFEMErrorCode SimpleContactProblem::OpContactMaterialVolOnSideLhs::iNtegrate ( EntitiesFieldData::EntData &  row_data,
EntitiesFieldData::EntData &  col_data 
)
inlinevirtual

Reimplemented in SimpleContactProblem::OpContactMaterialVolOnSideLhs_dX_dX.

Definition at line 623 of file SimpleContact.hpp.

624 {
627 }

Member Data Documentation

◆ aRea

double SimpleContactProblem::OpContactMaterialVolOnSideLhs::aRea

Definition at line 616 of file SimpleContact.hpp.

◆ col_nb_dofs

int SimpleContactProblem::OpContactMaterialVolOnSideLhs::col_nb_dofs

Definition at line 606 of file SimpleContact.hpp.

◆ colIndices

VectorInt SimpleContactProblem::OpContactMaterialVolOnSideLhs::colIndices

Definition at line 603 of file SimpleContact.hpp.

◆ commonDataSimpleContact

boost::shared_ptr<CommonDataSimpleContact> SimpleContactProblem::OpContactMaterialVolOnSideLhs::commonDataSimpleContact

Definition at line 600 of file SimpleContact.hpp.

◆ isMaster

bool SimpleContactProblem::OpContactMaterialVolOnSideLhs::isMaster
private

Definition at line 659 of file SimpleContact.hpp.

◆ matLhs

MatrixDouble SimpleContactProblem::OpContactMaterialVolOnSideLhs::matLhs

Definition at line 598 of file SimpleContact.hpp.

◆ nb_base_fun_col

int SimpleContactProblem::OpContactMaterialVolOnSideLhs::nb_base_fun_col

Definition at line 610 of file SimpleContact.hpp.

◆ nb_base_fun_row

int SimpleContactProblem::OpContactMaterialVolOnSideLhs::nb_base_fun_row

Definition at line 609 of file SimpleContact.hpp.

◆ nb_gauss_pts

int SimpleContactProblem::OpContactMaterialVolOnSideLhs::nb_gauss_pts

Definition at line 607 of file SimpleContact.hpp.

◆ normalVector

boost::shared_ptr<VectorDouble> SimpleContactProblem::OpContactMaterialVolOnSideLhs::normalVector

Definition at line 615 of file SimpleContact.hpp.

◆ row_nb_dofs

int SimpleContactProblem::OpContactMaterialVolOnSideLhs::row_nb_dofs

Definition at line 605 of file SimpleContact.hpp.

◆ rowIndices

VectorInt SimpleContactProblem::OpContactMaterialVolOnSideLhs::rowIndices

Definition at line 602 of file SimpleContact.hpp.

◆ tangentOne

boost::shared_ptr<VectorDouble> SimpleContactProblem::OpContactMaterialVolOnSideLhs::tangentOne

Definition at line 612 of file SimpleContact.hpp.

◆ tangentTwo

boost::shared_ptr<VectorDouble> SimpleContactProblem::OpContactMaterialVolOnSideLhs::tangentTwo

Definition at line 613 of file SimpleContact.hpp.


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