mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
update after pull request comments; addition of OUTPUTDIR variable to Damaris XML configuration
This commit is contained in:
@@ -85,6 +85,8 @@ struct DamarisSettings {
|
||||
* Damaris and perform checks and logic so as to create a valid XML file.
|
||||
* N.B. The created XML file can be overridden using an environment variable
|
||||
* FLOW_DAMARIS_XML_FILE that points to a Damaris XML file.
|
||||
*
|
||||
* N.B. This needs to be called before damaris_init()
|
||||
*/
|
||||
template<class TypeTag>
|
||||
std::map<std::string, std::string>
|
||||
@@ -116,6 +118,7 @@ getSetOfIncludedVariables(void)
|
||||
{
|
||||
std::unordered_set<std::string> resuset ;
|
||||
std::string tstr;
|
||||
// The --damaris-limit-variables command line option (defaults to empty string)
|
||||
std::string damarisLimitVars = Parameters::get<TypeTag, Properties::DamarisLimitVariables>();
|
||||
std::stringstream ss(damarisLimitVars);
|
||||
|
||||
@@ -125,8 +128,10 @@ getSetOfIncludedVariables(void)
|
||||
// tstr.erase(std::remove_if(tstr.begin(), tstr.end(), ::isspace), tstr.end());
|
||||
std::string::iterator end_pos = std::remove(tstr.begin(), tstr.end(), ' ');
|
||||
tstr.erase(end_pos, tstr.end());
|
||||
// place in set (no duplicates possible in set)
|
||||
resuset.insert(tstr) ;
|
||||
// place in set (no duplicates possible in set and no empty string)
|
||||
if (tstr != "") {
|
||||
resuset.insert(tstr) ;
|
||||
}
|
||||
}
|
||||
return (resuset) ;
|
||||
}
|
||||
|
||||
@@ -48,13 +48,18 @@ std::string initDamarisXmlFile()
|
||||
<parameter name="n_elements_total" type="int" value="1" />
|
||||
<parameter name="n_elements_local" type="int" value="1" />
|
||||
<parameter name="n" type="int" value="1" />
|
||||
|
||||
<parameter name="path_string_length" type="int" value="1" />
|
||||
|
||||
<layout name="path_string_layout" type="char" dimensions="path_string_length" comment="The length of the output directory path string" />
|
||||
<variable name="OUTPUTDIR" layout="path_string_layout" type="scalar" visualizable="false" mesh="#" unit="" time-varying="false" store="#" script="_MAKE_AVAILABLE_IN_PYTHON_" />
|
||||
|
||||
|
||||
<layout name="zonal_layout_usmesh_integer" type="int" dimensions="n_elements_local" global="n_elements_total" comment="For the field data e.g. Pressure" />
|
||||
<variable name="GLOBAL_CELL_INDEX" layout="zonal_layout_usmesh_integer" type="scalar" visualizable="false" time-varying="false" centering="zonal" store="_MYSTORE_OR_EMPTY_REGEX_" script="_MAKE_AVAILABLE_IN_PYTHON_" />
|
||||
<layout name="zonal_layout_usmesh" type="double" dimensions="n_elements_local" global="n_elements_total" comment="For the field data e.g. Pressure" />
|
||||
<variable name="PRESSURE" layout="zonal_layout_usmesh" type="scalar" visualizable="true" mesh="us_mesh" unit="_PRESSURE_UNIT_" centering="zonal" select-file="GLOBAL_CELL_INDEX" store="_MYSTORE_OR_EMPTY_REGEX_" script="_MAKE_AVAILABLE_IN_PYTHON_" />
|
||||
|
||||
<variable name="MY_TEST_VAR" layout="zonal_layout_usmesh" type="scalar" visualizable="true" mesh="us_mesh" unit="" centering="zonal" time-varying="true" select-file="GLOBAL_CELL_INDEX" store="_MYSTORE_OR_EMPTY_REGEX_" script="_MAKE_AVAILABLE_IN_PYTHON_" />
|
||||
|
||||
|
||||
_MORE_VARIABLES_REGEX_
|
||||
<variable name="MPI_RANK" layout="zonal_layout_usmesh_integer" type="scalar" visualizable="true" mesh="us_mesh" unit="rank" centering="zonal" store="_MYSTORE_MESH_OR_EMPTY_REGEX_" time-varying="false" select-file="GLOBAL_CELL_INDEX" script="_MAKE_AVAILABLE_IN_PYTHON_" comment="The MPI rank of each cell"/>
|
||||
|
||||
Reference in New Issue
Block a user