| 1 |
// Copyright(C) 1999-2021 National Technology & Engineering Solutions |
| 2 |
// of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with |
| 3 |
// NTESS, the U.S. Government retains certain rights in this software. |
| 4 |
// |
| 5 |
// See packages/seacas/LICENSE for details |
| 6 |
|
| 7 |
#ifndef __CATALYST_MANAGER_BASE_H |
| 8 |
#define __CATALYST_MANAGER_BASE_H |
| 9 |
|
| 10 |
#ifndef __CATALYST_PLUGIN_BUILD |
| 11 |
#include "iovs_export.h" |
| 12 |
#else |
| 13 |
#define IOVS_EXPORT |
| 14 |
#endif |
| 15 |
|
| 16 |
#include "visualization/cgns/CatalystCGNSMeshBase.h" |
| 17 |
#include "visualization/exodus/CatalystExodusMeshBase.h" |
| 18 |
#include <memory> |
| 19 |
#include <string> |
| 20 |
#include <vector> |
| 21 |
|
| 22 |
namespace Iovs { |
| 23 |
|
| 24 |
class IOVS_EXPORT CatalystManagerBase |
| 25 |
{ |
| 26 |
|
| 27 |
public: |
| 28 |
CatalystManagerBase() {}; |
| 29 |
virtual ~CatalystManagerBase() {}; |
| 30 |
|
| 31 |
struct ParseResult |
| 32 |
{ |
| 33 |
std::string jsonParseResult = ""; |
| 34 |
bool parseFailed = true; |
| 35 |
}; |
| 36 |
|
| 37 |
virtual void parsePhactoriFile(const std::string &filepath, ParseResult &pres) = 0; |
| 38 |
|
| 39 |
virtual void parsePhactoriString(const std::string &phactori, ParseResult &pres) = 0; |
| 40 |
|
| 41 |
virtual int getCatalystOutputIDNumber() = 0; |
| 42 |
|
| 43 |
virtual std::string getCatalystPluginVersion() = 0; |
| 44 |
|
| 45 |
// Parameters: |
| 46 |
// cataystPythonFilename - Python file with instructions for Catalyst. |
| 47 |
// restartTag - if not empty, contains the current restart iteration string, ie s0001 |
| 48 |
// enableLogging - turn on logging in the adapter. Default is off. |
| 49 |
// debugLevel - enable catalyst debug output 0, 1, 2. Default is 0. |
| 50 |
// resultsOutputFilename - filename associated with the Ioss results output block. |
| 51 |
// catalystOutputDirectory - name of the output directory for storing Catalyst output. |
| 52 |
// Default is CatalystOutput. |
| 53 |
// catalystData - string data vector for development and debugging. |
| 54 |
struct CatalystMeshInit |
| 55 |
{ |
| 56 |
std::string catalystPythonFilename; |
| 57 |
std::string catalystBlockJSON; |
| 58 |
std::string catalystSeparatorCharacter; |
| 59 |
std::string catalystInputDeckName; |
| 60 |
std::string restartTag; |
| 61 |
bool enableLogging; |
| 62 |
int debugLevel; |
| 63 |
bool writeCatalystMeshOneFile; |
| 64 |
std::string catalystMeshOneFilePrefix; |
| 65 |
bool writeCatalystMeshFilePerProc; |
| 66 |
std::string catalystMeshFilePerProcPrefix; |
| 67 |
std::string resultsOutputFilename; |
| 68 |
std::string catalystOutputDirectory; |
| 69 |
std::vector<std::string> catalystData; |
| 70 |
std::string catalystInputName; |
| 71 |
std::string catalystMultiInputPipelineName; |
| 72 |
bool enableCatalystMultiInputPipeline; |
| 73 |
}; |
| 74 |
|
| 75 |
virtual std::unique_ptr<Iovs_cgns::CatalystCGNSMeshBase> |
| 76 |
createCatalystCGNSMesh(CatalystMeshInit &cmInit) = 0; |
| 77 |
|
| 78 |
// Parameters: |
| 79 |
// underscoreVectors - joined vector variable names end in an underscore. |
| 80 |
// applyDisplacements - a nodal variable named DISPL or displ is applied to |
| 81 |
// the mesh node coordinates each time-step. |
| 82 |
struct CatalystExodusMeshInit : CatalystMeshInit |
| 83 |
{ |
| 84 |
bool underScoreVectors; |
| 85 |
bool applyDisplacements; |
| 86 |
}; |
| 87 |
|
| 88 |
virtual std::unique_ptr<Iovs_exodus::CatalystExodusMeshBase> |
| 89 |
createCatalystExodusMesh(CatalystExodusMeshInit &cmInit) = 0; |
| 90 |
}; |
| 91 |
|
| 92 |
} // namespace Iovs |
| 93 |
|
| 94 |
#endif // __CATALYST_MANAGER_BASE_H |