Skip to content

Commit

Permalink
Changing GEOSX to GEOS in external mesh import
Browse files Browse the repository at this point in the history
  • Loading branch information
ryar9534 committed Aug 12, 2024
1 parent b4b1a3a commit f7f9add
Show file tree
Hide file tree
Showing 17 changed files with 37 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
logLevel="5"
file="../../../../../GEOSDATA/DataSets/Class09_p3/Johansen_faces.vtu"
fieldsToImport="{ perm, poro }"
fieldNamesInGEOSX="{ rockPerm_permeability, rockPorosity_referencePorosity }" >
fieldNamesInGEOS="{ rockPerm_permeability, rockPorosity_referencePorosity }" >
<InternalWell
name="wellInjector1"
wellRegionName="wellRegion"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
logLevel="5"
file="../../../../../GEOSXDATA/DataSets/Class09_p3/Johansen_faces.vtu"
fieldsToImport="{ perm, poro }"
fieldNamesInGEOSX="{ rockPerm_permeability, rockPorosity_referencePorosity }" >
fieldNamesInGEOS="{ rockPerm_permeability, rockPorosity_referencePorosity }" >
<InternalWell
name="wellInjector1"
wellRegionName="wellRegion"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
logLevel="5"
file="../../../../../GEOSXDATA/DataSets/Class09_p3/Johansen_faces.vtu"
fieldsToImport="{ perm, poro }"
fieldNamesInGEOSX="{ rockPerm_permeability, rockPorosity_referencePorosity }" >
fieldNamesInGEOS="{ rockPerm_permeability, rockPorosity_referencePorosity }" >
<InternalWell
name="wellInjector1"
wellRegionName="wellRegion"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
name="mesh"
file="../../../../../GEOSDATA/DataSets/Egg/egg.vtu"
fieldsToImport="{ PERM }"
fieldNamesInGEOSX="{ rockPerm_permeability }">
fieldNamesInGEOS="{ rockPerm_permeability }">

<VTKWell
name="wellProducer1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
name="mesh"
file="../../../../../GEOSDATA/DataSets/Egg/egg.vtu"
fieldsToImport="{ PERM }"
fieldNamesInGEOSX="{ rockPerm_permeability }">
fieldNamesInGEOS="{ rockPerm_permeability }">

<InternalWell
name="wellProducer1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
name="mesh1"
file="staircase3d_tet_with_properties.vtu"
fieldsToImport="{ FluidComposition, PERM, PORO }"
fieldNamesInGEOSX="{ globalCompFraction, rockPerm_permeability, rockPorosity_referencePorosity }"
fieldNamesInGEOS="{ globalCompFraction, rockPerm_permeability, rockPorosity_referencePorosity }"
partitionRefinement="1"
logLevel="2">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
partitionMethod="ptscotch"
scale="{ 50, 50, 50 }"
fieldsToImport="{ PORO, NTG, DENSITY, BULKMOD }"
fieldNamesInGEOSX="{ rockPorosity_referencePorosity, netToGross, skeleton_density, skeleton_bulkModulus }"
fieldNamesInGEOS="{ rockPorosity_referencePorosity, netToGross, skeleton_density, skeleton_bulkModulus }"
file="../singlePhaseFlow/pebi3d_with_properties.vtu"/>

</Mesh>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
file="../../../GEOSDATA/DataSets/Egg/egg_withBurdens_small.vts"
regionAttribute="elementRegionMarker"
fieldsToImport="{ PERM }"
fieldNamesInGEOSX="{ rockPermeability_permeability }"/>
fieldNamesInGEOS="{ rockPermeability_permeability }"/>
</Mesh>

<Geometry>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
file="../../../GEOSDATA/DataSets/Egg/egg_withBurdens_large.vts"
regionAttribute="regionAttribute"
fieldsToImport="{ PERM }"
fieldNamesInGEOSX="{ rockPermeability_permeability }"/>
fieldNamesInGEOS="{ rockPermeability_permeability }"/>
</Mesh>

<Geometry>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
file="../../../GEOSDATA/DataSets/Egg/egg_withBurdens_small.vts"
regionAttribute="elementRegionMarker"
fieldsToImport="{ PERM }"
fieldNamesInGEOSX="{ rockPermeability_permeability }"/>
fieldNamesInGEOS="{ rockPermeability_permeability }"/>
</Mesh>

<Geometry>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
name="main"
file="Domain_Mesh_FaultModel.vtu"
fieldsToImport="{ YoungModulus, PoissonRatio }"
fieldNamesInGEOSX="{ rock_youngModulus, rock_poissonRatio }"
fieldNamesInGEOS="{ rock_youngModulus, rock_poissonRatio }"
/>
<DataSet
name="fracture"
Expand Down
2 changes: 1 addition & 1 deletion inputFiles/singlePhaseFlow/incompressible_pebi3d.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
partitionRefinement="3"
useGlobalIds="1"
fieldsToImport="{ PERM, PORO, NTG }"
fieldNamesInGEOSX="{ rockPerm_permeability, rockPorosity_referencePorosity, netToGross }"
fieldNamesInGEOS="{ rockPerm_permeability, rockPorosity_referencePorosity, netToGross }"

file="pebi3d_with_properties.vtu"/>
</Mesh>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
file="../../../GEOSDATA/DataSets/Egg/egg_withBurdens_small.vts"
regionAttribute="elementRegionMarker"
fieldsToImport="{ PERM }"
fieldNamesInGEOSX="{ rockPermeability_permeability }"/>
fieldNamesInGEOS="{ rockPermeability_permeability }"/>
</Mesh>

<Geometry>
Expand Down
20 changes: 10 additions & 10 deletions src/coreComponents/mesh/generators/ExternalMeshGeneratorBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,20 @@ ExternalMeshGeneratorBase::ExternalMeshGeneratorBase( string const & name,
setInputFlag( InputFlags::OPTIONAL ).
setDescription( "Volumic fields to be imported from the external mesh file" );

registerWrapper( viewKeyStruct::volumicFieldsInGEOSXString(), &m_volumicFieldsInGEOSX ).
registerWrapper( viewKeyStruct::volumicFieldsInGEOSString(), &m_volumicFieldsInGEOS ).
setRTTypeName( rtTypes::CustomTypes::groupNameRefArray ).
setInputFlag( InputFlags::OPTIONAL ).
setDescription( "Names of the volumic fields in GEOSX to import into" );
setDescription( "Names of the volumic fields in GEOS to import into" );

registerWrapper( viewKeyStruct::surfacicFieldsToImportString(), &m_surfacicFieldsToImport ).
setRTTypeName( rtTypes::CustomTypes::groupNameRefArray ).
setInputFlag( InputFlags::OPTIONAL ).
setDescription( "Surfacic fields to be imported from the external mesh file" );

registerWrapper( viewKeyStruct::surfacicFieldsInGEOSXString(), &m_surfacicFieldsInGEOSX ).
registerWrapper( viewKeyStruct::surfacicFieldsInGEOSString(), &m_surfacicFieldsInGEOS ).
setRTTypeName( rtTypes::CustomTypes::groupNameRefArray ).
setInputFlag( InputFlags::OPTIONAL ).
setDescription( "Names of the surfacic fields in GEOSX to import into" );
setDescription( "Names of the surfacic fields in GEOS to import into" );
}

void ExternalMeshGeneratorBase::postInputInitialization()
Expand All @@ -73,8 +73,8 @@ void ExternalMeshGeneratorBase::postInputInitialization()
" must contain the same number of values.",
InputError );
};
checkSizes( m_volumicFieldsToImport, m_volumicFieldsInGEOSX, viewKeyStruct::volumicFieldsToImportString(), viewKeyStruct::volumicFieldsInGEOSXString() );
checkSizes( m_surfacicFieldsToImport, m_surfacicFieldsInGEOSX, viewKeyStruct::surfacicFieldsToImportString(), viewKeyStruct::surfacicFieldsInGEOSXString() );
checkSizes( m_volumicFieldsToImport, m_volumicFieldsInGEOS, viewKeyStruct::volumicFieldsToImportString(), viewKeyStruct::volumicFieldsInGEOSString() );
checkSizes( m_surfacicFieldsToImport, m_surfacicFieldsInGEOS, viewKeyStruct::surfacicFieldsToImportString(), viewKeyStruct::surfacicFieldsInGEOSString() );

auto const checkDuplicates = [this]( arrayView1d< string const > v, string const & key )
{
Expand All @@ -86,8 +86,8 @@ void ExternalMeshGeneratorBase::postInputInitialization()
"' already present in list of fields to import.",
InputError );
};
checkDuplicates( m_volumicFieldsInGEOSX, viewKeyStruct::volumicFieldsInGEOSXString() );
checkDuplicates( m_surfacicFieldsInGEOSX, viewKeyStruct::surfacicFieldsInGEOSXString() );
checkDuplicates( m_volumicFieldsInGEOS, viewKeyStruct::volumicFieldsInGEOSString() );
checkDuplicates( m_surfacicFieldsInGEOS, viewKeyStruct::surfacicFieldsInGEOSString() );

// Building the fields mapping from the two separated input/output vectors.
auto const buildMapping = [&]( arrayView1d< string const > from,
Expand All @@ -101,8 +101,8 @@ void ExternalMeshGeneratorBase::postInputInitialization()
return mapping;
};

MeshGeneratorBase::m_volumicFields = buildMapping( m_volumicFieldsToImport.toViewConst(), m_volumicFieldsInGEOSX.toViewConst() );
MeshGeneratorBase::m_surfacicFields = buildMapping( m_surfacicFieldsToImport.toViewConst(), m_surfacicFieldsInGEOSX.toViewConst() );
MeshGeneratorBase::m_volumicFields = buildMapping( m_volumicFieldsToImport.toViewConst(), m_volumicFieldsInGEOS.toViewConst() );
MeshGeneratorBase::m_surfacicFields = buildMapping( m_surfacicFieldsToImport.toViewConst(), m_surfacicFieldsInGEOS.toViewConst() );
}

} // namespace geos
16 changes: 8 additions & 8 deletions src/coreComponents/mesh/generators/ExternalMeshGeneratorBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ class ExternalMeshGeneratorBase : public MeshGeneratorBase
constexpr static char const * scaleString() { return "scale"; }
constexpr static char const * translateString() { return "translate"; }
constexpr static char const * volumicFieldsToImportString() { return "fieldsToImport"; }
constexpr static char const * volumicFieldsInGEOSXString() { return "fieldNamesInGEOSX"; }
constexpr static char const * volumicFieldsInGEOSString() { return "fieldNamesInGEOS"; }
constexpr static char const * surfacicFieldsToImportString() { return "surfacicFieldsToImport"; }
constexpr static char const * surfacicFieldsInGEOSXString() { return "surfacicFieldsInGEOSX"; }
constexpr static char const * surfacicFieldsInGEOSString() { return "surfacicFieldsInGEOS"; }
};
/// @endcond

Expand All @@ -66,17 +66,17 @@ class ExternalMeshGeneratorBase : public MeshGeneratorBase
/// Scale factor that will be applied to the point coordinates (after translation)
R1Tensor m_scale;

/// Names of the fields to be copied from an external reader into GEOSX data structure
/// Names of the fields to be copied from an external reader into GEOS data structure
array1d< string > m_volumicFieldsToImport;

/// String array of the GEOSX user declared volumic fields
array1d< string > m_volumicFieldsInGEOSX;
/// String array of the GEOS user declared volumic fields
array1d< string > m_volumicFieldsInGEOS;

/// Names of the surfacic fields to be copied from an external reader into GEOSX data structure
/// Names of the surfacic fields to be copied from an external reader into GEOS data structure
array1d< string > m_surfacicFieldsToImport;

/// String array of the GEOSX user declared surfacic fields
array1d< string > m_surfacicFieldsInGEOSX;
/// String array of the GEOS user declared surfacic fields
array1d< string > m_surfacicFieldsInGEOS;
};

} // namespace geos
Expand Down
8 changes: 4 additions & 4 deletions src/coreComponents/mesh/generators/MeshGeneratorBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,22 +114,22 @@ class MeshGeneratorBase : public dataRepository::Group
virtual void freeResources() {}

/**
* @brief Get the name mapping between mesh volumic field names and internal GEOSX volumic field names.
* @brief Get the name mapping between mesh volumic field names and internal GEOS volumic field names.
* @return The string to string mapping of field names.
*/
std::map< string, string > const & getVolumicFieldsMapping() const { return m_volumicFields; }

/**
* @brief Get the name mapping between mesh surfacic field names and internal GEOSX surfacic field names.
* @brief Get the name mapping between mesh surfacic field names and internal GEOS surfacic field names.
* @return The string to string mapping of field names.
*/
std::map< string, string > const & getSurfacicFieldsMapping() const { return m_surfacicFields; }

protected:
/// Mapping from volumic field source to GEOSX field.
/// Mapping from volumic field source to GEOS field.
std::map< string, string > m_volumicFields;

/// Mapping from surfacic field source to GEOSX field.
/// Mapping from surfacic field source to GEOS field.
std::map< string, string > m_surfacicFields;

private:
Expand Down
4 changes: 2 additions & 2 deletions src/coreComponents/schema/docs/VTKMesh.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Name Type Default Description
====================== ======================== ========= ============================================================================================================================================================================================================================================================================================================================================================================================================================================================================
faceBlocks groupNameRef_array {} For multi-block files, names of the face mesh block.
fieldNamesInGEOSX groupNameRef_array {} Names of the volumic fields in GEOSX to import into
fieldNamesInGEOS groupNameRef_array {} Names of the volumic fields in GEOS to import into
fieldsToImport groupNameRef_array {} Volumic fields to be imported from the external mesh file
file path required Path to the mesh file
logLevel integer 0 Log level
Expand All @@ -15,7 +15,7 @@ partitionMethod geos_vtk_PartitionMethod parmetis Method (library) used
partitionRefinement integer 1 Number of partitioning refinement iterations (defaults to 1, recommended value).A value of 0 disables graph partitioning and keeps simple kd-tree partitions (not recommended). Values higher than 1 may lead to slightly improved partitioning, but yield diminishing returns.
regionAttribute groupNameRef attribute Name of the VTK cell attribute to use as region marker
scale R1Tensor {1,1,1} Scale the coordinates of the vertices by given scale factors (after translation)
surfacicFieldsInGEOSX groupNameRef_array {} Names of the surfacic fields in GEOSX to import into
surfacicFieldsInGEOS groupNameRef_array {} Names of the surfacic fields in GEOS to import into
surfacicFieldsToImport groupNameRef_array {} Surfacic fields to be imported from the external mesh file
translate R1Tensor {0,0,0} Translate the coordinates of the vertices by a given vector (prior to scaling)
useGlobalIds integer 0 Controls the use of global IDs in the input file for cells and points. If set to 0 (default value), the GlobalId arrays in the input mesh are used if available, and generated otherwise. If set to a negative value, the GlobalId arrays in the input mesh are not used, and generated global Ids are automatically generated. If set to a positive value, the GlobalId arrays in the input mesh are used and required, and the simulation aborts if they are not available
Expand Down

0 comments on commit f7f9add

Please sign in to comment.