$extrastylesheet
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::INVALID_ELEM, libMesh::invalid_uint, libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::TRI3, and libMesh::TRI6.

Referenced by libMesh::MeshCommunication::assign_global_indices(), libMesh::MeshTools::Generation::build_cube(), libMesh::PetscVector< T >::create_subvector(), libMesh::MeshCommunication::find_global_indices(), EXTERN_C_FOR_PETSC_END::indices_to_fieldsplit(), 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().

{
  switch(type)
    {
    case INVALID_ELEM:
    case QUAD4:
    case TRI3:
      {
        return i + j*(nx+1);
      }

    case QUAD8:
    case QUAD9:
    case TRI6:
      {
        return i + j*(2*nx+1);
      }

    default:
      libmesh_error_msg("ERROR: Unrecognized 2D element type.");
    }

  return libMesh::invalid_uint;
}
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 100 of file mesh_generation.C.

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

{
  switch(type)
    {
    case INVALID_ELEM:
    case HEX8:
    case PRISM6:
      {
        return i + (nx+1)*(j + k*(ny+1));
      }

    case HEX20:
    case HEX27:
    case TET4:  // TET4's are created from an initial HEX27 discretization
    case TET10: // TET10's are created from an initial HEX27 discretization
    case PYRAMID5: // PYRAMID5's are created from an initial HEX27 discretization
    case PYRAMID13:
    case PYRAMID14:
    case PRISM15:
    case PRISM18:
      {
        return i + (2*nx+1)*(j + k*(2*ny+1));
      }

    default:
      libmesh_error_msg("ERROR: Unrecognized element type.");
    }

  return libMesh::invalid_uint;
}