15 #include "libmesh/parallel_algebra.h" 16 #include "libmesh/parallel.h" 22 params.
addParam<std::vector<BoundaryName>>(
23 "initiate_on_boundary",
24 "Permit cracks to initiate in elements adjacent to specified boundaries");
25 params.
addParam<
bool>(
"secondary_cracks",
false,
"should secondary cracks be allowed");
31 _mesh(_subproblem.
mesh()),
32 _secondary_cracks(getParam<bool>(
"secondary_cracks"))
35 if (fe_problem ==
nullptr)
36 mooseError(
"Problem casting _subproblem to FEProblemBase in XFEMMaterialStateMarkerBase");
37 _xfem = MooseSharedNamespace::dynamic_pointer_cast<
XFEM>(fe_problem->
getXFEM());
39 mooseError(
"Problem casting to XFEM in XFEMMaterialStateMarkerBase");
41 mooseError(
"XFEMMaterialStateMarkerBase can only be run on an element variable");
45 std::vector<BoundaryName> initiation_boundary_names =
46 getParam<std::vector<BoundaryName>>(
"initiate_on_boundary");
66 bool isOnBoundary =
false;
67 unsigned int boundarySide = 99999;
69 std::map<unsigned int, RealVectorValue>::iterator mit;
85 mooseError(
"ERROR: element ", _current_eid,
" already marked for crack growth.");
93 mooseError(
"ERROR: element ", _current_eid,
" already marked for crack growth.");
102 mooseError(
"ERROR: element ", _current_eid,
" already marked for crack growth.");
114 for (std::map<unsigned int, RealVectorValue>::const_iterator mit = xmuo._marked_elems.begin();
115 mit != xmuo._marked_elems.end();
121 for (std::set<unsigned int>::const_iterator mit = xmuo._marked_frags.begin();
122 mit != xmuo._marked_frags.end();
128 for (std::map<unsigned int, unsigned int>::const_iterator mit = xmuo._marked_elem_sides.begin();
129 mit != xmuo._marked_elem_sides.end();
143 _xfem->clearStateMarkedElems();
144 std::map<unsigned int, RealVectorValue>::iterator mit;
153 _xfem->addStateMarkedFrag(mit->first, mit->second);
157 _xfem->addStateMarkedElem(mit->first, mit->second);
virtual void finalize() override
static InputParameters validParams()
Factory constructor, takes parameters so that all derived classes can be built using the same constru...
static InputParameters validParams()
const std::vector< double > y
const Parallel::Communicator & _communicator
XFEMMaterialStateMarkerBase(const InputParameters ¶meters)
bool isParamValid(const std::string &name) const
virtual void execute() override
std::map< unsigned int, unsigned int > _marked_elem_sides
std::vector< BoundaryID > _initiation_boundary_ids
unsigned int sideWithBoundaryID(const Elem *const elem, const BoundaryID boundary_id) const
virtual void threadJoin(const UserObject &y) override
std::set< unsigned int > _marked_frags
const Elem *const & _current_elem
std::shared_ptr< XFEM > _xfem
std::shared_ptr< XFEMInterface > getXFEM()
void mooseError(Args &&... args) const
std::map< unsigned int, RealVectorValue > _marked_elems
virtual bool doesElementCrack(RealVectorValue &direction)
Determine whether the current element should be cut by a new crack.
std::vector< BoundaryID > getBoundaryIDs(const Elem *const elem, const unsigned short int side) const
virtual void initialize() override
bool isBoundaryElem(dof_id_type elem_id) const
void set_union(T &data, const unsigned int root_id) const