Cardinal
|
#include <NekMeshGenerator.h>
Public Member Functions | |
NekMeshGenerator (const InputParameters ¶meters) | |
std::unique_ptr< MeshBase > | generate () override |
void | initializeElemData (std::unique_ptr< MeshBase > &mesh) |
void | checkElementType (std::unique_ptr< MeshBase > &mesh) |
virtual std::pair< unsigned int, unsigned int > | pairedNodesAboutMidPoint (const unsigned int &node_id) const |
unsigned int | getFaceNode (const unsigned int &primary_face) const |
virtual bool | isCornerNode (const unsigned int &node) const |
void | moveNodes (std::unique_ptr< MeshBase > &mesh, std::vector< Real > &polygon_layer_smoothing) |
const Elem * | getNextLayerElem (const Elem &elem, const unsigned int &touching_face, unsigned int &next_touching_face) const |
unsigned int | midPointNodeIndex (const unsigned int &face_id, const unsigned int &face_node) const |
unsigned int | pairedFaceNode (const unsigned int &node_id, const unsigned int &face_id) const |
std::vector< Elem * > | getBoundaryLayerElems (Elem *elem, const unsigned int &n_layers, const unsigned int &primary_face) const |
void | moveElem (Elem *elem, const unsigned int &boundary_index, const unsigned int &primary_face, const std::vector< Real > &polygon_layer_smoothing) |
bool | isNearCorner (const Point &pt) const |
unsigned int | getNodeIndex (const Elem *elem, const Point &pt) const |
Point | getClosestOrigin (const unsigned int &index, const Point &pt) const |
void | checkPointLength (const std::vector< std::vector< Real >> &points, std::string name) const |
void | adjustMidPointNode (const unsigned int &node_id, Elem *elem) const |
BoundaryID | getBoundaryID (const BoundaryName &name, const MeshBase &mesh) const |
Point | projectPoint (const Point &origin, const Point &pt) const |
Point | adjustPointToCircle (const unsigned int &node_id, Elem *elem, const Real &radius, const Point &origin) const |
Static Public Member Functions | |
static InputParameters | validParams () |
Protected Attributes | |
std::unique_ptr< MeshBase > & | _input |
Mesh to modify. More... | |
const MooseEnum & | _geometry_type |
Geometry type to curve boundaries to. More... | |
const MooseEnum & | _axis |
Axis of the mesh about which to build the circular surface. More... | |
const bool & | _curve_corners |
Whether to move corner nodes to fit curved radii of a regular polygon. More... | |
const Real & | _rotation_angle |
const bool & | _retain_original_elem_type |
Whether to skip the optional output conversion to Quad8 or Hex20 elements. More... | |
const bool | _has_moving_boundary |
Whether sidesets will be moved to match circular surfaces. More... | |
unsigned int | _n_start_nodes |
Number of nodes per element in original mesh. More... | |
unsigned int | _n_end_nodes |
Number of nodes per element in resulting mesh. More... | |
unsigned int | _n_start_nodes_per_side |
Number of nodes per side of the starting element. More... | |
unsigned int | _n_sides |
Number of sides per element (faces in 3-D, edges in 2-D) More... | |
unsigned int | _n_corner_nodes |
Number of corner nodes. More... | |
std::vector< BoundaryID > | _moving_boundary |
Sideset IDs to move to fit the circular surface. More... | |
std::vector< Real > | _radius |
Radii of the circular surface(s) More... | |
std::vector< std::vector< Real > > | _origin |
Origins of the circular surface(s) More... | |
std::vector< unsigned int > | _layers |
Number of layers to sweep on each boundary. More... | |
Real | _corner_radius |
If curving corners, the radius of curvature of the corner. More... | |
std::vector< Point > | _polygon_corners |
If curving corners, the corner coordinates of the polygon. More... | |
Real | _max_corner_distance |
Maximum distance a point can be from a corner and still require movement to the curved corners. More... | |
unsigned int | _n_noncorner_boundaries |
Number of boundaries to be moved that do not include the corners. More... | |
std::set< BoundaryID > | _boundaries_to_rebuild |
Boundaries to rebuild in the new mesh. More... | |
std::map< BoundaryID, BoundaryName > | _boundary_id_to_name |
Original boundary names and IDs. More... | |
std::vector< std::vector< unsigned int > > | _side_ids |
For each face, the mid-side nodes to be adjusted. More... | |
std::vector< std::vector< unsigned int > > | _corner_nodes |
For each face, the corner node indices. More... | |
std::vector< std::vector< std::pair< unsigned int, unsigned int > > > | _across_pair |
For each face, the node pairing "across" that face to the other side of the original elem type. More... | |
std::vector< unsigned int > | _across_face |
For each face, the paired face "across" to the other side of the original elem type. More... | |
ElemType | _etype |
Element type in the original mesh. More... | |
std::vector< std::vector< unsigned int > > | _side_nodes_map |
Side nodes map. More... | |
std::vector< std::vector< unsigned int > > | _face_nodes_map |
Face nodes map. More... | |
Converts a MOOSE high-order 2-D or 3-D mesh to optionally preserve circular boundaries by moving mid-face nodes, as well as optionally converting the element type into the types supported by Nek (Quad8 and Hex20).
NekMeshGenerator::NekMeshGenerator | ( | const InputParameters & | parameters | ) |
void NekMeshGenerator::adjustMidPointNode | ( | const unsigned int & | node_id, |
Elem * | elem | ||
) | const |
Adjust the mid-point side node to the average of the corners
[in] | node_id | index for the node on the side mid-point |
[in] | elem | element of interest |
Point NekMeshGenerator::adjustPointToCircle | ( | const unsigned int & | node_id, |
Elem * | elem, | ||
const Real & | radius, | ||
const Point & | origin | ||
) | const |
Adjust the point to which a face node should move to fit onto the circle
[in] | node_id | node ID |
[in] | elem | element of interest |
[in] | radius | radius of circle |
[in] | origin | origin of circle |
void NekMeshGenerator::checkElementType | ( | std::unique_ptr< MeshBase > & | mesh | ) |
Check for correct element type in input mesh; the input mesh must be either entirely Quad9 or Hex27 elements
void NekMeshGenerator::checkPointLength | ( | const std::vector< std::vector< Real >> & | points, |
std::string | name | ||
) | const |
Check that points have 3 components to represent x, y, z
[in] | points | points |
[in] | name | name of input parameter for error messages |
|
override |
BoundaryID NekMeshGenerator::getBoundaryID | ( | const BoundaryName & | name, |
const MeshBase & | mesh | ||
) | const |
Get the boundary ID pertaining to a boundary name, and check for validity
[in] | name | boundary to check |
[in] | mesh | mesh |
std::vector< Elem * > NekMeshGenerator::getBoundaryLayerElems | ( | Elem * | elem, |
const unsigned int & | n_layers, | ||
const unsigned int & | primary_face | ||
) | const |
Given an element with a face on the boundary of interest, get pointers to all the elements nested into the geometry
[in] | elem | input element |
[in] | n_layers | number of layers to sweep inwards |
[in] | primary_face | face of the input element that is on the boundary |
Point NekMeshGenerator::getClosestOrigin | ( | const unsigned int & | index, |
const Point & | pt | ||
) | const |
Find the origin closest to the given point
[in] | index | boundary index to look for origins |
[in] | pt | point of interest |
unsigned int NekMeshGenerator::getFaceNode | ( | const unsigned int & | primary_face | ) | const |
Get a node on the given face that is unique to that side of the element
[in] | primary_face | face ID |
const Elem * NekMeshGenerator::getNextLayerElem | ( | const Elem & | elem, |
const unsigned int & | touching_face, | ||
unsigned int & | next_touching_face | ||
) | const |
Get a pointer to the next element in the boundary layer
[in] | elem | current element in the boundary layer |
[in] | touching_face | face of the element that touches the "next" element |
[out] | next_touching_face | face ID of the "next" element |
unsigned int NekMeshGenerator::getNodeIndex | ( | const Elem * | elem, |
const Point & | pt | ||
) | const |
Get the node index pertaining to a given point
[in] | elem | element |
[in] | pt | point of interest |
void NekMeshGenerator::initializeElemData | ( | std::unique_ptr< MeshBase > & | mesh | ) |
|
virtual |
Whether a node on a face is a corner node
[in] | node | node index |
bool NekMeshGenerator::isNearCorner | ( | const Point & | pt | ) | const |
Whether a point is close enough to a corner to require moving to fit the curved radii of curvature
[in] | pt | point |
unsigned int NekMeshGenerator::midPointNodeIndex | ( | const unsigned int & | face_id, |
const unsigned int & | face_node | ||
) | const |
Get the node index corresponding to the mid-point side for a given corner node and face
[in] | face_id | face ID of the element |
[in] | face_node | node on given face |
void NekMeshGenerator::moveElem | ( | Elem * | elem, |
const unsigned int & | boundary_index, | ||
const unsigned int & | primary_face, | ||
const std::vector< Real > & | polygon_layer_smoothing | ||
) |
For an element on the 'boundary' of interest, move its nodes, as well as those of any boundary layers
[in] | elem | element on the primary 'boundary' |
[in] | boundary_index | index of the 'boundary' |
[in] | primary_face | face ID of the element on the 'boundary' |
[in] | polygon_layer_smoothing | multiplicate values to apply to boundary layer widths |
void NekMeshGenerator::moveNodes | ( | std::unique_ptr< MeshBase > & | mesh, |
std::vector< Real > & | polygon_layer_smoothing | ||
) |
Move any elements for circular adjusting
unsigned int NekMeshGenerator::pairedFaceNode | ( | const unsigned int & | node_id, |
const unsigned int & | face_id | ||
) | const |
Get the node "paired" to the present node "across" the face
[in] | node_id | node ID on primary face |
[in] | face_id | ID of primary face |
|
virtual |
Get the two nodes to average coordinates for given a side-node id
[in] | node_id | mid-point side node ID |
Point NekMeshGenerator::projectPoint | ( | const Point & | origin, |
const Point & | pt | ||
) | const |
Project a point onto the (x,y) plane (perpendicular to the 'axis'), relative to the origin
[in] | origin | origin |
[in] | pt | point to project |
|
static |
|
protected |
For each face, the paired face "across" to the other side of the original elem type.
|
protected |
For each face, the node pairing "across" that face to the other side of the original elem type.
|
protected |
Axis of the mesh about which to build the circular surface.
|
protected |
Boundaries to rebuild in the new mesh.
|
protected |
Original boundary names and IDs.
|
protected |
For each face, the corner node indices.
|
protected |
If curving corners, the radius of curvature of the corner.
|
protected |
Whether to move corner nodes to fit curved radii of a regular polygon.
|
protected |
Element type in the original mesh.
|
protected |
Face nodes map.
|
protected |
Geometry type to curve boundaries to.
|
protected |
Whether sidesets will be moved to match circular surfaces.
|
protected |
Mesh to modify.
|
protected |
Number of layers to sweep on each boundary.
|
protected |
Maximum distance a point can be from a corner and still require movement to the curved corners.
|
protected |
Sideset IDs to move to fit the circular surface.
|
protected |
Number of corner nodes.
|
protected |
Number of nodes per element in resulting mesh.
|
protected |
Number of boundaries to be moved that do not include the corners.
|
protected |
Number of sides per element (faces in 3-D, edges in 2-D)
|
protected |
Number of nodes per element in original mesh.
|
protected |
Number of nodes per side of the starting element.
|
protected |
Origins of the circular surface(s)
|
protected |
If curving corners, the corner coordinates of the polygon.
|
protected |
Radii of the circular surface(s)
|
protected |
Whether to skip the optional output conversion to Quad8 or Hex20 elements.
|
protected |
When curving corners, this mesh generator assumes that the polygon boundary is oriented so that it has a flat side "horizontal." For instance, if the polygon has 3 sides, this would look like:
o ----- o \ / \ / \o/
This is only used for identifying the points "at the corners" that need to be modified. If the input mesh therefore does not match the above, this rotation angle can be used to specify a different polygon orientation for the sake of curving corners.
|
protected |
For each face, the mid-side nodes to be adjusted.
|
protected |
Side nodes map.