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");
116 mesh().
elemPtr(elem_id)->subdomain_id() = subdomain_id;
155 const 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;
Elem * addElementEdge2(dof_id_type node0, dof_id_type node1)
virtual void buildMeshNodes()
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.
std::map< Component1DConnection::EEndType, std::vector< Connection > > _connections
Map of end type to a list of connections.
Real _length
Total axial length.
std::string sortBy() const
virtual Elem * elemPtr(const dof_id_type i)
virtual bool usingSecondOrderMesh() const override
Check if second order mesh is being used by this geometrical component.
Component1D(const InputParameters ¶meters)
BoundaryID _nodeset_id
Nodeset ID for all 1D component nodes.
Structure for storing connection data.
static InputParameters validParams()
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.
Node * addNode(const Point &pt)
std::vector< dof_id_type > _elem_ids
Element IDs of this component.
const RealVectorValue _dir
Normalized direction of axis from start position to end position.
const std::string & name() const
unsigned int _n_elem
Total number of axial elements.
std::vector< dof_id_type > _node_ids
Node IDs of this component.
Base class for components that generate their own mesh.
boundary_id_type BoundaryID
BoundaryName _nodeset_name
Nodeset name for all 1D component nodes.
const Point & _position
Start position of axis in 3-D space.
virtual SubdomainID getNextSubdomainId()
Gets the next subdomain ID.
Elem * addElementEdge3(dof_id_type node0, dof_id_type node1, dof_id_type node2)
const BoundaryName & getNodesetName() const
Gets the 1D component nodeset name.
THMMesh & mesh()
Non-const reference to THM mesh, which can only be called before the end of mesh setup.
virtual const std::vector< Connection > & getConnections(Component1DConnection::EEndType end_type) const
Gets the vector of connections of an end type for this component.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void checkSetupStatus(const EComponentSetupStatus &status) const
Throws an error if the supplied setup status of this component has not been reached.
virtual BoundaryID getNextBoundaryId()
Gets the next nodeset or sideset ID.
static InputParameters validParams()
std::vector< unsigned int > _n_elems
Number of elements in each axial section.
void mooseError(Args &&... args) const
virtual void buildMesh() override
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
std::vector< Real > _node_locations
Node locations along the main axis.
static const std::string k
unsigned int getNodesetID() const
Gets the 1D component nodeset ID.
const std::vector< std::string > & _axial_region_names
Axial region names.