#include <XFEMMaterialTensorMarkerUserObject.h>
|
virtual bool | doesElementCrack (RealVectorValue &direction) |
| Determine whether the current element should be cut by a new crack. More...
|
|
◆ XFEMMaterialTensorMarkerUserObject()
XFEMMaterialTensorMarkerUserObject::XFEMMaterialTensorMarkerUserObject |
( |
const InputParameters & |
parameters | ) |
|
Definition at line 31 of file XFEMMaterialTensorMarkerUserObject.C.
35 _tensor(getMaterialProperty<SymmTensor>(getParam<std::string>(
"tensor"))),
40 setRandomResetFrequency(EXEC_INITIAL);
XFEMMaterialStateMarkerBase(const InputParameters ¶meters)
Factory constructor, takes parameters so that all derived classes can be built using the same constru...
const MaterialProperty< SymmTensor > & _tensor
MaterialTensorCalculator _material_tensor_calculator
◆ ~XFEMMaterialTensorMarkerUserObject()
virtual XFEMMaterialTensorMarkerUserObject::~XFEMMaterialTensorMarkerUserObject |
( |
| ) |
|
|
inlinevirtual |
◆ doesElementCrack()
bool XFEMMaterialTensorMarkerUserObject::doesElementCrack |
( |
RealVectorValue & |
direction | ) |
|
|
protectedvirtual |
Determine whether the current element should be cut by a new crack.
- Parameters
-
direction | Normal direction of crack if it is cracked |
- Returns
- bool true if element cracks
Reimplemented from XFEMMaterialStateMarkerBase.
Definition at line 44 of file XFEMMaterialTensorMarkerUserObject.C.
46 bool does_it_crack =
false;
47 unsigned int numqp = _qrule->n_points();
54 for (
unsigned int qp = 0; qp < numqp; ++qp)
58 average_tensor *= 1.0 / (Real)numqp;
59 Real tensor_quantity =
66 unsigned int max_index = 999999;
67 std::vector<Real> tensor_quantities;
68 tensor_quantities.reserve(numqp);
69 Real max_quantity = 0;
70 std::vector<RealVectorValue> directions;
71 directions.resize(numqp);
72 for (
unsigned int qp = 0; qp < numqp; ++qp)
74 tensor_quantities[qp] =
76 if (directions[qp](0) == 0 && directions[qp](1) == 0 && directions[qp](2) == 0)
78 mooseError(
"Direction has zero length in XFEMMaterialTensorMarkerUserObject");
80 if (tensor_quantities[qp] > max_quantity)
82 max_quantity = tensor_quantities[qp];
89 direction = directions[max_index];
Real getTensorQuantity(const SymmTensor &tensor, const Point &curr_point, RealVectorValue &direction)
const MaterialProperty< SymmTensor > & _tensor
MaterialTensorCalculator _material_tensor_calculator
◆ execute()
void XFEMMaterialStateMarkerBase::execute |
( |
| ) |
|
|
overridevirtualinherited |
Definition at line 62 of file XFEMMaterialStateMarkerBase.C.
64 RealVectorValue direction;
65 bool isCut =
_xfem->isElemCut(_current_elem);
66 bool isCTE =
_xfem->isElemAtCrackTip(_current_elem);
67 bool isOnBoundary =
false;
68 unsigned int boundarySide = 99999;
69 unsigned int _current_eid = _current_elem->id();
70 std::map<unsigned int, RealVectorValue>::iterator mit;
86 mooseError(
"ERROR: element ", _current_eid,
" already marked for crack growth.");
94 mooseError(
"ERROR: element ", _current_eid,
" already marked for crack growth.");
103 mooseError(
"ERROR: element ", _current_eid,
" already marked for crack growth.");
std::map< unsigned int, unsigned int > _marked_elem_sides
std::vector< BoundaryID > _initiation_boundary_ids
std::set< unsigned int > _marked_frags
std::shared_ptr< XFEM > _xfem
std::map< unsigned int, RealVectorValue > _marked_elems
virtual bool doesElementCrack(RealVectorValue &direction)
Determine whether the current element should be cut by a new crack.
◆ finalize()
void XFEMMaterialStateMarkerBase::finalize |
( |
| ) |
|
|
overridevirtualinherited |
Definition at line 138 of file XFEMMaterialStateMarkerBase.C.
144 _xfem->clearStateMarkedElems();
145 std::map<unsigned int, RealVectorValue>::iterator mit;
154 _xfem->addStateMarkedFrag(mit->first, mit->second);
158 _xfem->addStateMarkedElem(mit->first, mit->second);
std::map< unsigned int, unsigned int > _marked_elem_sides
std::set< unsigned int > _marked_frags
std::shared_ptr< XFEM > _xfem
std::map< unsigned int, RealVectorValue > _marked_elems
◆ initialize()
void XFEMMaterialStateMarkerBase::initialize |
( |
| ) |
|
|
overridevirtualinherited |
Definition at line 53 of file XFEMMaterialStateMarkerBase.C.
std::map< unsigned int, unsigned int > _marked_elem_sides
std::set< unsigned int > _marked_frags
std::map< unsigned int, RealVectorValue > _marked_elems
◆ threadJoin()
void XFEMMaterialStateMarkerBase::threadJoin |
( |
const UserObject & |
y | ) |
|
|
overridevirtualinherited |
Definition at line 111 of file XFEMMaterialStateMarkerBase.C.
115 for (std::map<unsigned int, RealVectorValue>::const_iterator mit = xmuo.
_marked_elems.begin();
122 for (std::set<unsigned int>::const_iterator mit = xmuo.
_marked_frags.begin();
129 for (std::map<unsigned int, unsigned int>::const_iterator mit = xmuo.
_marked_elem_sides.begin();
std::map< unsigned int, unsigned int > _marked_elem_sides
std::set< unsigned int > _marked_frags
std::map< unsigned int, RealVectorValue > _marked_elems
◆ _average
bool XFEMMaterialTensorMarkerUserObject::_average |
|
protected |
◆ _material_tensor_calculator
◆ _random_range
Real XFEMMaterialTensorMarkerUserObject::_random_range |
|
protected |
◆ _tensor
const MaterialProperty<SymmTensor>& XFEMMaterialTensorMarkerUserObject::_tensor |
|
protected |
◆ _threshold
Real XFEMMaterialTensorMarkerUserObject::_threshold |
|
protected |
The documentation for this class was generated from the following files: