v0.15.0
Loading...
Searching...
No Matches
ADOLCPlasticity::OpCalculateStressImpl< DIM, STRAIN > Struct Template Reference
Inheritance diagram for ADOLCPlasticity::OpCalculateStressImpl< DIM, STRAIN >:
[legend]
Collaboration diagram for ADOLCPlasticity::OpCalculateStressImpl< DIM, STRAIN >:
[legend]

Public Member Functions

 OpCalculateStressImpl (MoFEM::Interface &m_field, boost::shared_ptr< CommonData > common_data_ptr, boost::shared_ptr< ClosestPointProjection > cp_ptr, bool calc_lhs)
 

Protected Member Functions

MoFEMErrorCode getTags ()
 
MoFEMErrorCode setTagsData (const EntityHandle tet, const int nb_gauss_pts, const int nb_internal_variables)
 

Protected Attributes

MoFEM::InterfacemField
 
boost::shared_ptr< CommonDatacommonDataPtr
 
boost::shared_ptr< ClosestPointProjectioncpPtr
 
bool calcLhs
 
Tag thPlasticStrain
 
Tag thInternalVariables
 

Detailed Description

template<int DIM, StrainType STRAIN>
struct ADOLCPlasticity::OpCalculateStressImpl< DIM, STRAIN >

Definition at line 252 of file ADOLCPlasticity.cpp.

Constructor & Destructor Documentation

◆ OpCalculateStressImpl()

template<int DIM, StrainType STRAIN>
ADOLCPlasticity::OpCalculateStressImpl< DIM, STRAIN >::OpCalculateStressImpl ( MoFEM::Interface & m_field,
boost::shared_ptr< CommonData > common_data_ptr,
boost::shared_ptr< ClosestPointProjection > cp_ptr,
bool calc_lhs )

Definition at line 301 of file ADOLCPlasticity.cpp.

304 : ForcesAndSourcesCore::UserDataOperator::UserDataOperator(
305 NOSPACE, UserDataOperator::OPSPACE),
306 mField(m_field), commonDataPtr(common_data_ptr), cpPtr(cp_ptr),
307 calcLhs(calc_lhs) {
308 CHK_THROW_MESSAGE(getTags(), "get tags");
309}
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
@ NOSPACE
Definition definitions.h:83
boost::shared_ptr< CommonData > commonDataPtr
boost::shared_ptr< ClosestPointProjection > cpPtr

Member Function Documentation

◆ getTags()

template<int DIM, StrainType STRAIN>
MoFEMErrorCode ADOLCPlasticity::OpCalculateStressImpl< DIM, STRAIN >::getTags ( )
protected

Definition at line 312 of file ADOLCPlasticity.cpp.

312 {
314 int def_length = 0;
315 CHKERR mField.get_moab().tag_get_handle(
316 "PLASTIC_STRAIN", def_length, MB_TYPE_DOUBLE, thPlasticStrain,
317 MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_VARLEN, NULL);
318 CHKERR mField.get_moab().tag_get_handle(
319 "INTERNAL_VARIABLES", def_length, MB_TYPE_DOUBLE, thInternalVariables,
320 MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_VARLEN, NULL);
322}
#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()
#define CHKERR
Inline error check.
virtual moab::Interface & get_moab()=0

◆ setTagsData()

template<int DIM, StrainType STRAIN>
MoFEMErrorCode ADOLCPlasticity::OpCalculateStressImpl< DIM, STRAIN >::setTagsData ( const EntityHandle tet,
const int nb_gauss_pts,
const int nb_internal_variables )
protected

Definition at line 325 of file ADOLCPlasticity.cpp.

327 {
329
331 {
332 rval = mField.get_moab().tag_get_by_ptr(
333 thPlasticStrain, &tet, 1,
334 (const void **)&commonDataPtr->plasticStrainPtr,
335 &commonDataPtr->plasticStrainSize);
336 if (rval != MB_SUCCESS ||
337 commonDataPtr->plasticStrainSize != 6 * nb_gauss_pts) {
338 v.resize(6 * nb_gauss_pts, false);
339 v.clear();
340 int tag_size[1];
341 tag_size[0] = v.size();
342 void const *tag_data[] = {&v[0]};
343 CHKERR mField.get_moab().tag_set_by_ptr(thPlasticStrain, &tet, 1,
344 tag_data, tag_size);
345 CHKERR mField.get_moab().tag_get_by_ptr(
346 thPlasticStrain, &tet, 1,
347 (const void **)&commonDataPtr->plasticStrainPtr,
348 &commonDataPtr->plasticStrainSize);
349 }
350 }
351 if (nb_internal_variables > 0) {
352 rval = mField.get_moab().tag_get_by_ptr(
353 thInternalVariables, &tet, 1,
354 (const void **)&commonDataPtr->internalVariablesPtr,
355 &commonDataPtr->internalVariablesSize);
356 if (rval != MB_SUCCESS || commonDataPtr->internalVariablesSize !=
357 nb_internal_variables * nb_gauss_pts) {
358 v.resize(nb_internal_variables * nb_gauss_pts, false);
359 v.clear();
360 int tag_size[1];
361 tag_size[0] = v.size();
362 void const *tag_data[] = {&v[0]};
363 CHKERR mField.get_moab().tag_set_by_ptr(thInternalVariables, &tet, 1,
364 tag_data, tag_size);
365 CHKERR mField.get_moab().tag_get_by_ptr(
366 thInternalVariables, &tet, 1,
367 (const void **)&commonDataPtr->internalVariablesPtr,
368 &commonDataPtr->internalVariablesSize);
369 }
370 }
372}
const double v
phase velocity of light in medium (cm/ns)
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval

Member Data Documentation

◆ calcLhs

template<int DIM, StrainType STRAIN>
bool ADOLCPlasticity::OpCalculateStressImpl< DIM, STRAIN >::calcLhs
protected

Definition at line 263 of file ADOLCPlasticity.cpp.

◆ commonDataPtr

template<int DIM, StrainType STRAIN>
boost::shared_ptr<CommonData> ADOLCPlasticity::OpCalculateStressImpl< DIM, STRAIN >::commonDataPtr
protected

Definition at line 261 of file ADOLCPlasticity.cpp.

◆ cpPtr

template<int DIM, StrainType STRAIN>
boost::shared_ptr<ClosestPointProjection> ADOLCPlasticity::OpCalculateStressImpl< DIM, STRAIN >::cpPtr
protected

Definition at line 262 of file ADOLCPlasticity.cpp.

◆ mField

template<int DIM, StrainType STRAIN>
MoFEM::Interface& ADOLCPlasticity::OpCalculateStressImpl< DIM, STRAIN >::mField
protected

Definition at line 260 of file ADOLCPlasticity.cpp.

◆ thInternalVariables

template<int DIM, StrainType STRAIN>
Tag ADOLCPlasticity::OpCalculateStressImpl< DIM, STRAIN >::thInternalVariables
protected

Definition at line 266 of file ADOLCPlasticity.cpp.

◆ thPlasticStrain

template<int DIM, StrainType STRAIN>
Tag ADOLCPlasticity::OpCalculateStressImpl< DIM, STRAIN >::thPlasticStrain
protected

Definition at line 265 of file ADOLCPlasticity.cpp.


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