IOSS 2.0
|
#include <Iogs_GeneratedMesh.h>
Public Types | |
enum | ShellLocation { MX = 0 , PX = 1 , MY = 2 , PY = 3 , MZ = 4 , PZ = 5 } |
Public Member Functions | |
GeneratedMesh (const std::string ¶meters, int proc_count=1, int my_proc=0) | |
GeneratedMesh (int64_t num_x, int64_t num_y, int64_t num_z, int proc_count=1, int my_proc=0) | |
GeneratedMesh () | |
virtual | ~GeneratedMesh ()=default |
int64_t | add_sideset (ShellLocation loc) |
void | set_scale (double scl_x, double scl_y, double scl_z) |
void | set_offset (double off_x, double off_y, double off_z) |
void | set_bbox (double xmin, double ymin, double zmin, double xmax, double ymax, double zmax) |
void | set_rotation (const std::string &axis, double angle_degrees) |
virtual IOSS_NODISCARD int64_t | node_count () const |
virtual IOSS_NODISCARD int64_t | node_count_proc () const |
virtual IOSS_NODISCARD int64_t | structured_block_count () const |
virtual IOSS_NODISCARD int64_t | sideset_count () const |
IOSS_NODISCARD int64_t | sideset_side_count (int64_t id) const |
virtual IOSS_NODISCARD int64_t | sideset_side_count_proc (int64_t id) const |
IOSS_NODISCARD Ioss::IJK_t | block_range (int64_t) const |
IOSS_NODISCARD Ioss::IJK_t | block_range_proc (int64_t id) const |
IOSS_NODISCARD Ioss::IJK_t | block_offset_proc (int64_t id) const |
virtual IOSS_NODISCARD int64_t | element_count () const |
IOSS_NODISCARD int64_t | element_count_proc () const |
IOSS_NODISCARD int64_t | timestep_count () const |
virtual IOSS_NODISCARD int64_t | element_count (int64_t block_number) const |
IOSS_NODISCARD int64_t | element_count_proc (int64_t block_number) const |
virtual IOSS_NODISCARD std::pair< std::string, int > | topology_type (int64_t block_number) const |
void | build_node_map (Ioss::Int64Vector &map, std::vector< int > &proc, int64_t slab, size_t slabOffset, size_t adjacentProc, size_t index) |
virtual IOSS_NODISCARD int64_t | communication_node_count_proc () const |
virtual void | node_communication_map (Ioss::Int64Vector &map, std::vector< int > &proc) |
virtual void | owning_processor (int *owner, int64_t num_node) |
virtual void | node_map (Ioss::Int64Vector &map) const |
virtual void | node_map (Ioss::IntVector &map) const |
virtual void | element_map (int64_t block_number, Ioss::Int64Vector &map) const |
virtual void | element_map (int64_t block_number, Ioss::IntVector &map) const |
virtual void | element_map (Ioss::Int64Vector &map) const |
virtual void | element_map (Ioss::IntVector &map) const |
void | element_surface_map (ShellLocation loc, Ioss::Int64Vector &map) const |
void | connectivity (int64_t block_number, Ioss::Int64Vector &connect) const |
void | connectivity (int64_t block_number, Ioss::IntVector &connect) const |
void | connectivity (int64_t block_number, int64_t *connect) const |
virtual void | connectivity (int64_t block_number, int *connect) const |
virtual void | coordinates (std::vector< double > &coord) const |
virtual void | coordinates (double *coord) const |
virtual void | coordinates (std::vector< double > &x, std::vector< double > &y, std::vector< double > &z) const |
virtual void | coordinates (int component, std::vector< double > &xyz) const |
void | coordinates (int component, int zone, double *coord) const |
virtual void | sideset_elem_sides (int64_t id, Ioss::Int64Vector &elem_sides) const |
virtual IOSS_NODISCARD Ioss::NameList | sideset_touching_blocks (int64_t set_id) const |
IOSS_NODISCARD int64_t | get_num_x () const |
IOSS_NODISCARD int64_t | get_num_y () const |
IOSS_NODISCARD int64_t | get_num_z () const |
IOSS_NODISCARD size_t | get_variable_count (Ioss::EntityType type) const |
Private Member Functions | |
template<typename INT > | |
void | raw_element_map (int64_t block_number, std::vector< INT > &map) const |
template<typename INT > | |
void | raw_element_map (std::vector< INT > &map) const |
template<typename INT > | |
void | raw_connectivity (int64_t block_number, INT *connect) const |
GeneratedMesh (const GeneratedMesh &) | |
GeneratedMesh & | operator= (const GeneratedMesh &) |
void | set_variable_count (const std::string &type, size_t count) |
void | parse_options (const Ioss::NameList &groups) |
void | show_parameters () const |
void | initialize () |
Private Attributes | |
std::vector< ShellLocation > | sidesets {} |
std::array< std::array< double, 3 >, 3 > | rotmat |
size_t | numX {0} |
size_t | numY {0} |
size_t | numZ {0} |
size_t | myNumZ {0} |
size_t | myStartZ {0} |
size_t | processorCount {1} |
size_t | myProcessor {0} |
size_t | timestepCount {0} |
std::map< Ioss::EntityType, size_t > | variableCount {} |
double | offX {0} |
double | offY {0} |
double | offZ {0} |
double | sclX {1} |
double | sclY {1} |
double | sclZ {1} |
bool | doRotation {false} |
|
explicit |
Generate a cube mesh of size 'num_x' by 'num_y' by 'num_z' elements. By default, the mesh is gen_struc on a single processor. If 'proc_count' is greater than 1, then the mesh will be distributed over 'proc_count' processors and this process will get the portion of the mesh for 'my_proc'. The mesh will be decomposed along the 'Z' axis so 'num_z' must be greater than or equal to 'proc_count' and for even distribution of the hexes 'num_z' mod 'proc_count' should be zero.
The mesh can optionally include sidesets along each face of the cube mesh. These are specified via the 'add_sidesets' function.
If the 'parameters' string constructor is used, the string is parsed to determine the intervals in each direction and, optionally, additional information. The form of the string is "IxJxK" where I, J, and K are the number of intervals in the X, Y, and Z directions respectively and the "x" are literal 'x' characters. For example, the constructor GeneratedMesh("10x12x14") will create the same mesh as GeneratedMesh(10,12,14)
Additional valid options are:
The unrotated coordinate of a node at grid location i,j,k is:
The extent of the unrotated mesh will be:
If an unrecognized option is specified, an error message will be output and execution will continue.
An example of valid input is:
This would create a mesh with 10 intervals in x, 20 in y, 40 in z The mesh would be centered on 0,0,0 with a range of 10 in each direction.
NOTE: All options are processed in the order they appear in the parameters string (except rotate which is applied at the time the coordinates are gen_struc/retrieved)
Iogs::GeneratedMesh::GeneratedMesh | ( | int64_t | num_x, |
int64_t | num_y, | ||
int64_t | num_z, | ||
int | proc_count = 1, | ||
int | my_proc = 0 ) |
Iogs::GeneratedMesh::GeneratedMesh | ( | ) |
|
virtualdefault |
|
private |
int64_t Iogs::GeneratedMesh::add_sideset | ( | ShellLocation | loc | ) |
Add a sideset along the specified face of the hex mesh. The sidesets will maintain the order of definition. The first sideset defined will be sideset 1. The loc options are:
IOSS_NODISCARD Ioss::IJK_t Iogs::GeneratedMesh::block_offset_proc | ( | int64_t | id | ) | const |
|
inline |
IOSS_NODISCARD Ioss::IJK_t Iogs::GeneratedMesh::block_range_proc | ( | int64_t | id | ) | const |
void Iogs::GeneratedMesh::build_node_map | ( | Ioss::Int64Vector & | map, |
std::vector< int > & | proc, | ||
int64_t | slab, | ||
size_t | slabOffset, | ||
size_t | adjacentProc, | ||
size_t | index ) |
|
virtual |
|
virtual |
void Iogs::GeneratedMesh::connectivity | ( | int64_t | block_number, |
int64_t * | connect ) const |
void Iogs::GeneratedMesh::connectivity | ( | int64_t | block_number, |
Ioss::Int64Vector & | connect ) const |
Return the connectivity for the elements on this processor in the block with id 'block_number'. If the elements in this block have 'npe' nodes per element, then the first 'npe' entries in the 'conn' vector will be the nodal connectivity for the first element; the next 'npe' entries are the nodal connectivity for the second element. The 'connect' vector will be resized to the size required to contain the nodal connectivity for the specified block; all information in 'connect' will be overwritten.
void Iogs::GeneratedMesh::connectivity | ( | int64_t | block_number, |
Ioss::IntVector & | connect ) const |
|
virtual |
void Iogs::GeneratedMesh::coordinates | ( | int | component, |
int | zone, | ||
double * | coord ) const |
Return the coordinates for component 'comp' (1=x, 2=y, 3=z, 0=all) for all nodes in zone zone
on this processor. The vector will be resized to the size required to contain the nodal coordinates; all information in the vector will be overwritten. It is an error to request the coordinates via this function if a rotation is defined.
|
virtual |
Return the coordinates for component 'comp' (1=x, 2=y, 3=z) for all nodes on this processor. The vector will be resized to the size required to contain the nodal coordinates; all information in the vector will be overwritten. It is an error to request the coordinates via this function if a rotation is defined.
|
virtual |
Return the coordinates for all nodes on this processor. The first 3 entries in the 'coord' vector are the x, y, and z coordinates of the first node, etc. The 'coord' vector will be resized to the size required to contain the nodal coordinates; all information in 'coord' will be overwritten.
|
virtual |
Return the coordinates for all nodes on this processor in separate vectors. The vectors will be resized to the size required to contain the nodal coordinates; all information in the vectors will be overwritten.
|
virtual |
Return number of elements in all structured blocks in the model.
|
virtual |
Return number of elements in the structured block with id 'block_number'. The 'block_number' ranges from '1' to 'block_count()'.
int64_t Iogs::GeneratedMesh::element_count_proc | ( | ) | const |
Return number of elements in all structured blocks on this processor.
int64_t Iogs::GeneratedMesh::element_count_proc | ( | int64_t | block_number | ) | const |
Return number of elements on this processor in the structured block with id 'block_number'. The 'block_number' ranges from '1' to 'block_count()'.
|
virtual |
Fill the passed in 'map' argument with the element map "map[local_position] = global_id" for the elements on this processor in block "block_number".
|
virtual |
|
virtual |
Fill the passed in 'map' argument with the element map "map[local_position] = global_id" for all elements on this processor
|
virtual |
void Iogs::GeneratedMesh::element_surface_map | ( | ShellLocation | loc, |
Ioss::Int64Vector & | map ) const |
Fill the passed in 'map' argument with the element map pair "map[local_position] = element global_id" and "map[local_position+1] = element local face id (0-based)" for all elements on the current processor having a face on the surface defined by ShellLocation.
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
|
virtual |
|
virtual |
Return number of nodes in the entire model.
|
virtual |
Return number of nodes on this processor.
|
virtual |
Fill the passed in 'map' argument with the node map "map[local_position] = global_id" for the nodes on this processor.
|
virtual |
|
private |
|
virtual |
|
private |
|
private |
|
private |
|
private |
void Iogs::GeneratedMesh::set_bbox | ( | double | xmin, |
double | ymin, | ||
double | zmin, | ||
double | xmax, | ||
double | ymax, | ||
double | zmax ) |
void Iogs::GeneratedMesh::set_offset | ( | double | off_x, |
double | off_y, | ||
double | off_z ) |
void Iogs::GeneratedMesh::set_rotation | ( | const std::string & | axis, |
double | angle_degrees ) |
Set rotation. Multiple calls are cumulative. Rotate 'angle_degrees' degrees about the axis 'axis' Center of rotation is about the origin and operates on the scaled/offset coordinates of the mesh.
void Iogs::GeneratedMesh::set_scale | ( | double | scl_x, |
double | scl_y, | ||
double | scl_z ) |
Specify the coordinate scaling and offset in all three spatial dimensions.
node location of node at (i,j,k) is
WARNING: Should be called before retrieving node coordinates.
|
private |
|
private |
|
virtual |
Return number of sidesets in the entire model.
|
virtual |
Return the list of the face/ordinal pairs "elem_sides[local_position] = element global_id" and "elem_sides[local_position+1] = element local face id (0-based)" for the faces in sideset 'id' on this processor. The 'elem_sides' vector will be resized to the size required to contain the list. The element ids are global ids, the side ordinal is 0-based.
int64_t Iogs::GeneratedMesh::sideset_side_count | ( | int64_t | id | ) | const |
Return number of sideset 'sides' on sideset 'id'
|
virtual |
Return number of sideset 'sides' on sideset 'id' on the current processor.
|
virtual |
|
virtual |
Return number of structured blocks in the entire model.
|
inline |
|
virtual |
Returns pair containing "topology type string" and "number of nodes / element". The topology type string will be "hex8" for the hex element block
|
private |
Scale in X, Y, and Z directions location of node at (i,j,k) position is (sclX*i+offX, sclY*i+offY, sclZ*i+offZ)
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Offsets in X, Y, and Z directions
|
private |
|
private |
|
private |
|
private |
|
private |