20 #ifndef GEOS_FILEIO_SILO_SILOFILE_HPP_
21 #define GEOS_FILEIO_SILO_SILOFILE_HPP_
24 #include "constitutive/solid/SolidBase.hpp"
27 #include "mesh/CellElementSubRegion.hpp"
34 struct _PMPIO_baton_t;
42 class DomainPartition;
45 namespace constitutive
47 class ConstitutiveManager;
103 bool const isRestart );
110 void waitForBaton(
int const domainNumber,
string const & restartFileName );
131 DBMkDir( m_dbBaseFilePtr, rootdir.c_str());
135 DBMkDir( m_dbFilePtr, subdir.c_str());
163 char const *
const ghostNodeName,
164 char const *
const ghostZoneName,
166 int const * shapecnt,
167 const localIndex *
const *
const meshConnectivity,
168 const globalIndex *
const *
const globalElementNum,
169 int const *
const shapetype,
170 int const *
const shapesize,
171 int const cycleNumber,
172 real64 const problemTime );
197 const int numRegions,
198 const int * shapecnt,
199 const localIndex *
const *
const meshConnectivity,
200 const globalIndex *
const *
const globalElementNum,
201 const int *
const *
const dummy2,
202 const int *
const shapetype,
203 const int *
const shapesize,
204 const int cycleNumber,
206 const int lnodelist );
218 bool const isRestart );
236 string const & meshName,
240 char const *
const ghostNodeFlag,
241 int const cycleNumber,
243 bool & writeArbitraryPolygon );
255 bool const isRestart );
267 int const cycleNumber,
268 real64 const problemTime );
285 int const cycleNumber,
286 real64 const problemTime );
301 int const cycleNumber,
302 real64 const problemTime );
312 string const & meshName,
314 int const cycleNumber,
315 real64 const problemTime );
328 string const & siloDirName,
329 string const & meshname,
333 bool const isRestart,
345 string const & siloDirName,
346 string const & meshName,
349 bool const isRestart );
362 template<
typename OUTPUTTYPE >
368 bool const isRestart,
369 string const & multiRoot,
382 template<
typename OUTTYPE,
typename TYPE >
384 string const & fieldName,
387 int const cycleNumber,
389 string const & multiRoot );
401 template<
typename OUTTYPE,
typename TYPE,
int USD >
403 string const & fieldName,
406 int const cycleNumber,
408 string const & multiRoot );
419 template<
typename OUTTYPE,
typename TYPE,
int USD >
421 string const & fieldName,
424 int const cycleNumber,
426 string const & multiRoot );
439 template<
typename OUTTYPE,
typename TYPE,
int NDIM,
int USD >
441 string const & fieldName,
443 int const siloTensorRank,
445 int const cycleNumber,
447 string const & multiRoot );
461 template<
typename OUTTYPE,
typename TYPE >
463 string const & fieldName,
467 int const cycleNumber,
469 string const & multiRoot,
483 template<
typename OUTTYPE,
typename TYPE >
485 string const & fieldName,
488 int const cycleNumber,
490 string const & multiRoot,
504 template<
typename OUTTYPE,
typename TYPE >
506 string const & fieldName,
509 int const cycleNumber,
511 string const & multiRoot,
525 template<
typename OUTTYPE,
typename TYPE >
527 string const & fieldName,
530 int const cycleNumber,
532 string const & multiRoot,
543 string const & matDir,
545 string const & fieldName );
559 string const & subDirectory );
578 template<
typename CBF >
580 int const centering,
string const name,
int const cycleNumber,
581 string const & multiRoot,
const DBoptlist * optlist =
nullptr );
600 m_numGroups = numGroups;
618 m_writeEdgeMesh = val;
627 m_writeFaceMesh = val;
636 m_writeCellElementMesh = val;
645 m_writeFaceElementMesh = val;
654 m_plotFileRoot = fileRoot;
663 m_siloDirectory =
joinPath( path,
"siloFiles" );
672 m_onlyPlotSpecifiedFieldNames = onlyPlotSpecifiedFieldNames;
681 m_fieldNames.insert( fieldNames.begin(), fieldNames.end() );
694 DBfile * m_dbFilePtr;
697 DBfile * m_dbBaseFilePtr;
709 string m_plotFileRoot;
711 string m_restartFileRoot;
713 string m_siloDirectory;
715 string const m_siloDataSubDirectory =
"data";
719 string m_baseFileName;
721 std::vector< string > m_emptyMeshes;
723 std::vector< string > m_emptyVariables;
727 integer m_writeCellElementMesh;
728 integer m_writeFaceElementMesh;
733 integer m_onlyPlotSpecifiedFieldNames;
736 bool m_requireFieldRegistrationCheck;
739 std::set< string > m_fieldNames;
748 namespace siloFileUtilities
758 template<
typename OUTTYPE >
768 template<
typename TYPE >
775 template<
typename TYPE >
785 template<
typename OUTTYPE,
typename TYPE >
786 OUTTYPE
CastField(
const TYPE & field,
int const i = 0 );
835 return LvArray::integerConversion< int >( field );
861 return LvArray::integerConversion< int >( field );
887 return static_cast< float >(field);
900 template<
typename TYPE >
#define GEOS_UNUSED_VAR(...)
Mark an unused variable and silence compiler warnings.
_PMPIO_baton_t PMPIO_baton_t
Type alias for _PMPIO_baton_t struct.
Partition of the decomposed physical domain. It also manages the connexion information to its neighbo...
The ElementRegionBase is the base class to manage the data stored at the element level.
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.
void clearEmptiesFromMultiObjects(int const cycleNum)
void writeMaterialDataField4d(string const &meshName, string const &fieldName, ElementRegionBase const &elemRegion, int const centering, int const cycleNumber, real64 const problemTime, string const &multiRoot, string_array const &materialNames)
void setNumGroups(int const numGroups)
Sets the number of individual Silo files to generate.
void writeDomainPartition(DomainPartition const &domain, int const cycleNum, real64 const problemTime, bool const isRestart)
write a domain parititon out to silo file
void writeDataField(string const &meshName, string const &fieldName, arrayView2d< TYPE const, USD > const &field, int const centering, int const cycleNumber, real64 const problemTime, string const &multiRoot)
void writeDataField(string const &meshName, string const &fieldName, ArrayView< TYPE const, NDIM, USD > const &field, int const siloTensorRank, int const centering, int const cycleNumber, real64 const problemTime, string const &multiRoot)
void writeWrappersToSilo(string const &meshname, const dataRepository::Group::wrapperMap &wrappers, int const centering, int const cycleNum, real64 const problemTime, bool const isRestart, string const &multiRoot, const localIndex_array &mask)
void makeSiloDirectories()
function to setup directories where silo files will be written
void writeMaterialVarDefinition(string const &subDir, string const &matDir, localIndex const matIndex, string const &fieldName)
void writeStressVarDefinition(string const &MatDir)
void writeMaterialDataField(string const &meshName, string const &fieldName, array1d< array1d< arrayView2d< TYPE const > > > const &field, ElementRegionBase const &elemRegion, int const centering, int const cycleNumber, real64 const problemTime, string const &multiRoot, string_array const &materialNames)
int getMeshType(string const &meshName) const
void setOutputDirectory(string const &path)
Sets the top-level output directory, under which Silo's output dir is nested.
void writeBeamMesh(string const &meshName, const localIndex nnodes, real64 *coords[3], const localIndex_array &node1, const localIndex_array &node2, int const cycleNumber, real64 const problemTime)
write a beam mesh to silo file
void writeDataField(string const &meshName, string const &fieldName, arrayView3d< TYPE const, USD > const &field, int const centering, int const cycleNumber, real64 const problemTime, string const &multiRoot)
void setPlotFileRoot(string const &fileRoot)
Sets root of the filename that will be read/written.
void waitForBatonWrite(int const domainNumber, int const cycleNum, integer const eventCounter, bool const isRestart)
Wait for the Baton when writing using PMPIO.
SiloFile()
Default Constructor.
void finish()
finishes/closes up the silo interface
void setWriteCellElementMesh(int const val)
Sets the cell element mesh output option.
void waitForBaton(int const domainNumber, string const &restartFileName)
Wait for the Baton when reading using PMPIO.
void setPlotLevel(int const plotLevel)
Sets the plot level option.
void writeMeshObject(string const &meshName, const localIndex nnodes, real64 *coords[3], const globalIndex *globalNodeNum, char const *const ghostNodeName, char const *const ghostZoneName, int const numShapes, int const *shapecnt, const localIndex *const *const meshConnectivity, const globalIndex *const *const globalElementNum, int const *const shapetype, int const *const shapesize, int const cycleNumber, real64 const problemTime)
Write out a single silo mesh object.
void writeMeshLevel(MeshLevel const &meshLevel, int const cycleNum, real64 const problemTime, bool const isRestart)
write a mesh level out to the silo file
void setWriteEdgeMesh(int const val)
Sets the edge mesh output option.
void makeSubDirectory(string const &subdir, string const &rootdir)
Make a subdirectory within the silo file.
int groupRank(int const i) const
obtain the group number of the calling processor, indexed from zero.
void setWriteFaceElementMesh(int const val)
Sets the face element mesh output option.
void setOnlyPlotSpecifiedFieldNamesFlag(integer const onlyPlotSpecifiedFieldNames)
Set the flag to decide whether we only plot the fields specified by fieldNames, or if we also plot fi...
void writePolygonMeshObject(const string &meshName, const localIndex nnodes, real64 *coords[3], const globalIndex *dummy1, const int numRegions, const int *shapecnt, const localIndex *const *const meshConnectivity, const globalIndex *const *const globalElementNum, const int *const *const dummy2, const int *const shapetype, const int *const shapesize, const int cycleNumber, const real64 problemTime, const int lnodelist)
void writeGroupSilo(dataRepository::Group const &group, string const &siloDirName, string const &meshname, int const centering, int const cycleNum, real64 const problemTime, bool const isRestart, const localIndex_array &mask)
void writeBeamMesh(string const &meshName, const localIndex nnodes, real64 *coords[3], integer_array &nodelist, int const cycleNumber, real64 const problemTime)
void setFieldNames(arrayView1d< string const > const &fieldNames)
Set the names of the fields to output.
void setWriteFaceMesh(int const val)
Sets the face mesh output option.
void writePointMesh(string const &meshName, const localIndex numPoints, real64 *coords[3], int const cycleNumber, real64 const problemTime)
void initialize(int const numGroups=1)
Initializes silo for input/output.
void writeElementRegionSilo(ElementRegionBase const &elemRegion, string const &siloDirName, string const &meshName, int const cycleNum, real64 const problemTime, bool const isRestart)
void writeElementMesh(ElementRegionBase const &elementRegion, NodeManager const &nodeManager, string const &meshName, const localIndex nnodes, real64 *coords[3], globalIndex const *const globalNodeNum, char const *const ghostNodeFlag, int const cycleNumber, real64 const problemTime, bool &writeArbitraryPolygon)
void writeMultiXXXX(const DBObjectType type, CBF DBPutMultiCB, int const centering, string const name, int const cycleNumber, string const &multiRoot, const DBoptlist *optlist=nullptr)
void handOffBaton()
Hand off the Baton when done writing to file.
void writeVectorVarDefinition(string const &fieldName, string const &subDirectory)
void writeMaterialDataField2d(string const &meshName, string const &fieldName, ElementRegionBase const &elemRegion, int const centering, int const cycleNumber, real64 const problemTime, string const &multiRoot, string_array const &materialNames)
void writeDataField(string const &meshName, string const &fieldName, arrayView1d< TYPE const > const &field, int const centering, int const cycleNumber, real64 const problemTime, string const &multiRoot)
void writeMaterialMapsFullStorage(ElementRegionBase const &elementRegion, string const &meshName, string_array const ®ionMaterialList, int const cycleNumber, real64 const problemTime)
void writeMaterialDataField3d(string const &meshName, string const &fieldName, ElementRegionBase const &elemRegion, int const centering, int const cycleNumber, real64 const problemTime, string const &multiRoot, string_array const &materialNames)
virtual ~SiloFile()
Destructor.
Base class for all wrappers containing common operations.
PlotLevel toPlotLevel(int const val)
Function to get a PlotLevel enum from an int.
long long int CastField< long long int, long long int >(const long long int &field, int const dummy)
float CastField< float, real64 >(const real64 &field, int const dummy)
int CastField< int, long int >(const long int &field, int const dummy)
int GetNumberOfVariablesInField()
int CastField< int, long long int >(const long long int &field, int const dummy)
real64 CastField< real64, real64 >(const real64 &field, int const dummy)
OUTTYPE CastField(const TYPE &field, int const i=0)
void SetVariableNames(string const &fieldName, string_array &varnamestring, char const *varnames[])
int CastField< int, int >(const int &field, int const dummy)
long int CastField< long int, long int >(const long int &field, int const dummy)
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
array1d< localIndex > localIndex_array
A 1-dimensional array of geos::localIndex types.
int MPI_COMM_GEOS
Global MPI communicator used by GEOSX.
GEOS_GLOBALINDEX_TYPE globalIndex
Global index type (for indexing objects across MPI partitions).
array1d< string > string_array
A 1-dimensional array of geos::string types.
array1d< integer > integer_array
A 1-dimensional array of geos::integer types.
double real64
64-bit floating point type.
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
std::int32_t integer
Signed integer type.
std::string joinPath(ARGS const &... args)
Join parts of a path.
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.
Array< T, 1 > array1d
Alias for 1D array.
LvArray::ArrayView< T, NDIM, USD, localIndex, LvArray::ChaiBuffer > ArrayView
Multidimensional array view type. See LvArray:ArrayView for details.
ArrayView< T, 3, USD > arrayView3d
Alias for 3D array view.