14 #include "libmesh/parallel_algebra.h" 15 #include "libmesh/parallel.h" 24 "variable",
"The name of the variable that this UserObject operates on");
26 "interface_mesh_cut_userobject",
27 "Name of InterfaceMeshCutUserObject that provides cut locations to this UserObject.");
29 "level_set_var",
"The name of level set variable used to represent the interface");
36 _mesh(_subproblem.
mesh()),
37 _var(&_subproblem.getVariable(_tid, parameters.
get<VariableName>(
"variable"))),
38 _level_set_var_number(
39 _subproblem.getVariable(_tid, parameters.
get<VariableName>(
"level_set_var")).number()),
40 _system(_subproblem.getSystem(getParam<VariableName>(
"level_set_var"))),
41 _solution(*_system.current_local_solution.
get())
51 mooseError(
"Problem casting to XFEM in NodeValueAtXFEMInterface");
56 if (dynamic_cast<const InterfaceMeshCutUserObjectBase *>(uo) ==
nullptr)
57 mooseError(
"UserObject casting to InterfaceMeshCutUserObjectBase in NodeValueAtXFEMInterface");
74 for (
const auto & node : cutter_mesh->node_ptr_range())
77 _pl->enable_out_of_mesh_mode();
79 for (
const auto & node : cutter_mesh->node_ptr_range())
81 unsigned int i = node->id();
83 if ((*
_pl)(*node) !=
nullptr)
130 const Elem * elem1 = (*_pl)(p);
135 const Node * node = elem1->node_ptr(0);
141 bool positive =
false;
143 if (
_xfem->isPointInsidePhysicalDomain(elem1, *node))
145 if (ls_node_value > 0.0)
150 if (ls_node_value < 0.0)
154 const Elem * elem2 =
nullptr;
158 if (pair.first == elem1)
163 else if (pair.second == elem1)
171 mooseError(
"NodeValueAtXFEMInterface: The interface node ",
173 " are not found by element pair locator.");
175 if ((positive && positive_level_set) || (!positive && !positive_level_set))
177 else if ((!positive && positive_level_set) || (positive && !positive_level_set))
registerMooseObject("XFEMApp", NodeValueAtXFEMInterface)
std::map< unsigned int, Real > _values_positive_level_set_side
Mapping from point index and its values at the positive level set side.
static InputParameters validParams()
const NumericVector< Number > & _solution
The subproblem solution vector.
MooseMesh & _mesh
The computation mesh.
const unsigned int _level_set_var_number
The variable number of the level set variable we are operating on.
virtual void setCurrentSubdomainID(const Elem *elem, const THREAD_ID tid)=0
std::shared_ptr< MeshBase > getCutterMesh() const
Get the cutter mesh pointer.
const Parallel::Communicator & _communicator
std::unique_ptr< libMesh::PointLocatorBase > _pl
Pointer to PointLocatorBase object.
const Elem * getElemContainingPoint(const Node &p, bool positive_level_set)
Find the element in the element pairs that contains the point in its physical domain.
MooseVariableFEBase * _var
Pointer to MooseVariableFEBase object.
std::shared_ptr< XFEM > _xfem
Pointer to the XFEM controller object.
unsigned int number() const
std::map< unsigned int, Real > _values_negative_level_set_side
Mapping from point index and its values at the negative level set side.
const ElementPairLocator::ElementPairList * _elem_pairs
Pointer to ElementPairList object.
std::map< unsigned int, RealVectorValue > _grad_values_positive_level_set_side
Mapping from point index and its gradient at the positive level set side.
virtual void finalize() override
virtual void reinitElemPhys(const Elem *elem, const std::vector< Point > &phys_points_in_elem, const THREAD_ID tid)=0
const libMesh::System & _system
System reference.
static InputParameters validParams()
FEProblemBase & _fe_problem
std::shared_ptr< XFEMInterface > getXFEM()
void mooseError(Args &&... args) const
std::vector< Point > _nodes
The nodes to evaluate at.
virtual std::unique_ptr< libMesh::PointLocatorBase > getPointLocator() const
NodeValueAtXFEMInterface(const InputParameters ¶meters)
const UserObject & getUserObjectBase(const std::string &name, const THREAD_ID tid=0) const
const InterfaceMeshCutUserObjectBase * _mesh_cut
Pointer to LineSegmentCutSetUserObject object.
virtual void execute() override
virtual void initialize() override
processor_id_type processor_id() const
const Elem & get(const ElemType type_in)
std::map< unsigned int, RealVectorValue > _grad_values_negative_level_set_side
Mapping from point index and its gradient at the negative level set side.
void set_union(T &data, const unsigned int root_id) const