19 #ifndef GEOSX_FILEIO_SILO_SILOFILE_HPP_ 20 #define GEOSX_FILEIO_SILO_SILOFILE_HPP_ 23 #include "constitutive/solid/SolidBase.hpp" 24 #include "mpiCommunications/MpiWrapper.hpp" 26 #include "mesh/CellElementSubRegion.hpp" 33 struct _PMPIO_baton_t;
41 class DomainPartition;
44 namespace constitutive
46 class ConstitutiveManager;
69 void MakeSiloDirectories();
75 void Initialize(
int const numGroups=1 );
87 int groupRank(
int const i )
const;
99 void WaitForBatonWrite(
int const domainNumber,
102 bool const isRestart );
109 void WaitForBaton(
int const domainNumber,
string const & restartFileName );
130 DBMkDir( m_dbBaseFilePtr, rootdir.c_str());
134 DBMkDir( m_dbFilePtr, subdir.c_str());
158 void WriteMeshObject(
string const & meshName,
162 char const *
const ghostNodeName,
163 char const *
const ghostZoneName,
165 int const * shapecnt,
166 const localIndex *
const *
const meshConnectivity,
167 const globalIndex *
const *
const globalElementNum,
168 int const *
const shapetype,
169 int const *
const shapesize,
170 int const cycleNumber,
171 real64 const problemTime );
192 void WritePolygonMeshObject(
const std::string & meshName,
196 const int numRegions,
197 const int * shapecnt,
198 const localIndex *
const *
const meshConnectivity,
199 const globalIndex *
const *
const globalElementNum,
200 const int *
const *
const dummy2,
201 const int *
const shapetype,
202 const int *
const shapesize,
203 const int cycleNumber,
205 const int lnodelist );
217 bool const isRestart );
235 string const & meshName,
239 char const *
const ghostNodeFlag,
240 int const cycleNumber,
242 bool & writeArbitraryPolygon );
251 void WriteMeshLevel(
MeshLevel const *
const meshLevel,
254 bool const isRestart );
263 void WritePointMesh(
string const & meshName,
266 int const cycleNumber,
267 real64 const problemTime );
279 void WriteBeamMesh(
string const & meshName,
284 int const cycleNumber,
285 real64 const problemTime );
296 void WriteBeamMesh(
string const & meshName,
300 int const cycleNumber,
301 real64 const problemTime );
311 string const & meshName,
313 int const cycleNumber,
314 real64 const problemTime );
327 string const & siloDirName,
328 string const & meshname,
332 bool const isRestart,
344 string const & siloDirName,
345 string const & meshName,
348 bool const isRestart );
361 template<
typename OUTPUTTYPE >
362 void WriteWrappersToSilo(
string const & meshname,
367 bool const isRestart,
368 string const & multiRoot,
381 template<
typename OUTTYPE,
typename TYPE >
382 void WriteDataField(
string const & meshName,
383 string const & fieldName,
386 int const cycleNumber,
388 string const & multiRoot );
400 template<
typename OUTTYPE,
typename TYPE,
int USD >
401 void WriteDataField(
string const & meshName,
402 string const & fieldName,
405 int const cycleNumber,
407 string const & multiRoot );
418 template<
typename OUTTYPE,
typename TYPE,
int USD >
419 void WriteDataField(
string const & meshName,
420 string const & fieldName,
423 int const cycleNumber,
425 string const & multiRoot );
438 template<
typename OUTTYPE,
typename TYPE,
int NDIM,
int USD >
439 void WriteDataField(
string const & meshName,
440 string const & fieldName,
442 int const siloTensorRank,
444 int const cycleNumber,
446 string const & multiRoot );
460 template<
typename OUTTYPE,
typename TYPE >
461 void WriteMaterialDataField(
string const & meshName,
462 string const & fieldName,
466 int const cycleNumber,
468 string const & multiRoot,
482 template<
typename OUTTYPE,
typename TYPE >
483 void WriteMaterialDataField2d(
string const & meshName,
484 string const & fieldName,
487 int const cycleNumber,
489 string const & multiRoot,
503 template<
typename OUTTYPE,
typename TYPE >
504 void WriteMaterialDataField3d(
string const & meshName,
505 string const & fieldName,
508 int const cycleNumber,
510 string const & multiRoot,
524 template<
typename OUTTYPE,
typename TYPE >
525 void WriteMaterialDataField4d(
string const & meshName,
526 string const & fieldName,
529 int const cycleNumber,
531 string const & multiRoot,
541 void WriteMaterialVarDefinition(
string const & subDir,
542 string const & matDir,
544 string const & fieldName );
550 void WriteStressVarDefinition(
string const & MatDir );
557 void WriteVectorVarDefinition(
string const & fieldName,
558 string const & subDirectory );
565 int GetMeshType(
string const & meshName )
const;
577 template<
typename CBF >
578 void WriteMultiXXXX(
const DBObjectType type, CBF DBPutMultiCB,
579 int const centering,
string const name,
int const cycleNumber,
580 string const & multiRoot,
const DBoptlist * optlist =
nullptr );
591 void ClearEmptiesFromMultiObjects(
int const cycleNum );
599 m_numGroups = numGroups;
617 m_writeEdgeMesh = val;
626 m_writeFaceMesh = val;
635 m_writeCellElementMesh = val;
644 m_writeFaceElementMesh = val;
653 m_plotFileRoot = fileRoot;
659 DBfile * m_dbFilePtr;
662 DBfile * m_dbBaseFilePtr;
674 string m_plotFileRoot;
676 string m_restartFileRoot;
678 string const m_siloDirectory =
"siloFiles";
680 string const m_siloDataSubDirectory =
"data";
684 string m_baseFileName;
686 std::vector< std::string > m_emptyMeshes;
688 std::vector< std::string > m_emptyVariables;
692 integer m_writeCellElementMesh;
693 integer m_writeFaceElementMesh;
703 namespace SiloFileUtilities
713 template<
typename OUTTYPE >
723 template<
typename TYPE >
730 template<
typename TYPE >
740 template<
typename OUTTYPE,
typename TYPE >
741 OUTTYPE
CastField(
const TYPE & field,
int const i = 0 );
790 return LvArray::integerConversion< int >( field );
816 return LvArray::integerConversion< int >( field );
842 return static_cast< float >(field);
855 template<
typename TYPE >
void setNumGroups(int const numGroups)
Sets the number of individual Silo files to generate.
void setPlotFileRoot(string const &fileRoot)
Sets root of the filename that will be read/written.
long long int globalIndex
Global index type (for indexing objects across MPI partitions).
void setPlotLevel(int const plotLevel)
Sets the plot level option.
void MakeSubDirectory(string const &subdir, string const &rootdir)
Make a subdirectory within the silo file.
Class facilitating the representation of a multi-level discretization of a MeshBody.
The NodeManager class provides an interface to ObjectManagerBase in order to manage node data...
_PMPIO_baton_t PMPIO_baton_t
Type alias for _PMPIO_baton_t struct.
long int CastField< long int, long int >(const long int &field, int const dummy)
This class serves to provide a "view" of a multidimensional array.
long long int CastField< long long int, long long int >(const long long int &field, int const dummy)
double real64
64-bit floating point type.
int CastField< int, int >(const int &field, int const dummy)
int CastField< int, long int >(const long int &field, int const dummy)
void setWriteCellElementMesh(int const val)
Sets the cell element mesh output option.
void setWriteEdgeMesh(int const val)
Sets the edge mesh output option.
Lightweight wrapper around a c-array.
int MPI_COMM_GEOSX
Global MPI communicator used by GEOSX.
real64 CastField< real64, real64 >(const real64 &field, int const dummy)
float CastField< float, real64 >(const real64 &field, int const dummy)
PlotLevel toPlotLevel(int const val)
Function to get a PlotLevel enum from an int.
std::int32_t integer
Signed integer type.
The ElementRegionBase is the base class to manage the data stored at the element level.
#define GEOSX_UNUSED_VAR(...)
Mark an unused variable and silence compiler warnings.
void SetVariableNames(string const &fieldName, string_array &varnamestring, char const *varnames[])
std::ptrdiff_t localIndex
Local index type (for indexing objects within an MPI partition).
real64 CastField(R1Tensor const &field, int const i)
Specialization for R1Tensor.
void setWriteFaceElementMesh(int const val)
Sets the face element mesh output option.
std::string string
String type.
int CastField< int, long long int >(const long long int &field, int const dummy)
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...
int GetNumberOfVariablesInField()
void setWriteFaceMesh(int const val)
Sets the face mesh output option.