20 "geometric_cut_userobjects",
"Vector of geometric cut userobjects to combine");
22 "cut_subdomain_combinations",
23 "Possible combinations of the cut subdomain IDs. The sequence of each combination should " 24 "follow the sequence provided in the geometric_cut_userobjects parameter. Use semicolons to " 25 "separate different combinations.");
27 "cut_subdomains",
"Resulting combined cut subdomain IDs for each of the combination.");
34 _cut_names(getParam<
std::vector<UserObjectName>>(
"geometric_cut_userobjects")),
35 _num_cuts(_cut_names.size()),
40 for (
unsigned int i = 0; i <
_num_cuts; i++)
49 for (
const auto & combo :
_keys)
53 unsigned int num_combos =
_keys.size();
55 if (
_vals.size() != num_combos)
56 mooseError(
"Expected one value for each of the combination, got ",
58 " combinations, but got ",
62 for (
unsigned int i = 0; i < num_combos; i++)
68 std::vector<Xfem::CutEdge> & cut_edges,
69 std::vector<Xfem::CutNode> & cut_nodes)
const 71 unsigned int i_want_to_cut = 0;
72 for (
auto cut :
_cuts)
73 if (cut->cutElementByGeometry(elem, cut_edges, cut_nodes))
78 if (i_want_to_cut > 1)
79 mooseError(
"More than one GeometricCutUserObject want to cut the same element.");
81 return i_want_to_cut > 0;
86 std::vector<Xfem::CutFace> & cut_faces)
const 88 unsigned int i_want_to_cut = 0;
89 for (
auto cut :
_cuts)
90 if (cut->cutElementByGeometry(elem, cut_faces))
95 if (i_want_to_cut > 1)
96 mooseError(
"More than one GeometricCutUserObject want to cut the same element.");
98 return i_want_to_cut > 0;
103 std::vector<Xfem::CutEdge> & cut_edges)
const 105 unsigned int i_want_to_cut = 0;
106 for (
auto cut :
_cuts)
107 if (cut->cutFragmentByGeometry(frag_edges, cut_edges))
112 if (i_want_to_cut > 1)
113 mooseError(
"More than one GeometricCutUserObject want to cut the same fragment.");
115 return i_want_to_cut > 0;
120 std::vector<Xfem::CutFace> & cut_faces)
const 122 unsigned int i_want_to_cut = 0;
123 for (
auto cut :
_cuts)
124 if (cut->cutFragmentByGeometry(frag_faces, cut_faces))
129 if (i_want_to_cut > 1)
130 mooseError(
"More than one GeometricCutUserObject want to cut the same fragment.");
132 return i_want_to_cut > 0;
138 std::vector<CutSubdomainID> combo_key;
139 for (
auto cut :
_cuts)
140 combo_key.push_back(cut->getCutSubdomainID(node));
147 catch (std::out_of_range &)
static InputParameters validParams()
Factory constructor, takes parameters so that all derived classes can be built using the same constru...
const std::vector< std::vector< CutSubdomainID > > _keys
Keys read from the input file, to be parsed by buildMap()
std::vector< const GeometricCutUserObject * > _cuts
Vector of points to the GeometricCutUserObjects to be combined.
unsigned int _num_cuts
Number of geometric cuts to be combined.
static InputParameters validParams()
virtual const std::string & name() const
registerMooseObject("XFEMApp", ComboCutUserObject)
unsigned int CutSubdomainID
virtual bool cutElementByGeometry(const Elem *elem, std::vector< Xfem::CutEdge > &cut_edges, std::vector< Xfem::CutNode > &cut_nodes) const override
Loop over all the provided GeometricCutUserObjects, fill the data structures based on each cut that w...
virtual CutSubdomainID getCutSubdomainID(const Node *node) const override
ComboCutUserObject(const InputParameters ¶meters)
const std::vector< UserObjectName > _cut_names
Vector of names of GeometricCutUserObjects to be combined.
virtual bool cutFragmentByGeometry(std::vector< std::vector< Point >> &frag_edges, std::vector< Xfem::CutEdge > &cut_edges) const override
Loop over all the provided GeometricCutUserObjects, fill the data structures based on each cut that w...
void buildMap()
Helper function to build the dictionary for composite CutSubdomainID look-up.
void mooseError(Args &&... args) const
const std::vector< CutSubdomainID > _vals
Values read from the input file, to be parsed by buildMap()
std::map< std::vector< CutSubdomainID >, CutSubdomainID > _combo_ids
The dictionary for composite CutSubdomainID look-up.