17 params.
addRequiredParam<MeshFileName>(
"mesh_file",
"Mesh file for the XFEM geometric cut.");
18 params.
addParam<UserObjectName>(
"interface_velocity_uo",
19 "The name of userobject that computes the velocity.");
20 params.
addParam<FunctionName>(
"interface_velocity_function",
21 "The name of function that provides interface velocity.");
22 params.
addParam<
bool>(
"output_exodus",
true,
"Whether to output exodus file of cutter mesh.");
24 "negative_id", 0,
"The CutSubdomainID corresponding to a non-positive signed distance");
26 "positive_id", 1,
"The CutSubdomainID corresponding to a positive signed distance");
32 _interface_velocity(nullptr),
34 _mesh(_subproblem.
mesh()),
36 _explicit_system(nullptr),
37 _equation_systems(nullptr),
38 _output_exodus(getParam<bool>(
"output_exodus")),
42 MeshFileName xfem_cutter_mesh_file = getParam<MeshFileName>(
"mesh_file");
45 _exodus_io = std::make_unique<ExodusII_IO>(*_cutter_mesh);
49 paramError(
"Either `interface_velocity_uo` or `interface_velocity_function` must be provided.");
53 "'interface_velocity_uo` and `interface_velocity_function` cannot be both provided.");
67 if (dynamic_cast<const XFEMMovingInterfaceVelocityBase *>(uo) ==
nullptr)
68 mooseError(
"UserObject casting to XFEMMovingInterfaceVelocityBase in " 69 "MovingLineSegmentCutSetUserObject");
78 for (
const auto & elem :
_cutter_mesh->element_ptr_range())
79 for (
unsigned int n = 0; n < elem->n_nodes(); n++)
110 std::vector<Point> new_position(
_cutter_mesh->n_nodes());
113 _pl->enable_out_of_mesh_mode();
115 std::map<unsigned int, Real> node_velocity;
119 for (
const auto & node :
_cutter_mesh->node_ptr_range())
121 if ((*
_pl)(*node) !=
nullptr)
124 if (
_func ==
nullptr)
134 node_velocity[node->id()] =
velocity;
141 mooseError(
"No node of the cutter mesh is found inside the computational domain.");
143 Real average_velocity = sum / count;
145 for (
const auto & node :
_cutter_mesh->node_ptr_range())
147 if ((*
_pl)(*node) ==
nullptr)
148 node_velocity[node->id()] = average_velocity;
151 for (
const auto & node :
_cutter_mesh->node_ptr_range())
154 p +=
_dt *
nodeNormal(node->id()) * node_velocity[node->id()];
155 new_position[node->id()] = p;
157 for (
const auto & node :
_cutter_mesh->node_ptr_range())
158 _cutter_mesh->node_ref(node->id()) = new_position[node->id()];
162 std::vector<dof_id_type> di;
163 for (
const auto & node :
_cutter_mesh->node_ptr_range())
191 const std::vector<Point>
194 mooseError(
"getCrackFrontPoints() is not implemented for this object.");
197 const std::vector<RealVectorValue>
200 mooseError(
"getCrackPlaneNormals() is not implemented for this object.");
std::unique_ptr< ExodusII_IO > _exodus_io
Exodus for outputing points and values.
static InputParameters validParams()
Factory constructor, takes parameters so that all derived classes can be built using the same constru...
virtual void calculateNormals()=0
calculate the element normal values for all of the elements.
InterfaceMeshCutUserObjectBase(const InputParameters ¶meters)
const Function & getFunction(const std::string &name) const
std::string getOutputFileBase(bool for_non_moose_build_output=false) const
const XFEMMovingInterfaceVelocityBase * _interface_velocity
Pointer to XFEMMovingInterfaceVelocityBase object.
std::unordered_map< dof_id_type, Point > _initial_nodes_location
initial nodes location
virtual void initialize() override
const CutSubdomainID _negative_id
The CutSubdomainID for the negative side of the cut.
const Parallel::Communicator & _communicator
virtual const std::string & name() const
unsigned int CutSubdomainID
virtual void initialSetup() override
virtual Real computeMovingInterfaceVelocity(dof_id_type node_id, RealVectorValue normal) const =0
Compute the interface velocity for a node.
const Function * _func
Velocity function.
virtual Point nodeNormal(const unsigned int &node_id)=0
return the normal at a node in the cutting mesh
virtual unsigned int dimension() const
unsigned int _var_num_disp_x
Local variable number for displacement x.
virtual const std::vector< RealVectorValue > getCrackPlaneNormals(unsigned int num_crack_front_points) const override
get a set of normal vectors along a crack front from a XFEM GeometricCutUserObject ...
static InputParameters validParams()
unsigned int _var_num_disp_y
Local variable number for displacement y.
virtual Real calculateSignedDistance(Point p) const =0
Calculate the signed distance for a given point relative to the surface.
void paramError(const std::string ¶m, Args... args) const
MooseMesh & _mesh
The computation domain mesh.
std::shared_ptr< MeshBase > _cutter_mesh
The cutter mesh.
unsigned int _var_num_disp_z
Local variable number for displacement z.
const bool _output_exodus
Output exodus file.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::unique_ptr< EquationSystems > _equation_systems
Local equation system for exodus output.
FEProblemBase & _fe_problem
void mooseError(Args &&... args) const
const InputParameters & parameters() const
static const std::string velocity
ExplicitSystem * _explicit_system
Local explicit system for exodus output.
virtual const std::vector< Point > getCrackFrontPoints(unsigned int num_crack_front_points) const override
get a set of points along a crack front from a XFEM GeometricCutUserObject
virtual std::unique_ptr< libMesh::PointLocatorBase > getPointLocator() const
const UserObject & getUserObjectBase(const std::string &name, const THREAD_ID tid=0) const
virtual Real value(Real t, const Point &p) const
virtual CutSubdomainID getCutSubdomainID(const Node *node) const override
std::unordered_map< dof_id_type, std::vector< dof_id_type > > _node_to_elem_map
node to element map of cut mesh
std::unique_ptr< PointLocatorBase > _pl
Pointer to PointLocatorBase object.
const CutSubdomainID _positive_id
The CutSubdomainID for the positive side of the cut.