libMesh
Classes | Functions
libMesh::MeshTools::Generation::Private Namespace Reference

Classes

class  GaussLobattoRedistributionFunction
 This object is passed to MeshTools::Modification::redistribute() to redistribute the points on a uniform grid into the Gauss-Lobatto points on the actual grid. More...
 

Functions

unsigned int idx (const ElemType type, const unsigned int nx, const unsigned int i, const unsigned int j)
 A useful inline function which replaces the macros used previously. More...
 
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

◆ idx() [1/2]

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 macros 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 72 of file mesh_generation.C.

76 {
77  switch(type)
78  {
79  case INVALID_ELEM:
80  case QUAD4:
81  case TRI3:
82  {
83  return i + j*(nx+1);
84  }
85 
86  case QUAD8:
87  case QUAD9:
88  case TRI6:
89  {
90  return i + j*(2*nx+1);
91  }
92 
93  default:
94  libmesh_error_msg("ERROR: Unrecognized 2D element type.");
95  }
96 
97  return libMesh::invalid_uint;
98 }

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< libMesh::Number >::create_subvector(), libMesh::DofObject::debug_buffer(), libMesh::MeshCommunication::find_global_indices(), libMesh::VectorOfNodesAdaptor::kdtree_get_pt(), libMesh::InverseDistanceInterpolation< KDDim >::PointListAdaptor< KDDim >::kdtree_get_pt(), libMesh::DofMap::local_variable_indices(), libMesh::PetscVector< libMesh::Number >::localize(), libMesh::SparsityPattern::Build::operator()(), GETPOT_NAMESPACE::GetPot::operator[](), libMesh::Nemesis_IO::read(), libMesh::XdrIO::read_serialized_bcs_helper(), libMesh::System::read_serialized_blocked_dof_objects(), libMesh::XdrIO::read_serialized_nodes(), libMesh::XdrIO::read_serialized_nodesets(), libMesh::BoundaryVolumeSolutionTransfer::transfer_volume_boundary(), libMesh::MEDITIO::write_ascii(), libMesh::GMVIO::write_ascii_old_impl(), libMesh::ExodusII_IO::write_nodal_data(), libMesh::XdrIO::write_serialized_bcs_helper(), libMesh::System::write_serialized_blocked_dof_objects(), libMesh::XdrIO::write_serialized_nodes(), libMesh::XdrIO::write_serialized_nodesets(), and libMesh::UCDIO::write_soln().

◆ idx() [2/2]

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 104 of file mesh_generation.C.

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

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.

libMesh::HEX20
Definition: enum_elem_type.h:48
libMesh::PRISM6
Definition: enum_elem_type.h:50
libMesh::invalid_uint
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value.
Definition: libmesh.h:249
libMesh::HEX8
Definition: enum_elem_type.h:47
libMesh::TET10
Definition: enum_elem_type.h:46
libMesh::TET4
Definition: enum_elem_type.h:45
libMesh::PRISM15
Definition: enum_elem_type.h:51
libMesh::HEX27
Definition: enum_elem_type.h:49
libMesh::QUAD4
Definition: enum_elem_type.h:41
libMesh::TRI3
Definition: enum_elem_type.h:39
libMesh::TRI6
Definition: enum_elem_type.h:40
libMesh::INVALID_ELEM
Definition: enum_elem_type.h:75
libMesh::PYRAMID5
Definition: enum_elem_type.h:53
libMesh::QUAD9
Definition: enum_elem_type.h:43
libMesh::PRISM18
Definition: enum_elem_type.h:52
libMesh::PYRAMID13
Definition: enum_elem_type.h:54
libMesh::PYRAMID14
Definition: enum_elem_type.h:55
libMesh::QUAD8
Definition: enum_elem_type.h:42