Context class for MOAB-TempestRemap tool configuration and state management. More...
Collaboration diagram for ToolContext:Public Member Functions | |
| ToolContext (moab::Core *icore) | |
| Construct a new ToolContext object with MPI support. More... | |
| ~ToolContext ()=default | |
| ToolContext (const ToolContext &)=delete | |
| ToolContext & | operator= (const ToolContext &)=delete |
| ToolContext (ToolContext &&)=delete | |
| ToolContext & | operator= (ToolContext &&)=delete |
| void | timer_push (const std::string &operation) |
| Start timing an operation. More... | |
| void | timer_pop () |
| Stop timing and log the operation duration. More... | |
| moab::ErrorCode | ParseCLOptions (int argc, char **argv) |
| Parse command line arguments. More... | |
| std::string | get_file_read_options (const std::string &filename) |
| Get the appropriate MOAB read options based on file extension and parallel configuration. More... | |
Public Attributes | |
| moab::Core *const | mbcore |
| MOAB Core instance for mesh operations. More... | |
| const int | proc_id |
| MPI process rank (0 for serial) More... | |
| const int | n_procs |
| Total number of MPI processes (1 for serial) More... | |
| moab::DebugOutput | outputFormatter |
| Formatter for debug output. More... | |
| moab::TempestRemapper::TempestMeshType | meshType { moab::TempestRemapper::DEFAULT } |
| Type of mesh to generate. More... | |
| std::vector< std::string > | inFilenames |
| Input filenames for source and target meshes. More... | |
| std::vector< int > | disc_orders |
| Discretization orders for source and target. More... | |
| std::vector< std::string > | disc_methods |
| Discretization methods (fv, cgll, dgll) for source and target. More... | |
| std::vector< std::string > | doftag_names |
| Degree of freedom tag names for source and target. More... | |
| std::string | outFilename { "outputFile.nc" } |
| Output filename for remapping results. More... | |
| std::string | intxFilename |
| Intersection mesh filename (optional) More... | |
| std::string | baselineFile |
| Baseline file for verification (optional) More... | |
| std::string | variableToVerify |
| Variable name for verification (optional) More... | |
| std::string | fvMethod { "none" } |
| Finite volume method specification. More... | |
| GenerateOfflineMapAlgorithmOptions | mapOptions |
| Configuration for offline map generation. More... | |
| moab::TempestOnlineMap::CAASType | cassType |
| Conservative and accurate advection scheme type. More... | |
| int | ensureMonotonicity { 0 } |
| Monotonicity enforcement level (0=none, 1=basic, 2=full, 3=strict) More... | |
| bool | rrmGrids { false } |
| Flag to use RRM (Regional Refinement Meshes) More... | |
| bool | kdtreeSearch { true } |
| Enable KD-tree for spatial searches. More... | |
| bool | fCheck { false } |
| Enable additional checking during remapping. More... | |
| bool | fVolumetric { false } |
| Enable volumetric (3D) remapping. More... | |
| bool | useGnomonicProjection { false } |
| Use gnomonic projection for certain operations. More... | |
| bool | print_diagnostics { false } |
| Print detailed diagnostic information. More... | |
| bool | skip_intersection { false } |
| Skip intersection computation (for debugging) More... | |
| double | boxeps { 1e-7 } |
| Epsilon for bounding box checks. More... | |
| double | epsrel { ReferenceTolerance } |
| Relative tolerance for convergence. More... | |
| bool | skip_io { false } |
| Skip file I/O operations (for testing) More... | |
| bool | computeDual { false } |
| Compute dual mesh. More... | |
| bool | computeWeights { false } |
| Compute interpolation weights. More... | |
| bool | verifyConservation { false } |
| Verify conservation properties. More... | |
| bool | verifyWeights { false } |
| Verify interpolation weights. More... | |
| bool | enforceConvexity { false } |
| Enforce convexity in mesh elements. More... | |
| std::unique_ptr< moab::CpuTimer > | timer |
| Timer for performance measurement. More... | |
| double | timer_ops { 0.0 } |
| Operation timer value. More... | |
| std::string | opName |
| Name of current operation being timed. More... | |
| int | nlayers { 0 } |
| Number of ghost layers for parallel operations. More... | |
| int | blockSize { 5 } |
| Block size for vectorized operations. More... | |
| std::vector< Mesh * > | meshes |
| Collection of TempestRemap meshes. More... | |
| std::vector< moab::EntityHandle > | meshsets |
| MOAB entity sets for meshes. More... | |
Private Member Functions | |
| void | printHelp (const char *progName) const |
| Print detailed help message with usage examples. More... | |
| std::string | getMeshTypeName () const |
| Get mesh type as string. More... | |
| void | processMeshOptions (ProgOptions &opts) |
| Process mesh options from command line. More... | |
| void | printRuntimeParameters () const |
| Print all runtime parameters in a formatted way. More... | |
| void | configureMapOptions (int nlayer_input) |
| Configure map options based on command line parameters. More... | |
Context class for MOAB-TempestRemap tool configuration and state management.
Definition at line 95 of file mbtempest.cpp.
|
inlineexplicit |
Construct a new ToolContext object with MPI support.
| icore | MOAB Core instance (must not be null) |
| p_pcomm | Parallel communicator (must not be null in MPI mode) |
| std::invalid_argument | if icore is null or p_pcomm is null in MPI mode |
Construct a new ToolContext object (serial version)
| icore | MOAB Core instance (must not be null) |
| std::invalid_argument | if icore is null |
Definition at line 172 of file mbtempest.cpp.
References disc_methods, disc_orders, doftag_names, inFilenames, mapOptions, outputFormatter, moab::DebugOutput::set_prefix(), and timer.
Referenced by main().
|
default |
|
delete |
|
delete |
|
inlineprivate |
Configure map options based on command line parameters.
| nlayer_input | Number of ghost layers |
Definition at line 837 of file mbtempest.cpp.
References ensureMonotonicity, fCheck, fvMethod, fVolumetric, nlayers, outFilename, and skip_intersection.
Referenced by ParseCLOptions().
|
inline |
Get the appropriate MOAB read options based on file extension and parallel configuration.
| ctx | Tool context containing parallel information |
| filename | Input filename to determine read options |
Definition at line 489 of file mbtempest.cpp.
References n_procs, ncFile, and proc_id.
Referenced by anonymous_namespace{mbtempest.cpp}::handleOverlapMOAB().
|
inlineprivate |
Get mesh type as string.
Definition at line 646 of file mbtempest.cpp.
References moab::TempestRemapper::CS, moab::TempestRemapper::ICO, meshType, moab::TempestRemapper::OVERLAP_FILES, moab::TempestRemapper::OVERLAP_MEMORY, moab::TempestRemapper::OVERLAP_MOAB, and moab::TempestRemapper::RLL.
Referenced by printRuntimeParameters().
|
delete |
|
delete |
|
inline |
Parse command line arguments.
| argc | Argument count |
| argv | Argument values |
| std::invalid_argument | for invalid command line arguments |
Definition at line 242 of file mbtempest.cpp.
References ProgOptions::addOpt(), baselineFile, blockSize, boxeps, moab::TempestOnlineMap::CAAS_GLOBAL, moab::TempestOnlineMap::CAAS_LOCAL, moab::TempestOnlineMap::CAAS_LOCAL_ADJACENT, moab::TempestOnlineMap::CAAS_NONE, moab::TempestOnlineMap::CAAS_QLT, cassType, computeDual, computeWeights, configureMapOptions(), moab::TempestRemapper::CS, moab::TempestRemapper::DEFAULT, enforceConvexity, ensureMonotonicity, fCheck, fvMethod, fVolumetric, moab::TempestRemapper::ICO, intxFilename, kdtreeSearch, mapOptions, MB_SUCCESS, meshType, MOAB_PACKAGE_VERSION, ProgOptions::numOptSet(), outFilename, moab::TempestRemapper::OVERLAP_FILES, moab::TempestRemapper::OVERLAP_MEMORY, moab::TempestRemapper::OVERLAP_MOAB, ProgOptions::parseCommandLine(), print_diagnostics, printHelp(), printRuntimeParameters(), proc_id, processMeshOptions(), moab::TempestRemapper::RLL, rrmGrids, skip_intersection, skip_io, useGnomonicProjection, variableToVerify, and verifyWeights.
Referenced by main().
|
inlineprivate |
Print detailed help message with usage examples.
| progName | Program name |
Definition at line 590 of file mbtempest.cpp.
Referenced by ParseCLOptions().
|
inlineprivate |
Print all runtime parameters in a formatted way.
Definition at line 768 of file mbtempest.cpp.
References blockSize, computeDual, computeWeights, ensureMonotonicity, fCheck, fVolumetric, getMeshTypeName(), moab::TempestRemapper::ICO, intxFilename, kdtreeSearch, meshType, n_procs, nlayers, outFilename, moab::TempestRemapper::OVERLAP_MOAB, skip_intersection, and useGnomonicProjection.
Referenced by ParseCLOptions().
|
inlineprivate |
Process mesh options from command line.
| opts | Program options |
| expectedFVMethod | Expected finite volume method |
| nlayer_input | Number of ghost layers |
Definition at line 673 of file mbtempest.cpp.
References ProgOptions::getOpt(), ProgOptions::getOptAllArgs(), moab::TempestRemapper::ICO, meshType, and outFilename.
Referenced by ParseCLOptions().
|
inline |
Stop timing and log the operation duration.
Definition at line 215 of file mbtempest.cpp.
References moab::ParallelComm::comm(), n_procs, opName, proc_id, timer, and timer_ops.
Referenced by anonymous_namespace{mbtempest.cpp}::convertAndWriteMOABMesh(), anonymous_namespace{mbtempest.cpp}::handleCSMesh(), anonymous_namespace{mbtempest.cpp}::handleICOMesh(), anonymous_namespace{mbtempest.cpp}::handleOverlapFiles(), anonymous_namespace{mbtempest.cpp}::handleRLLMesh(), and main().
|
inline |
Start timing an operation.
| operation | Name of the operation being timed |
Definition at line 206 of file mbtempest.cpp.
References opName, timer, and timer_ops.
Referenced by anonymous_namespace{mbtempest.cpp}::convertAndWriteMOABMesh(), anonymous_namespace{mbtempest.cpp}::handleCSMesh(), anonymous_namespace{mbtempest.cpp}::handleICOMesh(), anonymous_namespace{mbtempest.cpp}::handleOverlapFiles(), anonymous_namespace{mbtempest.cpp}::handleRLLMesh(), and main().
| std::string ToolContext::baselineFile |
Baseline file for verification (optional)
Definition at line 115 of file mbtempest.cpp.
Referenced by main(), and ParseCLOptions().
| int ToolContext::blockSize { 5 } |
Block size for vectorized operations.
Definition at line 147 of file mbtempest.cpp.
Referenced by anonymous_namespace{mbtempest.cpp}::handleCSMesh(), anonymous_namespace{mbtempest.cpp}::handleICOMesh(), anonymous_namespace{mbtempest.cpp}::handleRLLMesh(), ParseCLOptions(), and printRuntimeParameters().
| double ToolContext::boxeps { 1e-7 } |
Epsilon for bounding box checks.
Definition at line 131 of file mbtempest.cpp.
Referenced by main(), and ParseCLOptions().
| moab::TempestOnlineMap::CAASType ToolContext::cassType |
Conservative and accurate advection scheme type.
Definition at line 121 of file mbtempest.cpp.
Referenced by main(), and ParseCLOptions().
| bool ToolContext::computeDual { false } |
Compute dual mesh.
Definition at line 136 of file mbtempest.cpp.
Referenced by anonymous_namespace{mbtempest.cpp}::handleICOMesh(), ParseCLOptions(), and printRuntimeParameters().
| bool ToolContext::computeWeights { false } |
Compute interpolation weights.
Definition at line 137 of file mbtempest.cpp.
Referenced by anonymous_namespace{mbtempest.cpp}::handleOverlapMOAB(), main(), ParseCLOptions(), and printRuntimeParameters().
| std::vector< std::string > ToolContext::disc_methods |
Discretization methods (fv, cgll, dgll) for source and target.
Definition at line 111 of file mbtempest.cpp.
Referenced by anonymous_namespace{mbtempest.cpp}::handleOverlapMOAB(), main(), and ToolContext().
| std::vector< int > ToolContext::disc_orders |
Discretization orders for source and target.
Definition at line 110 of file mbtempest.cpp.
Referenced by main(), and ToolContext().
| std::vector< std::string > ToolContext::doftag_names |
Degree of freedom tag names for source and target.
Definition at line 112 of file mbtempest.cpp.
Referenced by main(), and ToolContext().
| bool ToolContext::enforceConvexity { false } |
Enforce convexity in mesh elements.
Definition at line 140 of file mbtempest.cpp.
Referenced by main(), and ParseCLOptions().
| int ToolContext::ensureMonotonicity { 0 } |
Monotonicity enforcement level (0=none, 1=basic, 2=full, 3=strict)
Definition at line 123 of file mbtempest.cpp.
Referenced by configureMapOptions(), main(), ParseCLOptions(), and printRuntimeParameters().
| double ToolContext::epsrel { ReferenceTolerance } |
Relative tolerance for convergence.
Definition at line 132 of file mbtempest.cpp.
Referenced by main().
| bool ToolContext::fCheck { false } |
Enable additional checking during remapping.
Definition at line 126 of file mbtempest.cpp.
Referenced by configureMapOptions(), main(), ParseCLOptions(), and printRuntimeParameters().
| std::string ToolContext::fvMethod { "none" } |
Finite volume method specification.
Definition at line 117 of file mbtempest.cpp.
Referenced by configureMapOptions(), and ParseCLOptions().
| bool ToolContext::fVolumetric { false } |
Enable volumetric (3D) remapping.
Definition at line 127 of file mbtempest.cpp.
Referenced by configureMapOptions(), ParseCLOptions(), and printRuntimeParameters().
| std::vector< std::string > ToolContext::inFilenames |
Input filenames for source and target meshes.
Definition at line 109 of file mbtempest.cpp.
Referenced by anonymous_namespace{mbtempest.cpp}::handleOverlapFiles(), anonymous_namespace{mbtempest.cpp}::handleOverlapMemory(), anonymous_namespace{mbtempest.cpp}::handleOverlapMOAB(), main(), and ToolContext().
| std::string ToolContext::intxFilename |
Intersection mesh filename (optional)
Definition at line 114 of file mbtempest.cpp.
Referenced by main(), ParseCLOptions(), and printRuntimeParameters().
| bool ToolContext::kdtreeSearch { true } |
Enable KD-tree for spatial searches.
Definition at line 125 of file mbtempest.cpp.
Referenced by main(), ParseCLOptions(), and printRuntimeParameters().
| GenerateOfflineMapAlgorithmOptions ToolContext::mapOptions |
Configuration for offline map generation.
Definition at line 120 of file mbtempest.cpp.
Referenced by main(), ParseCLOptions(), and ToolContext().
| moab::Core* const ToolContext::mbcore |
MOAB Core instance for mesh operations.
Definition at line 99 of file mbtempest.cpp.
Referenced by anonymous_namespace{mbtempest.cpp}::convertAndWriteMOABMesh(), and anonymous_namespace{mbtempest.cpp}::handleOverlapMOAB().
| std::vector< Mesh* > ToolContext::meshes |
Collection of TempestRemap meshes.
Definition at line 150 of file mbtempest.cpp.
Referenced by anonymous_namespace{mbtempest.cpp}::handleCSMesh(), anonymous_namespace{mbtempest.cpp}::handleICOMesh(), anonymous_namespace{mbtempest.cpp}::handleOverlapFiles(), anonymous_namespace{mbtempest.cpp}::handleOverlapMemory(), anonymous_namespace{mbtempest.cpp}::handleOverlapMOAB(), anonymous_namespace{mbtempest.cpp}::handleRLLMesh(), and main().
| std::vector< moab::EntityHandle > ToolContext::meshsets |
MOAB entity sets for meshes.
Definition at line 151 of file mbtempest.cpp.
Referenced by anonymous_namespace{mbtempest.cpp}::handleOverlapMemory(), anonymous_namespace{mbtempest.cpp}::handleOverlapMOAB(), and main().
| moab::TempestRemapper::TempestMeshType ToolContext::meshType { moab::TempestRemapper::DEFAULT } |
Type of mesh to generate.
Definition at line 108 of file mbtempest.cpp.
Referenced by CreateTempestMesh(), getMeshTypeName(), main(), ParseCLOptions(), printRuntimeParameters(), and processMeshOptions().
| const int ToolContext::n_procs |
Total number of MPI processes (1 for serial)
Definition at line 104 of file mbtempest.cpp.
Referenced by get_file_read_options(), anonymous_namespace{mbtempest.cpp}::handleOverlapMOAB(), printRuntimeParameters(), and timer_pop().
| int ToolContext::nlayers { 0 } |
Number of ghost layers for parallel operations.
Definition at line 146 of file mbtempest.cpp.
Referenced by configureMapOptions(), main(), and printRuntimeParameters().
| std::string ToolContext::opName |
Name of current operation being timed.
Definition at line 145 of file mbtempest.cpp.
Referenced by timer_pop(), and timer_push().
| std::string ToolContext::outFilename { "outputFile.nc" } |
Output filename for remapping results.
Definition at line 113 of file mbtempest.cpp.
Referenced by configureMapOptions(), anonymous_namespace{mbtempest.cpp}::convertAndWriteMOABMesh(), anonymous_namespace{mbtempest.cpp}::handleCSMesh(), anonymous_namespace{mbtempest.cpp}::handleICOMesh(), anonymous_namespace{mbtempest.cpp}::handleOverlapFiles(), anonymous_namespace{mbtempest.cpp}::handleRLLMesh(), main(), ParseCLOptions(), printRuntimeParameters(), and processMeshOptions().
| moab::DebugOutput ToolContext::outputFormatter |
Formatter for debug output.
Definition at line 105 of file mbtempest.cpp.
Referenced by anonymous_namespace{mbtempest.cpp}::convertAndWriteMOABMesh(), CreateTempestMesh(), main(), and ToolContext().
| bool ToolContext::print_diagnostics { false } |
Print detailed diagnostic information.
Definition at line 129 of file mbtempest.cpp.
Referenced by main(), and ParseCLOptions().
| const int ToolContext::proc_id |
MPI process rank (0 for serial)
Definition at line 103 of file mbtempest.cpp.
Referenced by anonymous_namespace{mbtempest.cpp}::convertAndWriteMOABMesh(), CreateTempestMesh(), get_file_read_options(), anonymous_namespace{mbtempest.cpp}::handleOverlapMOAB(), main(), ParseCLOptions(), and timer_pop().
| bool ToolContext::rrmGrids { false } |
Flag to use RRM (Regional Refinement Meshes)
Definition at line 124 of file mbtempest.cpp.
Referenced by main(), and ParseCLOptions().
| bool ToolContext::skip_intersection { false } |
Skip intersection computation (for debugging)
Definition at line 130 of file mbtempest.cpp.
Referenced by configureMapOptions(), main(), ParseCLOptions(), and printRuntimeParameters().
| bool ToolContext::skip_io { false } |
Skip file I/O operations (for testing)
Definition at line 135 of file mbtempest.cpp.
Referenced by main(), and ParseCLOptions().
| std::unique_ptr< moab::CpuTimer > ToolContext::timer |
Timer for performance measurement.
Definition at line 143 of file mbtempest.cpp.
Referenced by timer_pop(), timer_push(), and ToolContext().
| double ToolContext::timer_ops { 0.0 } |
Operation timer value.
Definition at line 144 of file mbtempest.cpp.
Referenced by timer_pop(), and timer_push().
| bool ToolContext::useGnomonicProjection { false } |
Use gnomonic projection for certain operations.
Definition at line 128 of file mbtempest.cpp.
Referenced by main(), ParseCLOptions(), and printRuntimeParameters().
| std::string ToolContext::variableToVerify |
Variable name for verification (optional)
Definition at line 116 of file mbtempest.cpp.
Referenced by main(), and ParseCLOptions().
| bool ToolContext::verifyConservation { false } |
Verify conservation properties.
Definition at line 138 of file mbtempest.cpp.
| bool ToolContext::verifyWeights { false } |
Verify interpolation weights.
Definition at line 139 of file mbtempest.cpp.
Referenced by main(), and ParseCLOptions().