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 317 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 318 of file EshelbianOperators.hpp.

321 : FaceUserDataOperator(NOSPACE, OPSPACE), dataAtPts(data_ptr),
322 blockName(block_name), blockEntities(block_entities),
323 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 913 of file EshelbianOperators.cpp.

914 {
916 if (blockEntities.find(getFEEntityHandle()) == blockEntities.end()) {
918 };
922 int nb_integration_pts = getGaussPts().size2();
923 auto t_w = getFTensor0IntegrationWeight();
924 auto t_traction = getFTensor1FromMat<SPACE_DIM>(dataAtPts->tractionAtPts);
925 auto t_coords = getFTensor1CoordsAtGaussPts();
926 auto t_spatial_disp = getFTensor1FromMat<SPACE_DIM>(dataAtPts->wL2AtPts);
927
928 FTensor::Tensor1<double, 3> t_coords_spatial{0., 0., 0.};
929 // Offset for center of mass. Can be added in the future.
930 FTensor::Tensor1<double, 3> t_off{0.0, 0.0, 0.0};
931 FTensor::Tensor1<double, 3> loc_reaction_forces{0., 0., 0.};
932 FTensor::Tensor1<double, 3> loc_moment_forces{0., 0., 0.};
933
934 for (auto gg = 0; gg != nb_integration_pts; ++gg) {
935 loc_reaction_forces(i) += (t_traction(i)) * t_w * getMeasure();
936 t_coords_spatial(i) = t_coords(i) + t_spatial_disp(i);
937 // t_coords_spatial(i) -= t_off(i);
938 loc_moment_forces(i) +=
939 (FTensor::levi_civita<double>(i, j, k) * t_coords_spatial(j)) *
940 t_traction(k) * t_w * getMeasure();
941 ++t_coords;
942 ++t_spatial_disp;
943 ++t_w;
944 ++t_traction;
945 }
946
947 reactionVec[0] += loc_reaction_forces(0);
948 reactionVec[1] += loc_reaction_forces(1);
949 reactionVec[2] += loc_reaction_forces(2);
950 reactionVec[3] += loc_moment_forces(0);
951 reactionVec[4] += loc_moment_forces(1);
952 reactionVec[5] += loc_moment_forces(2);
953
955}
#define FTENSOR_INDEX(DIM, I)
constexpr int SPACE_DIM
#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 329 of file EshelbianOperators.hpp.

◆ blockName

std::string OpCalculateReactionForces::blockName
private

Definition at line 330 of file EshelbianOperators.hpp.

◆ dataAtPts

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

data at integration pts

Definition at line 328 of file EshelbianOperators.hpp.

◆ reactionVec

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

Definition at line 331 of file EshelbianOperators.hpp.


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