39 BoundaryInfo & boundary_info = the_mesh.get_boundary_info();
52 ": Inconsistent number of nodes and elements. You have ",
62 ": Inconsistent number of nodes and elements. You have ",
71 const Node * nd = the_mesh.node_ptr(node_id);
78 auto & binfo =
mesh().
getMesh().get_boundary_info();
79 for (
unsigned int i = 0; i <
_n_elem; i++)
81 Elem * elem =
nullptr;
92 boundary_info.add_side(elem, 0, bc_id_inlet);
93 binfo.sideset_name(bc_id_inlet) =
genName(
name(),
"in");
99 boundary_info.add_side(elem, 1, bc_id_outlet);
100 binfo.sideset_name(bc_id_outlet) =
genName(
name(),
"out");
113 for (
unsigned int j = 0; j <
_n_elems[i]; j++, k++)
116 mesh().
elemPtr(elem_id)->subdomain_id() = subdomain_id;
155const std::vector<Component1D::Connection> &
160 std::map<Component1DConnection::EEndType, std::vector<Connection>>::const_iterator it =
172 std::string dominant_direction =
"x";
173 const Real x_abs = std::abs(
_dir(0));
174 const Real y_abs = std::abs(
_dir(1));
175 const Real z_abs = std::abs(
_dir(2));
176 Real max_value = x_abs;
177 if (y_abs > max_value)
179 dominant_direction =
"y";
182 if (z_abs > max_value)
184 dominant_direction =
"z";
187 return dominant_direction;
boundary_id_type BoundaryID
std::map< Component1DConnection::EEndType, std::vector< Connection > > _connections
Map of end type to a list of connections.
virtual void buildMeshNodes()
Component1D(const InputParameters ¶meters)
virtual void buildMesh() override
virtual bool usingSecondOrderMesh() const override
Check if second order mesh is being used by this geometrical component.
unsigned int getNodesetID() const
Gets the 1D component nodeset ID.
BoundaryName _nodeset_name
Nodeset name for all 1D component nodes.
static InputParameters validParams()
std::string sortBy() const
virtual const std::vector< Connection > & getConnections(Component1DConnection::EEndType end_type) const
Gets the vector of connections of an end type for this component.
BoundaryID _nodeset_id
Nodeset ID for all 1D component nodes.
const BoundaryName & getNodesetName() const
Gets the 1D component nodeset name.
std::vector< dof_id_type > _elem_ids
Element IDs of this component.
Node * addNode(const Point &pt)
virtual void setSubdomainInfo(SubdomainID subdomain_id, const std::string &subdomain_name, const Moose::CoordinateSystemType &coord_system=Moose::COORD_XYZ)
Sets the next subdomain ID, name, and coordinate system.
@ MESH_PREPARED
mesh set up
std::vector< dof_id_type > _node_ids
Node IDs of this component.
void checkSetupStatus(const EComponentSetupStatus &status) const
Throws an error if the supplied setup status of this component has not been reached.
THMMesh & mesh()
Non-const reference to THM mesh, which can only be called before the end of mesh setup.
Real _length
Total axial length.
unsigned int _n_elem
Total number of axial elements.
std::vector< unsigned int > _n_elems
Number of elements in each axial section.
const Point & _position
Start position of axis in 3-D space.
const RealVectorValue _dir
Normalized direction of axis from start position to end position.
Base class for components that generate their own mesh.
std::vector< Real > _node_locations
Node locations along the main axis.
static InputParameters validParams()
const std::vector< std::string > & _axial_region_names
Axial region names.
Elem * addElementEdge3(dof_id_type node0, dof_id_type node1, dof_id_type node2)
Elem * addElementEdge2(dof_id_type node0, dof_id_type node1)
void mooseError(Args &&... args) const
virtual Elem * elemPtr(const dof_id_type i)
std::string genName(const std::string &prefix, unsigned int id, const std::string &suffix="") const
Build a name from a prefix, number and possible suffix.
virtual SubdomainID getNextSubdomainId()
Gets the next subdomain ID.
virtual BoundaryID getNextBoundaryId()
Gets the next nodeset or sideset ID.
Structure for storing connection data.