16 #include "libmesh/parallel_algebra.h" 17 #include "libmesh/parallel.h" 23 params.
addParam<std::vector<BoundaryName>>(
24 "initiate_on_boundary",
25 "Cracks can only initiate on elements adjacent to specified boundaries.");
28 "Cracks will only nucleate if they are outside the nucleation_radius of an " 32 "execution_order_group",
33 "Nucleation UO needs to be completely executed before GeometricCutUserObject.");
34 params.
set<
int>(
"execution_order_group") = -1;
45 _mesh(_subproblem.
mesh()),
46 _nucleation_radius(getParam<
Real>(
"nucleation_radius"))
49 if (fe_problem == NULL)
50 paramError(
"Problem casting _subproblem to FEProblemBase in MeshCut2DNucleationBase");
51 _xfem = MooseSharedNamespace::dynamic_pointer_cast<
XFEM>(fe_problem->
getXFEM());
53 paramError(
"Problem casting to XFEM in MeshCut2DNucleationBase");
57 std::vector<BoundaryName> initiation_boundary_names =
58 getParam<std::vector<BoundaryName>>(
"initiate_on_boundary");
72 std::pair<RealVectorValue, RealVectorValue> cutterElemNodes;
78 std::map<unsigned int, std::pair<RealVectorValue, RealVectorValue>>::iterator mit;
81 bool cut_element =
false;
91 bool isOnBoundary =
false;
99 cut_element = (!is_cut && isOnBoundary &&
doesElementCrack(cutterElemNodes));
105 mooseError(
"ERROR: element ", current_eid,
" already marked for crack nucleation.");
115 for (std::map<
unsigned int, std::pair<RealVectorValue, RealVectorValue>>::const_iterator mit =
116 xmuo._nucleated_elems.begin();
117 mit != xmuo._nucleated_elems.end();
virtual void threadJoin(const UserObject &y) override
MeshCut2DNucleationBase(const InputParameters ¶meters)
virtual bool doesElementCrack(std::pair< RealVectorValue, RealVectorValue > &cutterElemNodes)=0
Determine whether the current element should be cut by a new crack.
static InputParameters validParams()
MooseMesh & _mesh
The FE solution mesh.
void addAvailableFlags(const ExecFlagType &flag, Args... flags)
const std::vector< double > y
const Parallel::Communicator & _communicator
std::shared_ptr< XFEM > _xfem
shared pointer to XFEM
bool isParamValid(const std::string &name) const
virtual void initialize() override
void paramError(const std::string ¶m, Args... args) const
std::map< unsigned int, std::pair< RealVectorValue, RealVectorValue > > _nucleated_elems
const ExecFlagType EXEC_XFEM_MARK
Exec flag used to execute MooseObjects while elements are being marked for cutting by XFEM...
virtual void finalize() override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Elem *const & _current_elem
std::shared_ptr< XFEMInterface > getXFEM()
virtual void execute() override
void mooseError(Args &&... args) const
std::vector< BoundaryID > getBoundaryIDs(const Elem *const elem, const unsigned short int side) const
static InputParameters validParams()
bool isBoundaryElem(dof_id_type elem_id) const
processor_id_type processor_id() const
std::vector< BoundaryID > _initiation_boundary_ids
void set_union(T &data, const unsigned int root_id) const