libMesh::MeshTools::Generation::Private Namespace Reference

Functions

unsigned int idx (const ElemType type, const unsigned int nx, const unsigned int i, const unsigned int j)
 
unsigned int idx (const ElemType type, const unsigned int nx, const unsigned int ny, const unsigned int i, const unsigned int j, const unsigned int k)
 

Function Documentation

unsigned int libMesh::MeshTools::Generation::Private::idx ( const ElemType  type,
const unsigned int  nx,
const unsigned int  i,
const unsigned int  j 
)
inline

A useful inline function which replaces the #defines used previously. Not private since this is a namespace, but would be if this were a class. The first one returns the proper node number for 2D elements while the second one returns the node number for 3D elements.

Definition at line 68 of file mesh_generation.C.

References libMesh::err, libMeshEnums::INVALID_ELEM, libMesh::invalid_uint, libMeshEnums::QUAD4, libMeshEnums::QUAD8, libMeshEnums::QUAD9, libMeshEnums::TRI3, and libMeshEnums::TRI6.

Referenced by libMesh::MeshCommunication::assign_global_indices(), libMesh::MeshTools::Generation::build_cube(), libMesh::PetscVector< T >::create_subvector(), libMesh::MeshCommunication::find_global_indices(), libMesh::PetscVector< T >::localize(), GETPOT_NAMESPACE::GetPot::operator[](), libMesh::Nemesis_IO::read(), libMesh::LegacyXdrIO::read_mesh(), libMesh::XdrIO::read_serialized_bcs(), libMesh::System::read_serialized_blocked_dof_objects(), libMesh::XdrIO::read_serialized_nodes(), libMesh::XdrIO::read_serialized_nodesets(), libMesh::MEDITIO::write_ascii(), libMesh::LegacyXdrIO::write_mesh(), libMesh::XdrIO::write_serialized_bcs(), libMesh::System::write_serialized_blocked_dof_objects(), libMesh::XdrIO::write_serialized_nodes(), libMesh::XdrIO::write_serialized_nodesets(), and libMesh::UCDIO::write_soln().

72  {
73  switch(type)
74  {
75  case INVALID_ELEM:
76  case QUAD4:
77  case TRI3:
78  {
79  return i + j*(nx+1);
80  break;
81  }
82 
83  case QUAD8:
84  case QUAD9:
85  case TRI6:
86  {
87  return i + j*(2*nx+1);
88  break;
89  }
90 
91  default:
92  {
93  libMesh::err << "ERROR: Unrecognized 2D element type." << std::endl;
94  libmesh_error();
95  }
96  }
97 
98  return libMesh::invalid_uint;
99  }
unsigned int libMesh::MeshTools::Generation::Private::idx ( const ElemType  type,
const unsigned int  nx,
const unsigned int  ny,
const unsigned int  i,
const unsigned int  j,
const unsigned int  k 
)
inline

Definition at line 105 of file mesh_generation.C.

References libMesh::err, libMeshEnums::HEX20, libMeshEnums::HEX27, libMeshEnums::HEX8, libMeshEnums::INVALID_ELEM, libMesh::invalid_uint, libMeshEnums::PRISM15, libMeshEnums::PRISM18, libMeshEnums::PRISM6, libMeshEnums::PYRAMID14, libMeshEnums::PYRAMID5, libMeshEnums::TET10, and libMeshEnums::TET4.

111  {
112  switch(type)
113  {
114  case INVALID_ELEM:
115  case HEX8:
116  case PRISM6:
117  {
118  return i + (nx+1)*(j + k*(ny+1));
119  break;
120  }
121 
122  case HEX20:
123  case HEX27:
124  case TET4: // TET4's are created from an initial HEX27 discretization
125  case TET10: // TET10's are created from an initial HEX27 discretization
126  case PYRAMID5: // PYRAMID5's are created from an initial HEX27 discretization
127  case PYRAMID14:
128  case PRISM15:
129  case PRISM18:
130  {
131  return i + (2*nx+1)*(j + k*(2*ny+1));
132  break;
133  }
134 
135  default:
136  {
137  libMesh::err << "ERROR: Unrecognized element type." << std::endl;
138  libmesh_error();
139  }
140  }
141 
142  return libMesh::invalid_uint;
143  }

Site Created By: libMesh Developers
Last modified: February 07 2014 16:57:33 UTC

Hosted By:
SourceForge.net Logo