diff --git a/packages/seacas/applications/nem_slice/elb.h b/packages/seacas/applications/nem_slice/elb.h index 5d13775f9c..8ead71b4f9 100644 --- a/packages/seacas/applications/nem_slice/elb.h +++ b/packages/seacas/applications/nem_slice/elb.h @@ -214,22 +214,22 @@ struct Weight_Description /* Structure used to store information about the FEM mesh */ template struct Mesh_Description { - size_t num_nodes{0}; - size_t num_elems{0}; - size_t num_dims{0}; - size_t num_el_blks{0}; - std::vector eb_cnts{}; - std::vector eb_ids{}; - std::vector eb_npe{}; - std::vector eb_type{}; - size_t num_node_sets{0}; - size_t num_side_sets{0}; - size_t max_np_elem{0}; - size_t ns_list_len{0}; - char title[MAX_LINE_LENGTH + 1]{}; - std::vector coords{}; - std::vector elem_type{}; - INT **connect; + size_t num_nodes{0}; + size_t num_elems{0}; + size_t num_dims{0}; + size_t num_el_blks{0}; + std::vector eb_cnts{}; + std::vector eb_ids{}; + std::vector eb_npe{}; + std::vector eb_type{}; + size_t num_node_sets{0}; + size_t num_side_sets{0}; + size_t max_np_elem{0}; + size_t ns_list_len{0}; + char title[MAX_LINE_LENGTH + 1]{}; + std::vector coords{}; + std::vector elem_type{}; + INT **connect; Mesh_Description() : connect(nullptr) {} }; diff --git a/packages/seacas/applications/nem_slice/elb_elem.C b/packages/seacas/applications/nem_slice/elb_elem.C index de4592f06b..ea37c42ef6 100644 --- a/packages/seacas/applications/nem_slice/elb_elem.C +++ b/packages/seacas/applications/nem_slice/elb_elem.C @@ -38,32 +38,32 @@ namespace { * Need the number of dimensions in order to distinguish between * TRI elements in a 2d mesh from TRI elements in a 3d mesh. *****************************************************************************/ -const char *elem_name_from_enum(const E_Type elem_type) +const char *elem_name_from_enum(const ElementType elem_type) { - static const char *elem_names[NULL_EL] = { + static const char *elem_names[(int)ElementType::NULL_EL] = { "SPHERE", "BAR2", "BAR3", "QUAD4", "QUAD8", "QUAD9", "SHELL4", "SHELL8", "SHELL9", "TRI3", "TRI4", "TRI6", "TRI7", "TSHELL3", "TSHELL4", "TSHELL6", "TSHELL7", "HEX8", "HEX16", "HEX20", "HEX27", "HEXSHELL", "TET4", "TET10", "TET8", "TET14", "TET15", "WEDGE6", "WEDGE12", "WEDGE15", "WEDGE16", "WEDGE20", "WEDGE21", "PYRAMID5", "PYRAMID13", "PYRAMID14", "PYRAMID18", "PYRAMID19", "SHELL2", "SHELL3", "BAR1D2", "BAR1D3"}; - return elem_names[elem_type]; + return elem_names[(int)elem_type]; } -E_Type get_elem_type(const char *elem_name, const int num_nodes, const int num_dim) +ElementType get_elem_type(const char *elem_name, const int num_nodes, const int num_dim) { - E_Type answer = NULL_EL; + ElementType answer = ElementType::NULL_EL; switch (elem_name[0]) { case 'h': case 'H': if (strncasecmp(elem_name, "HEX", 3) == 0) { switch (num_nodes) { - case 8: answer = HEX8; break; - case 12: answer = HEXSHELL; break; - case 16: answer = HEX16; break; - case 20: answer = HEX20; break; - case 27: answer = HEX27; break; + case 8: answer = ElementType::HEX8; break; + case 12: answer = ElementType::HEXSHELL; break; + case 16: answer = ElementType::HEX16; break; + case 20: answer = ElementType::HEX20; break; + case 27: answer = ElementType::HEX27; break; default: Gen_Error(0, "fatal: unsupported HEX element"); error_report(); @@ -75,20 +75,20 @@ E_Type get_elem_type(const char *elem_name, const int num_nodes, const int num_d case 'c': case 'C': if (strncasecmp(elem_name, "CIRCLE", 6) == 0) { - answer = SPHERE; + answer = ElementType::SPHERE; } break; case 's': case 'S': if (strncasecmp(elem_name, "SPHERE", 6) == 0) { - answer = SPHERE; + answer = ElementType::SPHERE; } else if (strncasecmp(elem_name, "SHELL", 5) == 0) { switch (num_nodes) { case 2: if (num_dim == 2) { - answer = SHELL2; + answer = ElementType::SHELL2; } else { Gen_Error(0, "fatal: unsupported SHELL element"); @@ -98,7 +98,7 @@ E_Type get_elem_type(const char *elem_name, const int num_nodes, const int num_d break; case 3: if (num_dim == 2) { - answer = SHELL3; + answer = ElementType::SHELL3; } else { Gen_Error(0, "fatal: unsupported SHELL element"); @@ -106,9 +106,9 @@ E_Type get_elem_type(const char *elem_name, const int num_nodes, const int num_d exit(1); } break; - case 4: answer = SHELL4; break; - case 8: answer = SHELL8; break; - case 9: answer = SHELL9; break; + case 4: answer = ElementType::SHELL4; break; + case 8: answer = ElementType::SHELL8; break; + case 9: answer = ElementType::SHELL9; break; default: Gen_Error(0, "fatal: unsupported SHELL element"); error_report(); @@ -126,8 +126,8 @@ E_Type get_elem_type(const char *elem_name, const int num_nodes, const int num_d if (strncasecmp(elem_name, "BEAM", 4) == 0 || strncasecmp(elem_name, "TRUSS", 5) == 0 || strncasecmp(elem_name, "ROD", 3) == 0 || strncasecmp(elem_name, "BAR", 3) == 0) { switch (num_nodes) { - case 2: answer = num_dim == 1 ? BAR1D2 : BAR2; break; - case 3: answer = num_dim == 1 ? BAR1D3 : BAR3; break; + case 2: answer = num_dim == 1 ? ElementType::BAR1D2 : ElementType::BAR2; break; + case 3: answer = num_dim == 1 ? ElementType::BAR1D3 : ElementType::BAR3; break; default: Gen_Error(0, "fatal: unsupported BAR/BEAM/TRUSS element"); error_report(); @@ -138,34 +138,34 @@ E_Type get_elem_type(const char *elem_name, const int num_nodes, const int num_d switch (num_nodes) { case 3: if (num_dim == 2) { - answer = TRI3; + answer = ElementType::TRI3; } else { - answer = TSHELL3; + answer = ElementType::TSHELL3; } break; case 4: if (num_dim == 2) { - answer = TRI4; + answer = ElementType::TRI4; } else { - answer = TSHELL4; + answer = ElementType::TSHELL4; } break; case 6: if (num_dim == 2) { - answer = TRI6; + answer = ElementType::TRI6; } else { - answer = TSHELL6; + answer = ElementType::TSHELL6; } break; case 7: if (num_dim == 2) { - answer = TRI7; + answer = ElementType::TRI7; } else { - answer = TSHELL7; + answer = ElementType::TSHELL7; } break; default: @@ -176,11 +176,11 @@ E_Type get_elem_type(const char *elem_name, const int num_nodes, const int num_d } else if (strncasecmp(elem_name, "TET", 3) == 0) { switch (num_nodes) { - case 4: answer = TET4; break; - case 8: answer = TET8; break; - case 10: answer = TET10; break; - case 14: answer = TET14; break; - case 15: answer = TET15; break; + case 4: answer = ElementType::TET4; break; + case 8: answer = ElementType::TET8; break; + case 10: answer = ElementType::TET10; break; + case 14: answer = ElementType::TET14; break; + case 15: answer = ElementType::TET15; break; default: Gen_Error(0, "fatal: unsupported TET element"); error_report(); @@ -195,26 +195,26 @@ E_Type get_elem_type(const char *elem_name, const int num_nodes, const int num_d switch (num_nodes) { case 4: if (num_dim == 2) { - answer = QUAD4; + answer = ElementType::QUAD4; } else { - answer = SHELL4; + answer = ElementType::SHELL4; } break; case 8: if (num_dim == 2) { - answer = QUAD8; + answer = ElementType::QUAD8; } else { - answer = SHELL8; + answer = ElementType::SHELL8; } break; case 9: if (num_dim == 2) { - answer = QUAD9; + answer = ElementType::QUAD9; } else { - answer = SHELL9; + answer = ElementType::SHELL9; } break; default: @@ -229,12 +229,12 @@ E_Type get_elem_type(const char *elem_name, const int num_nodes, const int num_d case 'W': if (strncasecmp(elem_name, "WEDGE", 5) == 0) { switch (num_nodes) { - case 6: answer = WEDGE6; break; - case 12: answer = WEDGE12; break; - case 15: answer = WEDGE15; break; - case 16: answer = WEDGE16; break; - case 20: answer = WEDGE20; break; - case 21: answer = WEDGE21; break; + case 6: answer = ElementType::WEDGE6; break; + case 12: answer = ElementType::WEDGE12; break; + case 15: answer = ElementType::WEDGE15; break; + case 16: answer = ElementType::WEDGE16; break; + case 20: answer = ElementType::WEDGE20; break; + case 21: answer = ElementType::WEDGE21; break; default: Gen_Error(0, "fatal: unsupported WEDGE element"); error_report(); @@ -247,11 +247,11 @@ E_Type get_elem_type(const char *elem_name, const int num_nodes, const int num_d case 'P': if (strncasecmp(elem_name, "PYR", 3) == 0) { switch (num_nodes) { - case 5: answer = PYRAMID5; break; - case 13: answer = PYRAMID13; break; - case 14: answer = PYRAMID14; break; - case 18: answer = PYRAMID18; break; - case 19: answer = PYRAMID19; break; + case 5: answer = ElementType::PYRAMID5; break; + case 13: answer = ElementType::PYRAMID13; break; + case 14: answer = ElementType::PYRAMID14; break; + case 18: answer = ElementType::PYRAMID18; break; + case 19: answer = ElementType::PYRAMID19; break; default: Gen_Error(0, "fatal: unsupported PYRAMID element"); error_report(); @@ -263,7 +263,7 @@ E_Type get_elem_type(const char *elem_name, const int num_nodes, const int num_d default: break; } - if (answer == NULL_EL) { + if (answer == ElementType::NULL_EL) { std::string errstr; errstr = fmt::format("fatal: unknown element type '{}' read", elem_name); Gen_Error(0, errstr); @@ -280,29 +280,33 @@ E_Type get_elem_type(const char *elem_name, const int num_nodes, const int num_d /*****************************************************************************/ /* Convenience functions for code readability *****************************************************************************/ -bool is_hex(E_Type etype) +bool is_hex(ElementType etype) { - return etype == HEX8 || etype == HEX27 || etype == HEX20 || etype == HEXSHELL; + return etype == ElementType::HEX8 || etype == ElementType::HEX27 || etype == ElementType::HEX20 || + etype == ElementType::HEXSHELL; } -bool is_tet(E_Type etype) +bool is_tet(ElementType etype) { - return etype == TET4 || etype == TET10 || etype == TET8 || etype == TET14 || etype == TET15; + return etype == ElementType::TET4 || etype == ElementType::TET10 || etype == ElementType::TET8 || + etype == ElementType::TET14 || etype == ElementType::TET15; } -bool is_wedge(E_Type etype) +bool is_wedge(ElementType etype) { - return etype == WEDGE6 || etype == WEDGE15 || etype == WEDGE16 || etype == WEDGE20 || - etype == WEDGE21; + return etype == ElementType::WEDGE6 || etype == ElementType::WEDGE15 || + etype == ElementType::WEDGE16 || etype == ElementType::WEDGE20 || + etype == ElementType::WEDGE21; } -bool is_pyramid(E_Type etype) +bool is_pyramid(ElementType etype) { - return etype == PYRAMID5 || etype == PYRAMID13 || etype == PYRAMID14 || etype == PYRAMID18 || - etype == PYRAMID19; + return etype == ElementType::PYRAMID5 || etype == ElementType::PYRAMID13 || + etype == ElementType::PYRAMID14 || etype == ElementType::PYRAMID18 || + etype == ElementType::PYRAMID19; } -bool is_3d_element(E_Type etype) +bool is_3d_element(ElementType etype) { return is_hex(etype) || is_tet(etype) || is_wedge(etype) || is_pyramid(etype); } @@ -314,14 +318,14 @@ bool is_3d_element(E_Type etype) *---------------------------------------------------------------------------- * This function returns various information about the input element type. *****************************************************************************/ -int get_elem_info(const int req, const E_Type etype) +int get_elem_info(const int req, const ElementType etype) { int answer = 0; switch (etype) /* Switch over the element type */ { - case BAR1D2: + case ElementType::BAR1D2: switch (req) { case NNODES: answer = 2; break; case NSIDE_NODES: answer = 1; break; @@ -334,7 +338,7 @@ int get_elem_info(const int req, const E_Type etype) } break; - case BAR2: + case ElementType::BAR2: switch (req) { case NNODES: answer = 2; break; case NSIDE_NODES: answer = 2; break; @@ -347,7 +351,7 @@ int get_elem_info(const int req, const E_Type etype) } break; - case SHELL2: + case ElementType::SHELL2: switch (req) { case NNODES: answer = 2; break; case NSIDE_NODES: answer = 2; break; @@ -360,7 +364,7 @@ int get_elem_info(const int req, const E_Type etype) } break; - case SHELL3: + case ElementType::SHELL3: switch (req) { case NNODES: answer = 3; break; case NSIDE_NODES: answer = 2; break; @@ -373,7 +377,7 @@ int get_elem_info(const int req, const E_Type etype) } break; - case BAR1D3: + case ElementType::BAR1D3: switch (req) { case NNODES: answer = 3; break; case NSIDE_NODES: answer = 1; break; @@ -386,7 +390,7 @@ int get_elem_info(const int req, const E_Type etype) } break; - case BAR3: + case ElementType::BAR3: switch (req) { case NNODES: answer = 3; break; case NSIDE_NODES: answer = 2; break; @@ -399,7 +403,7 @@ int get_elem_info(const int req, const E_Type etype) } break; - case SPHERE: + case ElementType::SPHERE: switch (req) { case NNODES: answer = 1; break; case NSIDE_NODES: answer = 0; break; @@ -408,8 +412,8 @@ int get_elem_info(const int req, const E_Type etype) } break; - case QUAD4: /* First order quad */ - switch (req) /* select type of information required*/ + case ElementType::QUAD4: /* First order quad */ + switch (req) /* select type of information required*/ { case NNODES: /* number of nodes */ answer = 4; break; case NDIM: /* number of physical dimensions */ answer = 2; break; @@ -422,8 +426,8 @@ int get_elem_info(const int req, const E_Type etype) } break; - case QUAD8: /* 2nd order serendipity quad */ - switch (req) /* select type of information required */ + case ElementType::QUAD8: /* 2nd order serendipity quad */ + switch (req) /* select type of information required */ { case NNODES: /* number of nodes */ answer = 8; break; case NDIM: /* number of physical dimensions */ answer = 2; break; @@ -436,8 +440,8 @@ int get_elem_info(const int req, const E_Type etype) } break; - case QUAD9: /* biquadratic quadrilateral */ - switch (req) /* select type of information required */ + case ElementType::QUAD9: /* biquadratic quadrilateral */ + switch (req) /* select type of information required */ { case NNODES: /* number of nodes */ answer = 9; break; case NDIM: /* number of physical dimensions */ answer = 2; break; @@ -451,7 +455,7 @@ int get_elem_info(const int req, const E_Type etype) break; /* NOTE: cannot determine NSIDE_NODES for SHELL element */ - case SHELL4: + case ElementType::SHELL4: switch (req) { case NNODES: answer = 4; break; case NSIDES: answer = 6; break; @@ -463,7 +467,7 @@ int get_elem_info(const int req, const E_Type etype) } break; - case SHELL8: + case ElementType::SHELL8: switch (req) { case NNODES: answer = 8; break; case NSIDES: answer = 6; break; @@ -475,7 +479,7 @@ int get_elem_info(const int req, const E_Type etype) } break; - case SHELL9: + case ElementType::SHELL9: switch (req) { case NNODES: answer = 9; break; case NSIDES: answer = 6; break; @@ -487,7 +491,7 @@ int get_elem_info(const int req, const E_Type etype) } break; - case TRI3: + case ElementType::TRI3: switch (req) /* select type of information required */ { case NNODES: /* number of nodes */ answer = 3; break; @@ -501,7 +505,7 @@ int get_elem_info(const int req, const E_Type etype) } break; - case TRI4: + case ElementType::TRI4: switch (req) /* select type of information required */ { case NNODES: /* number of nodes */ answer = 4; break; @@ -515,7 +519,7 @@ int get_elem_info(const int req, const E_Type etype) } break; - case TRI6: + case ElementType::TRI6: switch (req) /* select type of information required */ { case NNODES: /* number of nodes */ answer = 6; break; @@ -529,7 +533,7 @@ int get_elem_info(const int req, const E_Type etype) } break; - case TRI7: + case ElementType::TRI7: switch (req) /* select type of information required */ { case NNODES: /* number of nodes */ answer = 7; break; @@ -544,7 +548,7 @@ int get_elem_info(const int req, const E_Type etype) break; /* NOTE: cannot determine NSIDE_NODES for TSHELL element */ - case TSHELL3: + case ElementType::TSHELL3: switch (req) /* select type of information required */ { case NNODES: /* number of nodes */ answer = 3; break; @@ -557,7 +561,7 @@ int get_elem_info(const int req, const E_Type etype) } break; - case TSHELL4: + case ElementType::TSHELL4: switch (req) /* select type of information required */ { case NNODES: /* number of nodes */ answer = 4; break; @@ -570,7 +574,7 @@ int get_elem_info(const int req, const E_Type etype) } break; - case TSHELL6: + case ElementType::TSHELL6: switch (req) /* select type of information required */ { case NNODES: /* number of nodes */ answer = 6; break; @@ -583,7 +587,7 @@ int get_elem_info(const int req, const E_Type etype) } break; - case TSHELL7: + case ElementType::TSHELL7: switch (req) /* select type of information required */ { case NNODES: /* number of nodes */ answer = 7; break; @@ -596,8 +600,8 @@ int get_elem_info(const int req, const E_Type etype) } break; - case HEX8: /* trilinear hexahedron */ - switch (req) /* select type of information required */ + case ElementType::HEX8: /* trilinear hexahedron */ + switch (req) /* select type of information required */ { case NNODES: /* number of nodes */ answer = 8; break; case NDIM: /* number of physical dimensions */ answer = 3; break; @@ -610,7 +614,7 @@ int get_elem_info(const int req, const E_Type etype) } break; - case HEX16: /* localization element NSNODES is not consistent... */ + case ElementType::HEX16: /* localization element NSNODES is not consistent... */ switch (req) { case NNODES: /* number of nodes */ answer = 16; break; case NDIM: /* number of physical dimensions */ answer = 3; break; @@ -622,8 +626,8 @@ int get_elem_info(const int req, const E_Type etype) } break; - case HEX20: /* serendipity triquadratic hexahedron */ - switch (req) /* select type of information required */ + case ElementType::HEX20: /* serendipity triquadratic hexahedron */ + switch (req) /* select type of information required */ { case NNODES: /* number of nodes */ answer = 20; break; case NDIM: /* number of physical dimensions */ answer = 3; break; @@ -636,8 +640,8 @@ int get_elem_info(const int req, const E_Type etype) } break; - case HEX27: /* triquadratic hexahedron */ - switch (req) /* select type of information required*/ + case ElementType::HEX27: /* triquadratic hexahedron */ + switch (req) /* select type of information required*/ { case NNODES: /* number of nodes */ answer = 27; break; case NDIM: /* number of physical dimensions */ answer = 3; break; @@ -651,7 +655,7 @@ int get_elem_info(const int req, const E_Type etype) break; /* NOTE: cannot determine NSIDE_NODES for HEXSHELL element */ - case HEXSHELL: + case ElementType::HEXSHELL: switch (req) { case NNODES: answer = 12; break; case NSIDES: answer = 6; break; @@ -663,8 +667,8 @@ int get_elem_info(const int req, const E_Type etype) } break; - case TET4: /* trilinear tetrahedron */ - switch (req) /* select type of information required*/ + case ElementType::TET4: /* trilinear tetrahedron */ + switch (req) /* select type of information required*/ { case NNODES: /* number of nodes */ answer = 4; break; case NDIM: /* number of physical dimensions */ answer = 3; break; @@ -677,8 +681,8 @@ int get_elem_info(const int req, const E_Type etype) } break; - case TET10: /* triquadradic tetrahedron */ - switch (req) /* select type of information required */ + case ElementType::TET10: /* triquadradic tetrahedron */ + switch (req) /* select type of information required */ { case NNODES: /* number of nodes */ answer = 10; break; case NDIM: /* number of physical dimensions */ answer = 3; break; @@ -691,7 +695,7 @@ int get_elem_info(const int req, const E_Type etype) } break; - case TET14: + case ElementType::TET14: switch (req) /* select type of information required */ { case NNODES: /* number of nodes */ answer = 14; break; @@ -705,7 +709,7 @@ int get_elem_info(const int req, const E_Type etype) } break; - case TET15: + case ElementType::TET15: switch (req) /* select type of information required */ { case NNODES: /* number of nodes */ answer = 15; break; @@ -719,8 +723,8 @@ int get_elem_info(const int req, const E_Type etype) } break; - case TET8: /* 8-node (midface nodes) tetrahedron */ - switch (req) /* select type of information required */ + case ElementType::TET8: /* 8-node (midface nodes) tetrahedron */ + switch (req) /* select type of information required */ { case NNODES: /* number of nodes */ answer = 8; break; case NDIM: /* number of physical dimensions */ answer = 3; break; @@ -734,7 +738,7 @@ int get_elem_info(const int req, const E_Type etype) break; /* NOTE: cannot determine NSIDE_NODES for WEDGE elements */ - case WEDGE6: + case ElementType::WEDGE6: switch (req) { case NNODES: answer = 6; break; case NSIDES: answer = 5; break; @@ -746,7 +750,7 @@ int get_elem_info(const int req, const E_Type etype) } break; - case WEDGE12: + case ElementType::WEDGE12: switch (req) { case NNODES: answer = 12; break; case NSIDES: answer = 5; break; @@ -758,7 +762,7 @@ int get_elem_info(const int req, const E_Type etype) } break; - case WEDGE15: + case ElementType::WEDGE15: switch (req) { case NNODES: answer = 15; break; case NSIDES: answer = 5; break; @@ -770,7 +774,7 @@ int get_elem_info(const int req, const E_Type etype) } break; - case WEDGE16: + case ElementType::WEDGE16: switch (req) { case NNODES: answer = 16; break; case NSIDES: answer = 5; break; @@ -782,7 +786,7 @@ int get_elem_info(const int req, const E_Type etype) } break; - case WEDGE20: + case ElementType::WEDGE20: switch (req) { case NNODES: answer = 20; break; case NSIDES: answer = 5; break; @@ -794,7 +798,7 @@ int get_elem_info(const int req, const E_Type etype) } break; - case WEDGE21: + case ElementType::WEDGE21: switch (req) { case NNODES: answer = 21; break; case NSIDES: answer = 5; break; @@ -807,7 +811,7 @@ int get_elem_info(const int req, const E_Type etype) break; /* NOTE: cannot determine NSIDE_NODES for PYRAMID element */ - case PYRAMID5: + case ElementType::PYRAMID5: switch (req) { case NNODES: answer = 5; break; case NSIDES: answer = 5; break; @@ -819,7 +823,7 @@ int get_elem_info(const int req, const E_Type etype) } break; - case PYRAMID13: + case ElementType::PYRAMID13: switch (req) { case NNODES: answer = 13; break; case NSIDES: answer = 5; break; @@ -831,7 +835,7 @@ int get_elem_info(const int req, const E_Type etype) } break; - case PYRAMID14: + case ElementType::PYRAMID14: switch (req) { case NNODES: answer = 14; break; case NSIDES: answer = 5; break; @@ -843,7 +847,7 @@ int get_elem_info(const int req, const E_Type etype) } break; - case PYRAMID18: + case ElementType::PYRAMID18: switch (req) { case NNODES: answer = 18; break; case NSIDES: answer = 5; break; @@ -855,7 +859,7 @@ int get_elem_info(const int req, const E_Type etype) } break; - case PYRAMID19: + case ElementType::PYRAMID19: switch (req) { case NNODES: answer = 19; break; case NSIDES: answer = 5; break; @@ -890,13 +894,13 @@ int get_elem_info(const int req, const E_Type etype) * * Now supoports degenerate faces in HEX elements. *****************************************************************************/ -template int get_side_id(const E_Type etype, const int *connect, const int nsnodes, +template int get_side_id(const ElementType etype, const int *connect, const int nsnodes, int side_nodes[], const int skip_check, const int partial_adj); -template int get_side_id(const E_Type etype, const int64_t *connect, const int nsnodes, +template int get_side_id(const ElementType etype, const int64_t *connect, const int nsnodes, int64_t side_nodes[], const int skip_check, const int partial_adj); template -int get_side_id(const E_Type etype, const INT *connect, const int nsnodes, INT side_nodes[], +int get_side_id(const ElementType etype, const INT *connect, const int nsnodes, INT side_nodes[], const int skip_check, const int partial_adj) { int count = 0; @@ -966,8 +970,8 @@ int get_side_id(const E_Type etype, const INT *connect, const int nsnodes, INT s /* Find the side ID */ switch (etype) { - case BAR1D2: - case BAR1D3: + case ElementType::BAR1D2: + case ElementType::BAR1D3: /* SIDE 1 */ if (side_nodes[0] == connect[0]) { return 1; @@ -977,18 +981,18 @@ int get_side_id(const E_Type etype, const INT *connect, const int nsnodes, INT s } break; - case BAR2: - case BAR3: - case SHELL2: - case SHELL3: + case ElementType::BAR2: + case ElementType::BAR3: + case ElementType::SHELL2: + case ElementType::SHELL3: /* SIDE 1 */ if (side_nodes[0] == connect[0] && side_nodes[1] == connect[1]) { return 1; } break; - case QUAD4: - case QUAD8: - case QUAD9: + case ElementType::QUAD4: + case ElementType::QUAD8: + case ElementType::QUAD9: /* SIDE 1 */ if (side_nodes[0] == connect[0] && side_nodes[1] == connect[1]) { return 1; @@ -1011,10 +1015,10 @@ int get_side_id(const E_Type etype, const INT *connect, const int nsnodes, INT s break; - case TRI3: - case TRI4: - case TRI6: - case TRI7: + case ElementType::TRI3: + case ElementType::TRI4: + case ElementType::TRI6: + case ElementType::TRI7: /* SIDE 1 */ if (side_nodes[0] == connect[0] && side_nodes[1] == connect[1]) { return 1; @@ -1032,11 +1036,11 @@ int get_side_id(const E_Type etype, const INT *connect, const int nsnodes, INT s break; - case TET4: - case TET10: - case TET14: - case TET15: - case TET8: + case ElementType::TET4: + case ElementType::TET10: + case ElementType::TET14: + case ElementType::TET15: + case ElementType::TET8: /* check the # of side nodes */ if (nsnodes < 3) { return 0; @@ -1064,11 +1068,11 @@ int get_side_id(const E_Type etype, const INT *connect, const int nsnodes, INT s break; - case HEX8: - case HEX16: - case HEX20: - case HEX27: - case HEXSHELL: /* this should be the same as a HEX element */ + case ElementType::HEX8: + case ElementType::HEX16: + case ElementType::HEX20: + case ElementType::HEX27: + case ElementType::HEXSHELL: /* this should be the same as a HEX element */ /* check the # of side nodes */ if (nsnodes < 4) { return 0; @@ -1238,9 +1242,9 @@ int get_side_id(const E_Type etype, const INT *connect, const int nsnodes, INT s break; - case SHELL4: - case SHELL8: - case SHELL9: + case ElementType::SHELL4: + case ElementType::SHELL8: + case ElementType::SHELL9: /* 2D sides */ if (nsnodes == 2 || nsnodes == 3) { @@ -1283,12 +1287,12 @@ int get_side_id(const E_Type etype, const INT *connect, const int nsnodes, INT s break; - case WEDGE6: - case WEDGE12: - case WEDGE15: - case WEDGE16: - case WEDGE20: - case WEDGE21: + case ElementType::WEDGE6: + case ElementType::WEDGE12: + case ElementType::WEDGE15: + case ElementType::WEDGE16: + case ElementType::WEDGE20: + case ElementType::WEDGE21: /* quad sides */ if (nsnodes == 4 || nsnodes == 8 || nsnodes == 9) { @@ -1328,13 +1332,14 @@ int get_side_id(const E_Type etype, const INT *connect, const int nsnodes, INT s break; - case TSHELL3: - case TSHELL4: - case TSHELL6: - case TSHELL7: + case ElementType::TSHELL3: + case ElementType::TSHELL4: + case ElementType::TSHELL6: + case ElementType::TSHELL7: /* 2D sides */ - if (nsnodes == 2 || (etype == TSHELL6 && nsnodes == 3) || (etype == TSHELL7 && nsnodes == 3)) { + if (nsnodes == 2 || (etype == ElementType::TSHELL6 && nsnodes == 3) || + (etype == ElementType::TSHELL7 && nsnodes == 3)) { /* SIDE 3 */ if (side_nodes[0] == connect[0] && side_nodes[1] == connect[1]) { return 3; @@ -1365,11 +1370,11 @@ int get_side_id(const E_Type etype, const INT *connect, const int nsnodes, INT s break; - case PYRAMID5: - case PYRAMID13: - case PYRAMID14: - case PYRAMID18: - case PYRAMID19: + case ElementType::PYRAMID5: + case ElementType::PYRAMID13: + case ElementType::PYRAMID14: + case ElementType::PYRAMID18: + case ElementType::PYRAMID19: /* triangular sides */ if (nsnodes == 3 || nsnodes == 6 || nsnodes == 7) { /* SIDE 1 */ @@ -1409,7 +1414,7 @@ int get_side_id(const E_Type etype, const INT *connect, const int nsnodes, INT s break; - case SPHERE: break; + case ElementType::SPHERE: break; default: { std::string err_buff; @@ -1435,16 +1440,16 @@ int get_side_id(const E_Type etype, const INT *connect, const int nsnodes, INT s * connected to a side of a hex, there are only three nodes connecting * the two. In this case a side id can be found. *****************************************************************************/ -template int get_side_id_hex_tet(const E_Type etype, const int *connect, int nsnodes, +template int get_side_id_hex_tet(const ElementType etype, const int *connect, int nsnodes, const int side_nodes[]); -template int get_side_id_hex_tet(const E_Type etype, const int64_t *connect, int nsnodes, +template int get_side_id_hex_tet(const ElementType etype, const int64_t *connect, int nsnodes, const int64_t side_nodes[]); template -int get_side_id_hex_tet(const E_Type etype, /* The element type */ - const INT *connect, /* The element connectivity */ - int nsnodes, /* The number of side nodes */ - const INT side_nodes[]) /* The list of side node IDs */ +int get_side_id_hex_tet(const ElementType etype, /* The element type */ + const INT *connect, /* The element connectivity */ + int nsnodes, /* The number of side nodes */ + const INT side_nodes[]) /* The list of side node IDs */ { std::array loc_node_ids{}; @@ -1465,11 +1470,11 @@ int get_side_id_hex_tet(const E_Type etype, /* The element type */ } switch (etype) { - case TET4: - case TET10: - case TET8: - case TET14: - case TET15: { + case ElementType::TET4: + case ElementType::TET10: + case ElementType::TET8: + case ElementType::TET14: + case ElementType::TET15: { auto il1 = in_list(1, lcnt, Data(loc_node_ids)) >= 0; auto il2 = in_list(2, lcnt, Data(loc_node_ids)) >= 0; auto il3 = in_list(3, lcnt, Data(loc_node_ids)) >= 0; @@ -1492,10 +1497,10 @@ int get_side_id_hex_tet(const E_Type etype, /* The element type */ } } break; - case HEX8: - case HEX16: - case HEX20: - case HEX27: { + case ElementType::HEX8: + case ElementType::HEX16: + case ElementType::HEX20: + case ElementType::HEX27: { auto il1 = in_list(1, lcnt, Data(loc_node_ids)) >= 0 ? 1 : 0; auto il2 = in_list(2, lcnt, Data(loc_node_ids)) >= 0 ? 1 : 0; auto il3 = in_list(3, lcnt, Data(loc_node_ids)) >= 0 ? 1 : 0; @@ -1553,16 +1558,16 @@ int get_side_id_hex_tet(const E_Type etype, /* The element type */ * the element type, and the side id. It also returns the number of nodes * in that side. *****************************************************************************/ -template int ss_to_node_list(const E_Type etype, const int *connect, int side_num, +template int ss_to_node_list(const ElementType etype, const int *connect, int side_num, int ss_node_list[]); -template int ss_to_node_list(const E_Type etype, const int64_t *connect, int side_num, +template int ss_to_node_list(const ElementType etype, const int64_t *connect, int side_num, int64_t ss_node_list[]); template -int ss_to_node_list(const E_Type etype, /* The element type */ - const INT *connect, /* The element connectivity */ - int side_num, /* The element side number */ - INT ss_node_list[]) /* The list of side node IDs */ +int ss_to_node_list(const ElementType etype, /* The element type */ + const INT *connect, /* The element connectivity */ + int side_num, /* The element side number */ + INT ss_node_list[]) /* The list of side node IDs */ { int i = 0; @@ -1698,42 +1703,42 @@ int ss_to_node_list(const E_Type etype, /* The element type */ /* Switch over the element type. */ switch (etype) { - case BAR1D2: - case BAR1D3: + case ElementType::BAR1D2: + case ElementType::BAR1D3: ss_node_list[0] = connect[side_num]; i = 1; break; - case BAR2: - case SHELL2: + case ElementType::BAR2: + case ElementType::SHELL2: /* Bar1 has 1 side */ for (i = 0; i < 2; i++) { ss_node_list[i] = connect[(bar_table[side_num][i] - 1)]; } break; - case BAR3: - case SHELL3: + case ElementType::BAR3: + case ElementType::SHELL3: /* Bar has 1 side */ for (i = 0; i < 3; i++) { ss_node_list[i] = connect[(bar_table[side_num][i] - 1)]; } break; - case QUAD4: + case ElementType::QUAD4: for (i = 0; i < 2; i++) { ss_node_list[i] = connect[(quad_table[side_num][i] - 1)]; } break; - case QUAD8: - case QUAD9: + case ElementType::QUAD8: + case ElementType::QUAD9: for (i = 0; i < 3; i++) { ss_node_list[i] = connect[(quad_table[side_num][i] - 1)]; } break; - case SHELL4: + case ElementType::SHELL4: switch (side_num) { case 0: case 1: @@ -1754,7 +1759,7 @@ int ss_to_node_list(const E_Type etype, /* The element type */ } break; - case SHELL8: + case ElementType::SHELL8: switch (side_num) { case 0: case 1: @@ -1775,7 +1780,7 @@ int ss_to_node_list(const E_Type etype, /* The element type */ } break; - case SHELL9: + case ElementType::SHELL9: switch (side_num) { case 0: case 1: @@ -1796,22 +1801,22 @@ int ss_to_node_list(const E_Type etype, /* The element type */ } break; - case TRI3: - case TRI4: + case ElementType::TRI3: + case ElementType::TRI4: for (i = 0; i < 2; i++) { ss_node_list[i] = connect[(tri_table[side_num][i] - 1)]; } break; - case TRI6: - case TRI7: + case ElementType::TRI6: + case ElementType::TRI7: for (i = 0; i < 3; i++) { ss_node_list[i] = connect[(tri_table[side_num][i] - 1)]; } break; - case TSHELL3: - case TSHELL4: + case ElementType::TSHELL3: + case ElementType::TSHELL4: switch (side_num) { case 0: case 1: @@ -1832,8 +1837,8 @@ int ss_to_node_list(const E_Type etype, /* The element type */ } break; - case TSHELL6: - case TSHELL7: + case ElementType::TSHELL6: + case ElementType::TSHELL7: switch (side_num) { case 0: case 1: @@ -1854,13 +1859,13 @@ int ss_to_node_list(const E_Type etype, /* The element type */ } break; - case HEX8: + case ElementType::HEX8: for (i = 0; i < 4; i++) { ss_node_list[i] = connect[(hex_table[side_num][i] - 1)]; } break; - case HEX16: + case ElementType::HEX16: switch (side_num) { case 4: case 5: @@ -1877,44 +1882,44 @@ int ss_to_node_list(const E_Type etype, /* The element type */ } break; - case HEX20: + case ElementType::HEX20: for (i = 0; i < 8; i++) { ss_node_list[i] = connect[(hex_table[side_num][i] - 1)]; } break; - case HEX27: + case ElementType::HEX27: for (i = 0; i < 9; i++) { ss_node_list[i] = connect[(hex_table[side_num][i] - 1)]; } break; - case TET4: + case ElementType::TET4: for (i = 0; i < 3; i++) { ss_node_list[i] = connect[(tetra_table[side_num][i] - 1)]; } break; - case TET10: + case ElementType::TET10: for (i = 0; i < 6; i++) { ss_node_list[i] = connect[(tetra_table[side_num][i] - 1)]; } break; - case TET14: - case TET15: + case ElementType::TET14: + case ElementType::TET15: for (i = 0; i < 7; i++) { ss_node_list[i] = connect[(tetra_table[side_num][i] - 1)]; } break; - case TET8: + case ElementType::TET8: for (i = 0; i < 4; i++) { ss_node_list[i] = connect[(tetra_table[side_num][i] - 1)]; } break; - case WEDGE6: + case ElementType::WEDGE6: switch (side_num) { case 3: case 4: @@ -1931,14 +1936,14 @@ int ss_to_node_list(const E_Type etype, /* The element type */ } break; - case WEDGE12: + case ElementType::WEDGE12: for (i = 0; i < 6; i++) { ss_node_list[i] = connect[(wedge12_table[side_num][i] - 1)]; } break; - case WEDGE15: - case WEDGE16: + case ElementType::WEDGE15: + case ElementType::WEDGE16: switch (side_num) { case 3: case 4: @@ -1955,7 +1960,7 @@ int ss_to_node_list(const E_Type etype, /* The element type */ } break; - case WEDGE20: + case ElementType::WEDGE20: switch (side_num) { case 3: case 4: @@ -1972,7 +1977,7 @@ int ss_to_node_list(const E_Type etype, /* The element type */ } break; - case WEDGE21: + case ElementType::WEDGE21: switch (side_num) { case 3: case 4: @@ -1989,7 +1994,7 @@ int ss_to_node_list(const E_Type etype, /* The element type */ } break; - case HEXSHELL: + case ElementType::HEXSHELL: switch (side_num) { case 4: case 5: @@ -2006,7 +2011,7 @@ int ss_to_node_list(const E_Type etype, /* The element type */ } break; - case PYRAMID5: + case ElementType::PYRAMID5: switch (side_num) { case 4: for (i = 0; i < 4; i++) { @@ -2022,7 +2027,7 @@ int ss_to_node_list(const E_Type etype, /* The element type */ } break; - case PYRAMID13: + case ElementType::PYRAMID13: switch (side_num) { case 4: for (i = 0; i < 8; i++) { @@ -2038,7 +2043,7 @@ int ss_to_node_list(const E_Type etype, /* The element type */ } break; - case PYRAMID14: + case ElementType::PYRAMID14: switch (side_num) { case 4: for (i = 0; i < 9; i++) { @@ -2054,8 +2059,8 @@ int ss_to_node_list(const E_Type etype, /* The element type */ } break; - case PYRAMID18: - case PYRAMID19: /* Pyramid18 with mid-volume node */ + case ElementType::PYRAMID18: + case ElementType::PYRAMID19: /* Pyramid18 with mid-volume node */ switch (side_num) { case 4: for (i = 0; i < 9; i++) { @@ -2071,8 +2076,8 @@ int ss_to_node_list(const E_Type etype, /* The element type */ } break; - case SPHERE: /* SHPERE's have no side sets */ - case NULL_EL: i = 0; break; + case ElementType::SPHERE: /* SHPERE's have no side sets */ + case ElementType::NULL_EL: i = 0; break; } /* End "switch (etype)" */ @@ -2090,16 +2095,16 @@ int ss_to_node_list(const E_Type etype, /* The element type */ * given. This will be the node list of a face that is connected * to this element on this face. *****************************************************************************/ -template int get_ss_mirror(const E_Type etype, const int *ss_node_list, int side_num, +template int get_ss_mirror(const ElementType etype, const int *ss_node_list, int side_num, int mirror_node_list[]); -template int get_ss_mirror(const E_Type etype, const int64_t *ss_node_list, int side_num, +template int get_ss_mirror(const ElementType etype, const int64_t *ss_node_list, int side_num, int64_t mirror_node_list[]); template -int get_ss_mirror(const E_Type etype, /* The element type */ - const INT *ss_node_list, /* The list of side node IDs */ - int side_num, /* The element side number */ - INT mirror_node_list[] /* The list of the mirror side node IDs */ +int get_ss_mirror(const ElementType etype, /* The element type */ + const INT *ss_node_list, /* The list of side node IDs */ + int side_num, /* The element side number */ + INT mirror_node_list[] /* The list of the mirror side node IDs */ ) { int i = 0; @@ -2125,39 +2130,39 @@ int get_ss_mirror(const E_Type etype, /* The element type */ /* Switch over the element type. */ switch (etype) { - case BAR1D2: - case BAR1D3: + case ElementType::BAR1D2: + case ElementType::BAR1D3: // Side is a single node... mirror_node_list[0] = ss_node_list[0]; i = 1; break; - case BAR2: - case SHELL2: + case ElementType::BAR2: + case ElementType::SHELL2: for (i = 0; i < 2; i++) { mirror_node_list[i] = ss_node_list[line_table[i]]; } break; - case BAR3: - case SHELL3: + case ElementType::BAR3: + case ElementType::SHELL3: for (i = 0; i < 3; i++) { mirror_node_list[i] = ss_node_list[line_table[i]]; } break; - case QUAD4: + case ElementType::QUAD4: for (i = 0; i < 2; i++) { mirror_node_list[i] = ss_node_list[line_table[i]]; } break; - case QUAD8: - case QUAD9: + case ElementType::QUAD8: + case ElementType::QUAD9: for (i = 0; i < 3; i++) { mirror_node_list[i] = ss_node_list[line_table[i]]; } break; - case SHELL4: + case ElementType::SHELL4: switch (side_num) { case 1: case 2: @@ -2174,7 +2179,7 @@ int get_ss_mirror(const E_Type etype, /* The element type */ } break; - case SHELL8: + case ElementType::SHELL8: switch (side_num) { case 1: case 2: @@ -2191,7 +2196,7 @@ int get_ss_mirror(const E_Type etype, /* The element type */ } break; - case SHELL9: + case ElementType::SHELL9: switch (side_num) { case 1: case 2: @@ -2208,21 +2213,21 @@ int get_ss_mirror(const E_Type etype, /* The element type */ } break; - case TRI3: - case TRI4: + case ElementType::TRI3: + case ElementType::TRI4: for (i = 0; i < 2; i++) { mirror_node_list[i] = ss_node_list[line_table[i]]; } break; - case TRI6: - case TRI7: + case ElementType::TRI6: + case ElementType::TRI7: for (i = 0; i < 3; i++) { mirror_node_list[i] = ss_node_list[line_table[i]]; } break; - case TSHELL3: + case ElementType::TSHELL3: switch (side_num) { case 1: case 2: @@ -2239,7 +2244,7 @@ int get_ss_mirror(const E_Type etype, /* The element type */ } break; - case TSHELL4: + case ElementType::TSHELL4: switch (side_num) { case 1: case 2: @@ -2256,7 +2261,7 @@ int get_ss_mirror(const E_Type etype, /* The element type */ } break; - case TSHELL6: + case ElementType::TSHELL6: switch (side_num) { case 1: case 2: @@ -2273,7 +2278,7 @@ int get_ss_mirror(const E_Type etype, /* The element type */ } break; - case TSHELL7: + case ElementType::TSHELL7: switch (side_num) { case 1: case 2: @@ -2290,13 +2295,13 @@ int get_ss_mirror(const E_Type etype, /* The element type */ } break; - case HEX8: + case ElementType::HEX8: for (i = 0; i < 4; i++) { mirror_node_list[i] = ss_node_list[sqr_table[i]]; } break; - case HEX16: + case ElementType::HEX16: switch (side_num) { case 4: case 5: @@ -2312,44 +2317,44 @@ int get_ss_mirror(const E_Type etype, /* The element type */ } break; - case HEX27: + case ElementType::HEX27: for (i = 0; i < 9; i++) { mirror_node_list[i] = ss_node_list[sqr_table[i]]; } break; - case HEX20: + case ElementType::HEX20: for (i = 0; i < 8; i++) { mirror_node_list[i] = ss_node_list[sqr_table[i]]; } break; - case TET4: + case ElementType::TET4: for (i = 0; i < 3; i++) { mirror_node_list[i] = ss_node_list[tri_table[i]]; } break; - case TET8: + case ElementType::TET8: for (i = 0; i < 4; i++) { mirror_node_list[i] = ss_node_list[tri_table[i]]; } break; - case TET10: + case ElementType::TET10: for (i = 0; i < 6; i++) { mirror_node_list[i] = ss_node_list[tri_table[i]]; } break; - case TET14: - case TET15: + case ElementType::TET14: + case ElementType::TET15: for (i = 0; i < 7; i++) { mirror_node_list[i] = ss_node_list[tri_table[i]]; } break; - case WEDGE6: + case ElementType::WEDGE6: switch (side_num) { case 4: case 5: @@ -2366,14 +2371,14 @@ int get_ss_mirror(const E_Type etype, /* The element type */ } break; - case WEDGE12: + case ElementType::WEDGE12: for (i = 0; i < 6; i++) { mirror_node_list[i] = ss_node_list[tri_table[i]]; } break; - case WEDGE15: - case WEDGE16: + case ElementType::WEDGE15: + case ElementType::WEDGE16: switch (side_num) { case 4: case 5: @@ -2390,8 +2395,8 @@ int get_ss_mirror(const E_Type etype, /* The element type */ } break; - case WEDGE20: - case WEDGE21: + case ElementType::WEDGE20: + case ElementType::WEDGE21: switch (side_num) { case 4: case 5: @@ -2408,7 +2413,7 @@ int get_ss_mirror(const E_Type etype, /* The element type */ } break; - case HEXSHELL: + case ElementType::HEXSHELL: switch (side_num) { case 5: case 6: @@ -2425,7 +2430,7 @@ int get_ss_mirror(const E_Type etype, /* The element type */ } break; - case PYRAMID5: + case ElementType::PYRAMID5: switch (side_num) { case 5: for (i = 0; i < 4; i++) { @@ -2441,7 +2446,7 @@ int get_ss_mirror(const E_Type etype, /* The element type */ } break; - case PYRAMID13: + case ElementType::PYRAMID13: switch (side_num) { case 5: for (i = 0; i < 8; i++) { @@ -2457,7 +2462,7 @@ int get_ss_mirror(const E_Type etype, /* The element type */ } break; - case PYRAMID14: + case ElementType::PYRAMID14: switch (side_num) { case 5: for (i = 0; i < 9; i++) { @@ -2473,8 +2478,8 @@ int get_ss_mirror(const E_Type etype, /* The element type */ } break; - case PYRAMID18: - case PYRAMID19: + case ElementType::PYRAMID18: + case ElementType::PYRAMID19: switch (side_num) { case 5: for (i = 0; i < 9; i++) { @@ -2490,8 +2495,8 @@ int get_ss_mirror(const E_Type etype, /* The element type */ } break; - case SPHERE: /* SHPERE's have no side sets */ - case NULL_EL: i = 0; break; + case ElementType::SPHERE: /* SHPERE's have no side sets */ + case ElementType::NULL_EL: i = 0; break; } /* End "switch (etype)" */ diff --git a/packages/seacas/applications/nem_slice/elb_elem.h b/packages/seacas/applications/nem_slice/elb_elem.h index 77cffa69e0..8cd0cda65c 100644 --- a/packages/seacas/applications/nem_slice/elb_elem.h +++ b/packages/seacas/applications/nem_slice/elb_elem.h @@ -8,7 +8,7 @@ #pragma once /* Define element types */ -enum E_Type { +enum class ElementType { SPHERE, BAR2, BAR3, @@ -54,40 +54,40 @@ enum E_Type { NULL_EL }; -extern const char *elem_name_from_enum(E_Type elem_type); +extern const char *elem_name_from_enum(ElementType elem_type); -extern E_Type get_elem_type(const char *elem_name, /* ExodusII element name */ - int num_nodes, /* Number of nodes in the element */ - int num_dim /* Number of dimensions of the mesh */ +extern ElementType get_elem_type(const char *elem_name, /* ExodusII element name */ + int num_nodes, /* Number of nodes in the element */ + int num_dim /* Number of dimensions of the mesh */ ); -extern int get_elem_info(int info, /* The requested information */ - E_Type elem_type /* The element type */ +extern int get_elem_info(int info, /* The requested information */ + ElementType elem_type /* The element type */ ); template -int get_side_id(E_Type etype, const INT *connect, int nsnodes, INT side_nodes[], int skip_check, - int partial_adj); +int get_side_id(ElementType etype, const INT *connect, int nsnodes, INT side_nodes[], + int skip_check, int partial_adj); template -int get_side_id_hex_tet(E_Type etype, /* The element type */ - const INT *conn, /* The element connectivity */ - int nsnodes, /* The number of side nodes */ - const INT side_nodes[] /* The list of side node IDs */ +int get_side_id_hex_tet(ElementType etype, /* The element type */ + const INT *conn, /* The element connectivity */ + int nsnodes, /* The number of side nodes */ + const INT side_nodes[] /* The list of side node IDs */ ); template -int ss_to_node_list(E_Type etype, /* The element type */ - const INT *connect, /* The element connectivity */ - int side_num, /* The element side number */ - INT ss_node_list[] /* The list of side node IDs */ +int ss_to_node_list(ElementType etype, /* The element type */ + const INT *connect, /* The element connectivity */ + int side_num, /* The element side number */ + INT ss_node_list[] /* The list of side node IDs */ ); template -int get_ss_mirror(E_Type etype, /* The element type */ - const INT *ss_node_list, /* The list of side node IDs */ - int side_num, /* The element side number */ - INT mirror_node_list[] /* The list of the mirror side node IDs */ +int get_ss_mirror(ElementType etype, /* The element type */ + const INT *ss_node_list, /* The list of side node IDs */ + int side_num, /* The element side number */ + INT mirror_node_list[] /* The list of the mirror side node IDs */ ); /* Define element info requests */ @@ -104,8 +104,8 @@ int get_ss_mirror(E_Type etype, /* The element type */ */ #define MAX_ELEM_SIDES 6 -bool is_hex(E_Type etype); -bool is_tet(E_Type etype); -bool is_wedge(E_Type etype); -bool is_pyramid(E_Type etype); -bool is_3d_element(E_Type etype); +bool is_hex(ElementType etype); +bool is_tet(ElementType etype); +bool is_wedge(ElementType etype); +bool is_pyramid(ElementType etype); +bool is_3d_element(ElementType etype); diff --git a/packages/seacas/applications/nem_slice/elb_exo_util.C b/packages/seacas/applications/nem_slice/elb_exo_util.C index 3071943802..7eba778f0d 100644 --- a/packages/seacas/applications/nem_slice/elb_exo_util.C +++ b/packages/seacas/applications/nem_slice/elb_exo_util.C @@ -20,7 +20,7 @@ #include #include "elb.h" // for Weight_Description, etc -#include "elb_elem.h" // for get_elem_type, E_Type, etc +#include "elb_elem.h" // for get_elem_type, ElementType, etc #include "elb_err.h" // for Gen_Error, MAX_ERR_MSG #include "elb_exo.h" #include "elb_groups.h" // for parse_groups @@ -233,7 +233,7 @@ int read_mesh_params(const std::string &exo_file, Problem_Description *problem, sphere->end[0] = mesh->eb_cnts[cnt]; } - if (mesh->eb_type[cnt] == SPHERE && problem->no_sph != 1) { + if (mesh->eb_type[cnt] == ElementType::SPHERE && problem->no_sph != 1) { sphere->num += mesh->eb_cnts[cnt]; sphere->adjust[cnt] = 0; } diff --git a/packages/seacas/applications/nem_slice/elb_graph.C b/packages/seacas/applications/nem_slice/elb_graph.C index d5508cb0b0..477bfbe088 100644 --- a/packages/seacas/applications/nem_slice/elb_graph.C +++ b/packages/seacas/applications/nem_slice/elb_graph.C @@ -245,8 +245,8 @@ namespace { int nsides = 0; for (size_t ecnt = 0; ecnt < mesh->num_elems; ecnt++) { - E_Type etype = mesh->elem_type[ecnt]; - E_Type etype_last = NULL_EL; + ElementType etype = mesh->elem_type[ecnt]; + ElementType etype_last = ElementType::NULL_EL; if (etype != etype_last) { etype_last = etype; element_3d = is_3d_element(mesh->elem_type[ecnt]); @@ -256,7 +256,7 @@ namespace { nsides = get_elem_info(NSIDES, etype); } - if (etype != SPHERE || problem->no_sph == 1) { + if (etype != ElementType::SPHERE || problem->no_sph == 1) { graph->start[cnt] = graph->nadj; assert(graph->nadj == graph->adj.size()); @@ -287,7 +287,7 @@ namespace { /* make sure we're not checking if the element is connected to itself */ - if (ecnt != (size_t)entry && mesh->elem_type[entry] != SPHERE) { + if (ecnt != (size_t)entry && mesh->elem_type[entry] != ElementType::SPHERE) { /* If tmp_element[entry] != ecnt, then entry is not in list... */ if ((size_t)tmp_element[entry] != ecnt) { #if 0 @@ -480,7 +480,7 @@ namespace { * is connected to only an edge of a quad/tet */ - E_Type etype2 = mesh->elem_type[entry]; + ElementType etype2 = mesh->elem_type[entry]; /* make sure this is a 3d element*/ @@ -526,7 +526,7 @@ namespace { /* if this element 1 is a hexshell, then only require 4 of the 6 nodes to match between elements 1 and 2 */ - if (etype == HEXSHELL && side_cnt == 6) { + if (etype == ElementType::HEXSHELL && side_cnt == 6) { side_cnt = 4; } diff --git a/packages/seacas/applications/nem_slice/elb_loadbal.C b/packages/seacas/applications/nem_slice/elb_loadbal.C index 1648e79233..a202e23f0f 100644 --- a/packages/seacas/applications/nem_slice/elb_loadbal.C +++ b/packages/seacas/applications/nem_slice/elb_loadbal.C @@ -25,7 +25,7 @@ #include "chaco.h" // for input_assign, interface #include "elb.h" // for LB_Description, etc -#include "elb_elem.h" // for E_Type, get_elem_info, etc +#include "elb_elem.h" // for ElementType, get_elem_info, etc #include "elb_err.h" // for Gen_Error #include "elb_graph.h" // for generate_graph #include "elb_groups.h" // for get_group_info @@ -260,7 +260,7 @@ int generate_loadbal(Machine_Description *machine, Problem_Description *problem, size_t cnt = 0; for (size_t ecnt = 0; ecnt < mesh->num_elems; ecnt++) { - if (mesh->elem_type[ecnt] != SPHERE || problem->no_sph == 1) { + if (mesh->elem_type[ecnt] != ElementType::SPHERE || problem->no_sph == 1) { /* * for our purposes, the coordinate of the element will * be the average of the coordinates of the nodes that make @@ -840,7 +840,7 @@ int generate_loadbal(Machine_Description *machine, Problem_Description *problem, * First generate "holes" in the vertex2proc vector where the * sphere assignments will be. */ - if (mesh->elem_type[ecnt] == SPHERE) { + if (mesh->elem_type[ecnt] == ElementType::SPHERE) { for (size_t cnt = (problem->num_vertices); cnt > ecnt; cnt--) { lb->vertex2proc[cnt] = lb->vertex2proc[cnt - 1]; } @@ -861,7 +861,7 @@ int generate_loadbal(Machine_Description *machine, Problem_Description *problem, size_t cnt2 = 0; for (size_t ecnt = 0; ecnt < mesh->num_elems; ecnt++) { - if (mesh->elem_type[ecnt] == SPHERE) { + if (mesh->elem_type[ecnt] == ElementType::SPHERE) { lb->vertex2proc[ecnt] = iproc; cnt2++; @@ -1254,7 +1254,7 @@ namespace { size_t num_found = 0; for (size_t ecnt = 0; ecnt < mesh->num_elems; ecnt++) { - E_Type etype = mesh->elem_type[ecnt]; + ElementType etype = mesh->elem_type[ecnt]; /* need to check for volume elements */ if (is_3d_element(etype)) { @@ -1299,8 +1299,8 @@ namespace { */ for (size_t pcnt = 0; pcnt < nhold; pcnt++) { - size_t el2 = graph->sur_elem[node][pcnt]; - E_Type etype2 = mesh->elem_type[el2]; + size_t el2 = graph->sur_elem[node][pcnt]; + ElementType etype2 = mesh->elem_type[el2]; int proc2 = 0; if (check_type == Issues::LOCAL_ISSUES) { @@ -1309,11 +1309,12 @@ namespace { assert(proc2 < machine->num_procs); if (ecnt != el2 && proc == proc2) { - if (etype2 == BAR2 || etype2 == BAR3 || etype2 == SHELL2 || etype2 == SHELL3) { + if (etype2 == ElementType::BAR2 || etype2 == ElementType::BAR3 || + etype2 == ElementType::SHELL2 || etype2 == ElementType::SHELL3) { problems[node] = el2 + 1; } - else if (etype2 == SHELL4 || etype2 == SHELL8 || etype2 == TSHELL3 || - etype2 == TSHELL6) { + else if (etype2 == ElementType::SHELL4 || etype2 == ElementType::SHELL8 || + etype2 == ElementType::TSHELL3 || etype2 == ElementType::TSHELL6) { /* * look for an element connect to one of the shells faces (not edges) * one can look at elements connected to 3 of the nodes - cannot use @@ -1366,8 +1367,8 @@ namespace { for (int ncnt = 0; ncnt < nnodes; ncnt++) { size_t node = mesh->connect[ecnt][ncnt]; if (problems[node]) { - size_t el2 = problems[node] - 1; - E_Type etype2 = mesh->elem_type[el2]; + size_t el2 = problems[node] - 1; + ElementType etype2 = mesh->elem_type[el2]; if (check_type == Issues::LOCAL_ISSUES) { fmt::print("WARNING: On Processor {} Local Element {}" @@ -1432,9 +1433,9 @@ namespace { int internal = 1; int flag = 0; for (size_t ecnt = 0; ecnt < graph->sur_elem[ncnt].size(); ecnt++) { - int elem = graph->sur_elem[ncnt][ecnt]; - E_Type etype = mesh->elem_type[elem]; - int nnodes = get_elem_info(NNODES, etype); + int elem = graph->sur_elem[ncnt][ecnt]; + ElementType etype = mesh->elem_type[elem]; + int nnodes = get_elem_info(NNODES, etype); for (size_t i = 0; i < static_cast(nnodes); i++) { int proc_n = lb->vertex2proc[mesh->connect[elem][i]]; assert(proc_n < machine->num_procs); @@ -1470,8 +1471,8 @@ namespace { /* Find the internal elements */ time1 = get_time(); for (size_t ecnt = 0; ecnt < mesh->num_elems; ecnt++) { - E_Type etype = mesh->elem_type[ecnt]; - int nnodes = get_elem_info(NNODES, etype); + ElementType etype = mesh->elem_type[ecnt]; + int nnodes = get_elem_info(NNODES, etype); for (size_t ncnt = 0; ncnt < static_cast(nnodes); ncnt++) { int node = mesh->connect[ecnt][ncnt]; int proc = lb->vertex2proc[node]; @@ -1580,10 +1581,10 @@ namespace { for (size_t ecnt = 0; ecnt < mesh->num_elems; ecnt++) { int proc = lb->vertex2proc[ecnt]; assert(proc < machine->num_procs); - bool internal = true; - int flag = 0; - E_Type etype = mesh->elem_type[ecnt]; - int dim1 = get_elem_info(NDIM, etype); + bool internal = true; + int flag = 0; + ElementType etype = mesh->elem_type[ecnt]; + int dim1 = get_elem_info(NDIM, etype); /* need to check for hex's or tet's */ bool hflag1 = is_hex(etype); @@ -1627,7 +1628,8 @@ namespace { /* ignore degenerate bars */ - if (!((etype == BAR2 || etype == SHELL2) && side_nodes[0] == side_nodes[1])) { + if (!((etype == ElementType::BAR2 || etype == ElementType::SHELL2) && + side_nodes[0] == side_nodes[1])) { size_t nhold = graph->sur_elem[side_nodes[0]].size(); for (size_t ncnt = 0; ncnt < nhold; ncnt++) { @@ -1811,7 +1813,7 @@ namespace { if (proc != proc2) { - E_Type etype2 = mesh->elem_type[elem]; + ElementType etype2 = mesh->elem_type[elem]; int dim2 = get_elem_info(NDIM, etype2); @@ -1861,7 +1863,7 @@ namespace { * small kludge to handle 6 node faces butted up against * 4 node faces */ - if (etype == HEXSHELL && side_cnt == 6) { + if (etype == ElementType::HEXSHELL && side_cnt == 6) { side_cnt = 4; } diff --git a/packages/seacas/applications/nem_slice/elb_main.C b/packages/seacas/applications/nem_slice/elb_main.C index 8cca4f33d6..8dff8197d7 100644 --- a/packages/seacas/applications/nem_slice/elb_main.C +++ b/packages/seacas/applications/nem_slice/elb_main.C @@ -20,7 +20,7 @@ #include "add_to_log.h" // for add_to_log #include "elb.h" // for LB_Description, get_time, etc #include "elb_allo.h" // for array_alloc -#include "elb_elem.h" // for E_Type, ::NULL_EL +#include "elb_elem.h" // for ElementType, ::NULL_EL #include "elb_err.h" // for error_report, Gen_Error, etc #include "elb_exo.h" // for init_weight_struct, etc #include "elb_graph.h" // for generate_graph diff --git a/packages/seacas/applications/nem_slice/fix_column_partitions.C b/packages/seacas/applications/nem_slice/fix_column_partitions.C index c849818478..a5911bddfd 100644 --- a/packages/seacas/applications/nem_slice/fix_column_partitions.C +++ b/packages/seacas/applications/nem_slice/fix_column_partitions.C @@ -34,7 +34,7 @@ namespace { */ template - void find_adjacent_element(INT cur_elem, E_Type etype, int side_id, int nadj, INT const *adj, + void find_adjacent_element(INT cur_elem, ElementType etype, int side_id, int nadj, INT const *adj, Mesh_Description const *const mesh, INT *adj_elem, int *adj_side) { *adj_elem = -1; @@ -54,8 +54,8 @@ namespace { get_ss_mirror(etype, Data(side_nodes), side_id, Data(side_nodes_flipped)); for (int i = 0; i < nadj; i++) { - INT adj_elem_id = adj[i] - 1; // Adjacency graph entries start from 1 - E_Type etype2 = mesh->elem_type[adj_elem_id]; + INT adj_elem_id = adj[i] - 1; // Adjacency graph entries start from 1 + ElementType etype2 = mesh->elem_type[adj_elem_id]; // Does this side occurs in the adjacent element? @@ -113,7 +113,7 @@ int fix_column_partitions(LB_Description *lb, Mesh_Description const * continue; } - E_Type etype = mesh->elem_type[i]; + ElementType etype = mesh->elem_type[i]; // Only hexes and wedges can be stacked in columns if (!is_hex(etype) && !is_wedge(etype)) {