19 #ifndef GEOSX_MESHUTILITIES_INTERNALMESHGENERATOR_HPP 20 #define GEOSX_MESHUTILITIES_INTERNALMESHGENERATOR_HPP 26 #include "codingUtilities/Utilities.hpp" 32 namespace dataRepository
86 Group *
const parent );
100 virtual void GenerateElementRegions(
DomainPartition & domain )
override;
108 virtual Group * CreateChild(
string const & childKey,
string const & childName )
override;
115 virtual void GetElemToNodesRelationInBox (
const std::string & elementType,
119 const int size )
override;
127 void PostProcessInput()
override final;
170 int m_numElemsTotal[3];
185 int m_trianglePattern;
196 int m_mapToRadial = 0;
210 real64 m_skewCenter[3] = { 0, 0, 0 };
222 inline globalIndex NodeGlobalIndex(
const int index[3] )
226 rval = index[0]*(m_numElemsTotal[1]+1)*(m_numElemsTotal[2]+1) + index[1]*(m_numElemsTotal[2]+1) + index[2];
234 inline globalIndex ElemGlobalIndex(
const int index[3] )
238 rval = index[0]*m_numElemsTotal[1]*m_numElemsTotal[2] + index[1]*m_numElemsTotal[2] + index[2];
251 template<
typename OUT_VECTOR >
252 inline void getNodePosition(
int const * a,
int trianglePattern, OUT_VECTOR && X )
257 if( trianglePattern == 1 )
259 int startingIndex = 0;
262 for( block=0; block<m_nElems[0].
size(); ++block )
264 startingIndex = endingIndex;
265 endingIndex = startingIndex + m_nElems[0][block];
267 xPosIndex = endingIndex;
270 for(
int i=0; i<3; ++i )
273 int startingIndex = 0;
276 for( block=0; block<m_nElems[i].
size(); ++block )
278 startingIndex = endingIndex;
279 endingIndex = startingIndex + m_nElems[i][block];
280 if( a[i]>=startingIndex && a[i]<=endingIndex )
289 X[i] = min + (max-
min) * (
double( a[i] - startingIndex ) / m_nElems[i][block] );
293 if( m_nElemBias[i].size()>0 )
296 if( ( !isZero( m_nElemBias[i][block] ) ) && (m_nElems[i][block]>1))
298 GEOSX_ERROR_IF( fabs( m_nElemBias[i][block] ) >= 1,
"Mesh bias must between -1 and 1!" );
301 real64 xmean = len / m_nElems[i][block];
302 real64 x0 = xmean * double( a[i] - startingIndex );
303 real64 chi = m_nElemBias[i][block]/(xmean/len - 1.0);
304 real64 dx = -x0*chi + x0*x0*chi/len;
310 if( i==0 ) xInterval = (max-
min) / m_nElems[i][block];
311 if( trianglePattern == 1 && i == 1 && a[1] % 2 == 1 && a[0] != 0 && a[0] != xPosIndex )
312 X[0] -= xInterval * 0.5;
322 template<
typename OUT_VECTOR >
323 inline void getElemCenterPosition(
const int k[3], OUT_VECTOR && X )
325 for(
int i=0; i<3; ++i )
327 X[i] = m_min[i] + (m_max[i]-m_min[i]) * ( ( k[i] + 0.5 ) / m_numElemsTotal[i] );
338 bool rval = (m_mapToRadial > 0);
string const elementTypes
key for element type
long long int globalIndex
Global index type (for indexing objects across MPI partitions).
string const yCoords
key for y coordinates
INDEX_TYPE size() const noexcept
The NodeManager class provides an interface to ObjectManagerBase in order to manage node data...
string const zBias
key for z bias
string const yElems
key for number of element in y-direction
The InternalMeshGenerator class is a class handling GEOSX generated meshes.
string const xBias
key for x bias
double real64
64-bit floating point type.
string const cellBlockNames
key for cellBlock names
The MeshGeneratorBase class provides an abstract base class implementation for different mesh types...
string const zElems
key for number of elemnt in z-direction
string const zCoords
key for z coordinates
string const trianglePattern
key for triangle pattern identifier
static string CatalogName()
Return the name of the InternalMeshGenerator in object Catalog.
string const xElems
key for number of element in x-direction
bool isRadial()
Check if the mesh is a radial mesh.
std::string string
String type.
string const yBias
key for y bias
#define GEOSX_ERROR_IF(EXP, msg)
Conditionally raise a hard error and terminate the program.
constexpr std::enable_if_t< std::is_arithmetic< T >::value, T > min(T const a, T const b)
constexpr std::enable_if_t< std::is_arithmetic< T >::value, T > max(T const a, T const b)
string const xCoords
key for x coordinates
This class provides a fixed dimensional resizeable array interface in addition to an interface simila...
Partition of the decomposed physical domain. It also manages the connexion information to its neighbo...