Ioss::ElementTopology* Ioss::ElementTopology::boundary_type(int face_number) const { if (parametric_dimension() == 3 && spatial_dimension() == 3) return face_type(face_number); if (parametric_dimension() == 2 && spatial_dimension() == 2) return edge_type(face_number); if (is_element()) { if (parametric_dimension() == 2) { // A shell has faces and edges in its boundary... if (face_number == 0) return nullptr; assert(spatial_dimension() == 3); if (face_number > number_faces()) { return edge_type(face_number - number_faces()); } else { return face_type(face_number); } } else if (parametric_dimension() == 1) { return edge_type(face_number); } } else { if (parametric_dimension() == 2) { assert(spatial_dimension() == 3); return edge_type(face_number); } } return nullptr; }
Ioss::IntVector Ioss::ElementTopology::boundary_connectivity(int edge_number) const { if (parametric_dimension() == 3 && spatial_dimension() == 3) return face_connectivity(edge_number); if (parametric_dimension() == 2 && spatial_dimension() == 2) return edge_connectivity(edge_number); if (is_element()) { if (parametric_dimension() == 2) { assert(spatial_dimension() == 3); // A shell has faces and edges in its boundary... if (edge_number > number_faces()) { return edge_connectivity(edge_number - number_faces()); } else { return face_connectivity(edge_number); } } else if (parametric_dimension() == 1) { return edge_connectivity(edge_number); } } else { if (parametric_dimension() == 2) { assert(spatial_dimension() == 3); return edge_connectivity(edge_number); } } return Ioss::IntVector(); }
int Ioss::ElementTopology::number_boundaries() const { if (parametric_dimension() == 3 && spatial_dimension() == 3) return number_faces(); if (parametric_dimension() == 2 && spatial_dimension() == 2) return number_edges(); if (parametric_dimension() == 1 && !is_element()) return number_corner_nodes(); if (is_element()) { if (parametric_dimension() == 2) { assert(spatial_dimension() == 3); // A shell has faces and edges in its boundary... return number_faces() + number_edges(); } else if (parametric_dimension() == 1) { return number_edges(); } } else { if (parametric_dimension() == 2) { assert(spatial_dimension() == 3); return number_edges(); } } return 0; }
Ioss::ElementTopology* Ioss::Unknown::face_type(int face_number) const { // face_number == 0 returns topology for all faces if // all faces are the same topology; otherwise, returns NULL // face_number is 1-based. assert(face_number >= 0 && face_number <= number_faces()); return Ioss::ElementTopology::factory("unknown"); }
Ioss::ElementTopology *Ioss::Sphere::face_type(int face_number) const { // face_number == 0 returns topology for all faces if // all faces are the same topology; otherwise, returns nullptr // face_number is 1-based. assert(face_number >= 0 && face_number <= number_faces()); return (Ioss::ElementTopology *)nullptr; }
Ioss::IntVector Ioss::Wedge15::face_connectivity(int face_number) const { assert(face_number > 0 && face_number <= number_faces()); Ioss::IntVector connectivity(number_nodes_face(face_number)); for (int i=0; i < number_nodes_face(face_number); i++) connectivity[i] = Constants::face_node_order[face_number-1][i]; return connectivity; }
Ioss::ElementTopology *Ioss::Tet15::face_type(int face_number) const { // face_number == 0 returns topology for all faces if // all faces are the same topology; otherwise, returns nullptr // face_number is 1-based. assert(face_number >= 0 && face_number <= number_faces()); // return Ioss::ElementTopology::factory("triface6"); return Ioss::ElementTopology::factory("tri7"); }
Ioss::IntVector Ioss::Hex27::face_connectivity(int face_number) const { assert(face_number > 0 && face_number <= number_faces()); Ioss::IntVector connectivity(Constants::nodes_per_face[face_number]); for (int i=0; i < Constants::nodes_per_face[face_number]; i++) connectivity[i] = Constants::face_node_order[face_number-1][i]; return connectivity; }
Ioss::ElementTopology* Ioss::Wedge15::face_type(int face_number) const { assert(face_number >= 0 && face_number <= number_faces()); if (face_number == 0) return (Ioss::ElementTopology*)NULL; else if (face_number <= 3) // return Ioss::ElementTopology::factory("quadface8"); return Ioss::ElementTopology::factory("quad8"); else // return Ioss::ElementTopology::factory("triface6"); return Ioss::ElementTopology::factory("tri6"); }
Ioss::ElementTopology* Ioss::Pyramid5::face_type(int face_number) const { assert(face_number >= 0 && face_number <= number_faces()); if (face_number == 0) return (Ioss::ElementTopology*)NULL; else if (face_number <= 4) // return Ioss::ElementTopology::factory("triface3"); return Ioss::ElementTopology::factory("tri3"); else // return Ioss::ElementTopology::factory("quadface4"); return Ioss::ElementTopology::factory("quad4"); }
Ioss::ElementTopology* Ioss::Pyramid14::face_type(int face_number) const { assert(face_number >= 0 && face_number <= number_faces()); if (face_number == 0) return (Ioss::ElementTopology*)nullptr; else if (face_number <= 4) // return Ioss::ElementTopology::factory("triface6"); return Ioss::ElementTopology::factory("tri6"); else // return Ioss::ElementTopology::factory("quadface9"); return Ioss::ElementTopology::factory("quad9"); }
Ioss::IntVector Ioss::ElementTopology::face_edge_connectivity(int face_number) const { assert(face_number > 0 && face_number <= number_faces()); int nface_edge = number_edges_face(face_number); Ioss::IntVector fcon(nface_edge); // This works for 2D elements, 3D elements override for (int i=0; i < nface_edge; i++) fcon[i] = i; return fcon; }
Ioss::ElementTopology *Ioss::Wedge15::face_type(int face_number) const { assert(face_number >= 0 && face_number <= number_faces()); if (face_number == 0) { return (Ioss::ElementTopology *)nullptr; } if (face_number <= 3) { // return Ioss::ElementTopology::factory("quadface8"); return Ioss::ElementTopology::factory("quad8"); } // return Ioss::ElementTopology::factory("triface6"); return Ioss::ElementTopology::factory("tri6"); }
Ioss::ElementTopology *Ioss::Pyramid5::face_type(int face_number) const { assert(face_number >= 0 && face_number <= number_faces()); if (face_number == 0) { return (Ioss::ElementTopology *)nullptr; } if (face_number <= 4) { // return Ioss::ElementTopology::factory("triface3"); return Ioss::ElementTopology::factory("tri3"); } // return Ioss::ElementTopology::factory("quadface4"); return Ioss::ElementTopology::factory("quad4"); }
Ioss::ElementTopology* Ioss::Tet7::face_type(int face_number) const { // face_number == 0 returns topology for all faces if // all faces are the same topology; otherwise, returns NULL // face_number is 1-based. assert(face_number >= 0 && face_number <= number_faces()); if (face_number == 0) return NULL; else if (face_number == 4) return Ioss::ElementTopology::factory("tri6"); else return Ioss::ElementTopology::factory("tri4a"); }
int Ioss::Hex27::number_edges_face(int face) const { // face is 1-based. 0 passed in for all faces. assert(face >= 0 && face <= number_faces()); return Constants::edges_per_face[face]; }
Ioss::ElementTopology *Ioss::TriShell6::face_type(int face_number) const { assert(face_number >= 0 && face_number <= number_faces()); // return Ioss::ElementTopology::factory("triface6"); return Ioss::ElementTopology::factory("tri6"); }
int Ioss::TriShell6::number_nodes_face(int face) const { // face is 1-based. 0 passed in for all faces. assert(face >= 0 && face <= number_faces()); return Constants::nodes_per_face[face]; }
int Ioss::Bar3::number_nodes_face(int face) const { // face is 1-based. 0 passed in for all faces. assert(face >= 0 && face <= number_faces()); return Constants::nfacenode; }
int Ioss::Edge2::number_edges_face(int face) const { // face is 1-based. 0 passed in for all faces. assert(face >= 0 && face <= number_faces()); return Constants::nfaceedge; }
Ioss::IntVector Ioss::Sphere::face_connectivity(int face_number) const { assert(face_number > 0 && face_number <= number_faces()); Ioss::IntVector connectivity; return connectivity; }
Ioss::ElementTopology* Ioss::Shell8::face_type(int face_number) const { assert(face_number >= 0 && face_number <= number_faces()); // return Ioss::ElementTopology::factory("quadface8"); return Ioss::ElementTopology::factory("quad8"); }