Skip to content

Commit

Permalink
Merge branch 'swaziri/experimental' into swaziri/configLoop_acceleration
Browse files Browse the repository at this point in the history
  • Loading branch information
paveltomin authored Nov 28, 2024
2 parents 7354345 + 0a42e72 commit f72951b
Show file tree
Hide file tree
Showing 34 changed files with 1,058 additions and 288 deletions.
2 changes: 1 addition & 1 deletion .integrated_tests.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
baselines:
bucket: geosx
baseline: integratedTests/baseline_integratedTests-pr3448-8959-1ff97b3
baseline: integratedTests/baseline_integratedTests-pr2957-9029-ff99ac0
allow_fail:
all: ''
streak: ''
4 changes: 4 additions & 0 deletions BASELINE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ This file is designed to track changes to the integrated test baselines.
Any developer who updates the baseline ID in the .integrated_tests.yaml file is expected to create an entry in this file with the pull request number, date, and their justification for rebaselining.
These notes should be in reverse-chronological order, and use the following time format: (YYYY-MM-DD).

PR #2957 (2024-11-27)
=====================
Added ExternalDataRepository.

PR #3448 (2024-11-21)
=====================
Switched the FaceElementSubRegion::m_toFacesRelation and FaceElementSubRegion::m_2dElemToElems back to array2d instead of ArrayOfArray. This results in a reordering m_toFacesRelation back to the "correct" assumed order of "original face first". This fixes a bug that failed to remove the CellStencil entry when a FaceElement splits two cells.
Expand Down
47 changes: 47 additions & 0 deletions inputFiles/singlePhaseFlow/FieldCaseTutorial3_composite_smoke.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" ?>

<Problem>
<Included>
<File name="./FieldCaseTutorial3_base.xml" />
</Included>

<!-- SPHINX_FIELD_CASE_COMPOSITE_MESH -->
<ExternalDataSource>
<VTKHierarchicalDataSource
name="synthetic"
file="synthetic.vtpc"/>
</ExternalDataSource>

<Mesh>
<VTKMesh
name="SyntheticMesh"
repositoryName="synthetic">
<Region
name="Region1"
id="1"
pathInRepository="/Root/Mesh/Region1"/>
<Region
name="Region2"
id="2"
pathInRepository="/Root/Mesh/Region2"/>
<Region
name="Region3"
id="3"
pathInRepository="/Root/Mesh/Region3"/>
</VTKMesh>
</Mesh>
<!-- SPHINX_FIELD_CASE_COMPOSITE_MESH -->

<!-- SPHINX_FIELD_CASE_EVENTS -->
<Events maxTime="100.0e6">
<PeriodicEvent name="solverApplications"
forceDt="10.0e6"
target="/Solvers/SinglePhaseFlow" />

<PeriodicEvent name="outputs"
timeFrequency="10.0e6"
target="/Outputs/reservoir_with_properties" />
</Events>
<!-- SPHINX_FIELD_CASE_EVENTS_END -->

</Problem>
17 changes: 17 additions & 0 deletions inputFiles/singlePhaseFlow/synthetic.vtpc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0"?>
<VTKFile type="vtkPartitionedDataSetCollection" version="1.0" byte_order="LittleEndian" header_type="UInt32" compressor="vtkZLibDataCompressor">
<vtkPartitionedDataSetCollection>
<Partitions index="0" name="Region1">
<DataSet index="0" file="synthetic/synthetic_0_0.vtu"/>
</Partitions>
<Partitions index="1" name="Region2">
<DataSet index="0" file="synthetic/synthetic_1_0.vtu"/>
</Partitions>
<Partitions index="2" name="Region3">
<DataSet index="0" file="synthetic/synthetic_2_0.vtu"/>
</Partitions>
<DataAssembly encoding="base64">
PD94bWwgdmVyc2lvbj0iMS4wIj8+CjxSb290IHR5cGU9InZ0a0RhdGFBc3NlbWJseSIgdmVyc2lvbj0iMS4wIiBpZD0iMCIgdnRrX3R5cGU9IjM4IiB2dGtfY2F0ZWdvcnk9Inhmb3JtZWRfaGllcmFyY2h5IiBsYWJlbD0iZGF0YSI+CiAgPE1lc2ggaWQ9IjEiIGxhYmVsPSJTeW50aGV0aWNNZXNoIj4KICAgIDxSZWdpb24xIGlkPSIyIiBsYWJlbD0iUmVnaW9uMSIgbnVtYmVyX29mX3BhcnRpdGlvbnM9IjEiPgogICAgICA8ZGF0YXNldCBpZD0iMCIgLz4KICAgIDwvUmVnaW9uMT4KICAgIDxSZWdpb24yIGlkPSIzIiBsYWJlbD0iUmVnaW9uMiIgbnVtYmVyX29mX3BhcnRpdGlvbnM9IjEiPgogICAgICA8ZGF0YXNldCBpZD0iMSIgLz4KICAgIDwvUmVnaW9uMj4KICAgIDxSZWdpb24zIGlkPSI0IiBsYWJlbD0iUmVnaW9uMyIgbnVtYmVyX29mX3BhcnRpdGlvbnM9IjEiPgogICAgICA8ZGF0YXNldCBpZD0iMiIgLz4KICAgIDwvUmVnaW9uMz4KICA8L01lc2g+CjwvUm9vdD4K
</DataAssembly>
</vtkPartitionedDataSetCollection>
</VTKFile>
23 changes: 23 additions & 0 deletions inputFiles/singlePhaseFlow/synthetic/synthetic_0_0.vtu

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions inputFiles/singlePhaseFlow/synthetic/synthetic_1_0.vtu

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions inputFiles/singlePhaseFlow/synthetic/synthetic_2_0.vtu

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions src/coreComponents/fileIO/vtk/VTKPolyDataWriterInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,6 @@ void VTKPolyDataWriterInterface::writeParticleRegions( real64 const time,
writeTimestamp( ug.GetPointer(), time );
writeParticleFields( region, ug->GetCellData() );

// string const regionDir = joinPath( path, region.getName() );
writeUnstructuredGrid( path, region, ug.GetPointer() );
} );
}
Expand Down Expand Up @@ -1185,8 +1184,6 @@ void VTKPolyDataWriterInterface::writeVtmFile( integer const cycle,

string const meshPath = joinPath( getCycleSubFolder( cycle ), meshBodyName, meshLevelName );

// int const mpiSize = MpiWrapper::commSize();

auto addElementRegion = [&]( ElementRegionBase const & region )
{
std::vector< string > const blockPath{ meshBody.getName(), meshLevel.getName(), region.getCatalogName(), region.getName() };
Expand Down
11 changes: 5 additions & 6 deletions src/coreComponents/fileIO/vtk/VTKPolyDataWriterInterface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ class VTKPolyDataWriterInterface
void clearData();


private:
protected:

/**
* @brief Check if plotting is enabled for this field
Expand All @@ -234,7 +234,7 @@ class VTKPolyDataWriterInterface
* @param[in] time the time-step
* @param[in] elemManager the ElementRegionManager containing the CellElementRegions to be output
* @param[in] nodeManager the NodeManager containing the nodes of the domain to be output
* @param[in] path the root path where the mesh will be written
* @param[in] path the path to the file to output
*/
void writeCellElementRegions( real64 time,
ElementRegionManager const & elemManager,
Expand All @@ -247,7 +247,7 @@ class VTKPolyDataWriterInterface
* @param[in] time the time-step
* @param[in] elemManager the ElementRegionManager containing the WellElementRegions to be output
* @param[in] nodeManager the NodeManager containing the nodes of the domain to be output
* @param[in] path the root path where the mesh will be written
* @param[in] path The path to the file to output
*/
void writeWellElementRegions( real64 time,
ElementRegionManager const & elemManager,
Expand Down Expand Up @@ -289,7 +289,6 @@ class VTKPolyDataWriterInterface
* @param[in] domain the DomainPartition containing all the regions to be output and referred to in the VTM file
* @param[in] vtmWriter a writer specialized for the VTM file format
*/

void writeVtmFile( integer const cycle,
DomainPartition const & domain,
VTKVTMWriter const & vtmWriter ) const;
Expand All @@ -312,7 +311,7 @@ class VTKPolyDataWriterInterface
vtkCellData * cellData ) const;

/**
* @brief Writes all the fields associated to the elements of \p er if their plotlevel is <= m_plotLevel
* @brief Writes all the fields associated to the elements of \p region if their plotlevel is <= m_plotLevel
* @param[in] region ParticleRegion being written
* @param[in] cellData a VTK object containing all the fields associated with the elements
*/
Expand All @@ -332,7 +331,7 @@ class VTKPolyDataWriterInterface
ObjectManagerBase const & region,
vtkUnstructuredGrid * ug );

private:
protected:

/// Output directory name
string m_outputDir;
Expand Down
3 changes: 3 additions & 0 deletions src/coreComponents/mainInterface/ProblemManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include "fileIO/Outputs/OutputBase.hpp"
#include "fileIO/Outputs/OutputManager.hpp"
#include "functions/FunctionManager.hpp"
#include "mesh/ExternalDataSourceManager.hpp"
#include "mesh/DomainPartition.hpp"
#include "mesh/MeshBody.hpp"
#include "mesh/MeshManager.hpp"
Expand Down Expand Up @@ -73,6 +74,8 @@ ProblemManager::ProblemManager( conduit::Node & root ):

setInputFlags( InputFlags::PROBLEM_ROOT );

registerGroup< ExternalDataSourceManager >( groupKeys.externalDataSourceManager );

m_fieldSpecificationManager = &registerGroup< FieldSpecificationManager >( groupKeys.fieldSpecificationManager );

m_eventManager = &registerGroup< EventManager >( groupKeys.eventManager );
Expand Down
1 change: 1 addition & 0 deletions src/coreComponents/mainInterface/ProblemManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ class ProblemManager : public dataRepository::Group
dataRepository::GroupKey constitutiveManager = { "Constitutive" }; ///< Constitutive key
dataRepository::GroupKey domain = { "domain" }; ///< Domain key
dataRepository::GroupKey eventManager = { "Events" }; ///< Events key
dataRepository::GroupKey externalDataSourceManager = { "ExternalDataSource" }; ///< External Data Source key
dataRepository::GroupKey fieldSpecificationManager = { "FieldSpecifications" }; ///< Field specification key
dataRepository::GroupKey functionManager = { "Functions" }; ///< Functions key
dataRepository::GroupKey geometricObjectManager = { "Geometry" }; ///< Geometry key
Expand Down
11 changes: 10 additions & 1 deletion src/coreComponents/mesh/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ set( mesh_headers
ElementRegionManager.hpp
ElementSubRegionBase.hpp
ElementType.hpp
ExternalDataSourceBase.hpp
ExternalDataSourceManager.hpp
EmbeddedSurfaceNodeManager.hpp
EmbeddedSurfaceSubRegion.hpp
MeshFields.hpp
Expand Down Expand Up @@ -80,12 +82,13 @@ set( mesh_headers
generators/InternalMeshGenerator.hpp
generators/InternalWellGenerator.hpp
generators/InternalWellboreGenerator.hpp
generators/MeshComponentBase.hpp
generators/MeshGeneratorBase.hpp
generators/ParMETISInterface.hpp
generators/ParticleMeshGenerator.hpp
generators/PartitionDescriptor.hpp
generators/PrismUtilities.hpp
generators/WellGeneratorABC.hpp
generators/Region.hpp
generators/WellGeneratorBase.hpp
mpiCommunications/CommID.hpp
mpiCommunications/CommunicationTools.hpp
Expand Down Expand Up @@ -124,6 +127,8 @@ set( mesh_sources
ElementSubRegionBase.cpp
EmbeddedSurfaceNodeManager.cpp
EmbeddedSurfaceSubRegion.cpp
ExternalDataSourceBase.cpp
ExternalDataSourceManager.cpp
FaceElementSubRegion.cpp
FaceManager.cpp
MeshBody.cpp
Expand Down Expand Up @@ -156,9 +161,11 @@ set( mesh_sources
generators/InternalMeshGenerator.cpp
generators/InternalWellGenerator.cpp
generators/InternalWellboreGenerator.cpp
generators/MeshComponentBase.cpp
generators/MeshGeneratorBase.cpp
generators/ParMETISInterface.cpp
generators/ParticleMeshGenerator.cpp
generators/Region.cpp
generators/WellGeneratorBase.cpp
mpiCommunications/CommID.cpp
mpiCommunications/CommunicationTools.cpp
Expand All @@ -184,6 +191,7 @@ if( ENABLE_VTK )
set( mesh_headers ${mesh_headers}
generators/CollocatedNodes.hpp
generators/VTKFaceBlockUtilities.hpp
generators/VTKHierarchicalDataSource.hpp
generators/VTKMeshGenerator.hpp
generators/VTKMeshGeneratorTools.hpp
generators/VTKWellGenerator.hpp
Expand All @@ -192,6 +200,7 @@ if( ENABLE_VTK )
set( mesh_sources ${mesh_sources}
generators/CollocatedNodes.cpp
generators/VTKFaceBlockUtilities.cpp
generators/VTKHierarchicalDataSource.cpp
generators/VTKMeshGenerator.cpp
generators/VTKMeshGeneratorTools.cpp
generators/VTKWellGenerator.cpp
Expand Down
54 changes: 54 additions & 0 deletions src/coreComponents/mesh/ExternalDataSourceBase.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* ------------------------------------------------------------------------------------------------------------
* SPDX-License-Identifier: LGPL-2.1-only
*
* Copyright (c) 2018-2020 Lawrence Livermore National Security LLC
* Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University
* Copyright (c) 2018-2020 TotalEnergies
* Copyright (c) 2019- GEOSX Contributors
* All rights reserved
*
* See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
* ------------------------------------------------------------------------------------------------------------
*/

#include "ExternalDataSourceBase.hpp"

namespace geos
{
using namespace dataRepository;

ExternalDataSourceBase::ExternalDataSourceBase( string const & name, Group * const parent ):
Group( name, parent )
{
setInputFlags( InputFlags::OPTIONAL_NONUNIQUE );
}

Group * ExternalDataSourceBase::createChild( string const & childKey, string const & childName )
{
GEOS_LOG_RANK_0( "Adding External Data Source: " << childKey << ", " << childName );
std::unique_ptr< ExternalDataSourceBase > event = ExternalDataSourceBase::CatalogInterface::factory( childKey, childName, this );
return &this->registerGroup< ExternalDataSourceBase >( childName, std::move( event ) );
}

void ExternalDataSourceBase::expandObjectCatalogs()
{
// Only add children if the parent is of type EventManager
// otherwise, this would fall into a loop
if( strcmp( this->getParent().getName().c_str(), "ExternalDataSource" ) == 0 )
{
for( auto & catalogIter: ExternalDataSourceBase::getCatalog())
{
createChild( catalogIter.first, catalogIter.first );
}
}
}

ExternalDataSourceBase::CatalogInterface::CatalogType & ExternalDataSourceBase::getCatalog()
{
static ExternalDataSourceBase::CatalogInterface::CatalogType catalog;
return catalog;
}


}
77 changes: 77 additions & 0 deletions src/coreComponents/mesh/ExternalDataSourceBase.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*
* ------------------------------------------------------------------------------------------------------------
* SPDX-License-Identifier: LGPL-2.1-only
*
* Copyright (c) 2018-2020 Lawrence Livermore National Security LLC
* Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University
* Copyright (c) 2018-2020 TotalEnergies
* Copyright (c) 2019- GEOSX Contributors
* All rights reserved
*
* See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
* ------------------------------------------------------------------------------------------------------------
*/

/**
* @file ExternalDataSourceBase.hpp
*/

#ifndef GEOS_MESH_EXTERNALDATASOURCEBASE_HPP
#define GEOS_MESH_EXTERNALDATASOURCEBASE_HPP

#include "dataRepository/Group.hpp"
#include "dataRepository/WrapperBase.hpp"
#include "codingUtilities/Utilities.hpp"
#include "common/DataTypes.hpp"


namespace geos
{

/**
* @class ExternalDataSourceBase
* @brief The ExternalDataSourceBase class provides an abstract base class implementation for different mesh types.
* The ExternalDataSourceBase is the Group specialization for different type of mesh handling.
*/
class ExternalDataSourceBase : public dataRepository::Group
{
public:

/**
* @brief Main constructor for ExternalDataSourceBase base class.
* @param[in] name of the ExternalDataSourceBase object
* @param[in] parent the parent Group pointer for the ExternalDataSourceBase object
*/
explicit ExternalDataSourceBase( string const & name,
Group * const parent );

/// This function is used to expand any catalogs in the data structure
virtual void expandObjectCatalogs() override;

/// using alias for templated Catalog ExternalDataSourceBase type
using CatalogInterface = dataRepository::CatalogInterface< ExternalDataSourceBase, string const &, Group * const >;

/**
* @brief Create a new geometric object (box, plane, etc) as a child of this group.
* @param childKey the catalog key of the new geometric object to create
* @param childName the name of the new geometric object in the repository
* @return the group child
*/
virtual Group * createChild( string const & childKey, string const & childName ) override;

/**
* @brief Accessor for the singleton Catalog object
* @return a static reference to the Catalog object
*/
static CatalogInterface::CatalogType & getCatalog();

/**
* @brief This function provides the capability to open an external data repository
* from another component whatever its format.
*/
virtual void open() = 0;
};

}

#endif /* GEOS_MESH_EXTERNALDATASOURCEBASE_HPP */
Loading

0 comments on commit f72951b

Please sign in to comment.