v0.15.0
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
OpCalculateReactionForces Struct Reference

#include "users_modules/eshelbian_plasticity/src/EshelbianOperators.hpp"

Inheritance diagram for OpCalculateReactionForces:
[legend]
Collaboration diagram for OpCalculateReactionForces:
[legend]

Public Member Functions

 OpCalculateReactionForces (boost::shared_ptr< DataAtIntegrationPts > data_ptr, std::string block_name, Range block_entities, std::array< double, 6 > &reaction_vec)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 

Private Attributes

boost::shared_ptr< DataAtIntegrationPtsdataAtPts
 data at integration pts
 
Range blockEntities
 
std::string blockName
 
std::array< double, 6 > & reactionVec
 

Detailed Description

Definition at line 313 of file EshelbianOperators.hpp.

Constructor & Destructor Documentation

◆ OpCalculateReactionForces()

OpCalculateReactionForces::OpCalculateReactionForces ( boost::shared_ptr< DataAtIntegrationPts data_ptr,
std::string  block_name,
Range  block_entities,
std::array< double, 6 > &  reaction_vec 
)
inline

Definition at line 314 of file EshelbianOperators.hpp.

317 : FaceUserDataOperator(NOSPACE, OPSPACE), dataAtPts(data_ptr),
318 blockName(block_name), blockEntities(block_entities),
319 reactionVec(reaction_vec) {}
@ NOSPACE
Definition definitions.h:83
FaceElementForcesAndSourcesCore::UserDataOperator FaceUserDataOperator
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts
std::array< double, 6 > & reactionVec

Member Function Documentation

◆ doWork()

MoFEMErrorCode OpCalculateReactionForces::doWork ( int  side,
EntityType  type,
EntData data 
)
Examples
mofem/users_modules/eshelbian_plasticity/src/impl/EshelbianOperators.cpp.

Definition at line 879 of file EshelbianOperators.cpp.

880 {
882 if (blockEntities.find(getFEEntityHandle()) == blockEntities.end()) {
884 };
888 int nb_integration_pts = getGaussPts().size2();
889 auto t_w = getFTensor0IntegrationWeight();
890 auto t_traction = getFTensor1FromMat<SPACE_DIM>(dataAtPts->tractionAtPts);
891 auto t_coords = getFTensor1CoordsAtGaussPts();
892 auto t_spatial_disp = getFTensor1FromMat<SPACE_DIM>(dataAtPts->wL2AtPts);
893
894 FTensor::Tensor1<double, 3> t_coords_spatial{0., 0., 0.};
895 // Offset for center of mass. Can be added in the future.
896 FTensor::Tensor1<double, 3> t_off{0.0, 0.0, 0.0};
897 FTensor::Tensor1<double, 3> loc_reaction_forces{0., 0., 0.};
898 FTensor::Tensor1<double, 3> loc_moment_forces{0., 0., 0.};
899
900 for (auto gg = 0; gg != nb_integration_pts; ++gg) {
901 loc_reaction_forces(i) += (t_traction(i)) * t_w * getMeasure();
902 t_coords_spatial(i) = t_coords(i) + t_spatial_disp(i);
903 // t_coords_spatial(i) -= t_off(i);
904 loc_moment_forces(i) +=
905 (FTensor::levi_civita<double>(i, j, k) * t_coords_spatial(j)) *
906 t_traction(k) * t_w * getMeasure();
907 ++t_coords;
908 ++t_spatial_disp;
909 ++t_w;
910 ++t_traction;
911 }
912
913 reactionVec[0] += loc_reaction_forces(0);
914 reactionVec[1] += loc_reaction_forces(1);
915 reactionVec[2] += loc_reaction_forces(2);
916 reactionVec[3] += loc_moment_forces(0);
917 reactionVec[4] += loc_moment_forces(1);
918 reactionVec[5] += loc_moment_forces(2);
919
921}
#define FTENSOR_INDEX(DIM, I)
constexpr int SPACE_DIM
[Define dimension]
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k

Member Data Documentation

◆ blockEntities

Range OpCalculateReactionForces::blockEntities
private

Definition at line 325 of file EshelbianOperators.hpp.

◆ blockName

std::string OpCalculateReactionForces::blockName
private

Definition at line 326 of file EshelbianOperators.hpp.

◆ dataAtPts

boost::shared_ptr<DataAtIntegrationPts> OpCalculateReactionForces::dataAtPts
private

data at integration pts

Definition at line 324 of file EshelbianOperators.hpp.

◆ reactionVec

std::array<double, 6>& OpCalculateReactionForces::reactionVec
private

Definition at line 327 of file EshelbianOperators.hpp.


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