-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add ExternalDataRepository #2957
Merged
Merged
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
3f91020
add ExternalDataRepository
6e9a4c3
feat: Add Region keyword to load parts of VTK HierarchicalData
dc2b148
wip: working example
4b2dc13
wip: add example of vtk composite data
08e4d2e
fix: add user visibility to MeshComponentBase hierarchy
de8f546
chore: add more doc
8ce3644
chore(doc): again
83dcaac
chore(doc): again
c51863a
wip: only read on one rank
bbe6954
Update src/coreComponents/mesh/generators/VTKMeshGenerator.cpp
paveltomin 13b68a8
Merge branch 'develop' into feature/untereiner/meshbase
paveltomin c9d7f3f
rename
8e39f24
Merge branch 'feature/untereiner/meshbase' of https://github.com/GEOS…
aade072
finish rename
28dd7bd
Update FieldCaseTutorial3_composite_smoke.xml
paveltomin c1916d3
Update CMakeLists.txt
paveltomin ee3780f
Update CMakeLists.txt
paveltomin 38cd065
Update schema.xsd
paveltomin 83eef3e
Update schema.xsd.other
paveltomin 726417d
Merge branch 'develop' into feature/untereiner/meshbase
MelReyCG 2be6e57
Merge branch 'develop' into feature/untereiner/meshbase
paveltomin 8b6b325
Merge remote-tracking branch 'origin/develop' into feature/untereiner…
MelReyCG ce78f90
missing const
MelReyCG 493bed2
build fix
4dcdba1
Merge branch 'develop' into feature/untereiner/meshbase
paveltomin 00a5616
Update VTKPolyDataWriterInterface.cpp
paveltomin e116f1b
Update VTKMeshGenerator.cpp
paveltomin 75dae46
revert cosmetic
f1e8e29
remove unused
ff99ac0
bug fix
a4ec2d4
Update .integrated_tests.yaml
paveltomin f4cb9c0
Update BASELINE_NOTES.md
paveltomin 71a6e51
Update Region.cpp
paveltomin 9b5a132
revert
ebc60b9
Merge branch 'feature/untereiner/meshbase' of https://github.com/GEOS…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "ExternalDataRepositoryBase.hpp" | ||
|
||
namespace geos | ||
{ | ||
using namespace dataRepository; | ||
|
||
ExternalDataRepositoryBase::ExternalDataRepositoryBase( string const & name, Group * const parent ): | ||
Group( name, parent ) | ||
{ | ||
setInputFlags( InputFlags::OPTIONAL_NONUNIQUE ); | ||
} | ||
|
||
Group * ExternalDataRepositoryBase::createChild( string const & childKey, string const & childName ) | ||
{ | ||
GEOS_LOG_RANK_0( "Adding External Data Repository: " << childKey << ", " << childName ); | ||
std::unique_ptr< ExternalDataRepositoryBase > event = ExternalDataRepositoryBase::CatalogInterface::factory( childKey, childName, this ); | ||
return &this->registerGroup< ExternalDataRepositoryBase >( childName, std::move( event ) ); | ||
} | ||
|
||
void ExternalDataRepositoryBase::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(), "ExternalDataRepository" ) == 0 ) | ||
{ | ||
for( auto & catalogIter: ExternalDataRepositoryBase::getCatalog()) | ||
{ | ||
createChild( catalogIter.first, catalogIter.first ); | ||
} | ||
} | ||
} | ||
|
||
ExternalDataRepositoryBase::CatalogInterface::CatalogType & ExternalDataRepositoryBase::getCatalog() | ||
{ | ||
static ExternalDataRepositoryBase::CatalogInterface::CatalogType catalog; | ||
return catalog; | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ExternalDataRepositoryBase.hpp | ||
*/ | ||
|
||
#ifndef GEOS_MESH_EXTERNALDATAREPOSITORYBASE_HPP | ||
#define GEOS_MESH_EXTERNALDATAREPOSITORYBASE_HPP | ||
|
||
#include "dataRepository/Group.hpp" | ||
#include "dataRepository/WrapperBase.hpp" | ||
#include "codingUtilities/Utilities.hpp" | ||
#include "common/DataTypes.hpp" | ||
|
||
|
||
namespace geos | ||
{ | ||
|
||
/** | ||
* @class ExternalDataRepositoryBase | ||
* @brief The ExternalDataRepositoryBase class provides an abstract base class implementation for different mesh types. | ||
* The ExternalDataRepositoryBase is the Group specialization for different type of mesh handling. | ||
*/ | ||
class ExternalDataRepositoryBase : public dataRepository::Group | ||
{ | ||
public: | ||
|
||
/** | ||
* @brief Main constructor for ExternalDataRepositoryBase base class. | ||
* @param[in] name of the ExternalDataRepositoryBase object | ||
* @param[in] parent the parent Group pointer for the ExternalDataRepositoryBase object | ||
*/ | ||
explicit ExternalDataRepositoryBase( 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 ExternalDataRepositoryBase type | ||
using CatalogInterface = dataRepository::CatalogInterface< ExternalDataRepositoryBase, 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 | ||
* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would write the documentation at the abstraction level and use |
||
*/ | ||
virtual void open() = 0; | ||
}; | ||
|
||
} | ||
|
||
#endif /* GEOS_MESH_ExternalDataRepositoryBase_HPP */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
* ------------------------------------------------------------------------------------------------------------ | ||
* SPDX-License-Identifier: LGPL-2.1-only | ||
* | ||
* Copyright (c) 2016-2024 Lawrence Livermore National Security LLC | ||
* Copyright (c) 2018-2024 Total, S.A | ||
* Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University | ||
* Copyright (c) 2023-2024 Chevron | ||
* Copyright (c) 2019- GEOS/GEOSX Contributors | ||
* All rights reserved | ||
* | ||
* See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. | ||
* ------------------------------------------------------------------------------------------------------------ | ||
*/ | ||
|
||
|
||
#include "ExternalDataRepositoryManager.hpp" | ||
#include "ExternalDataRepositoryBase.hpp" | ||
|
||
|
||
namespace geos | ||
{ | ||
|
||
using namespace dataRepository; | ||
|
||
ExternalDataRepositoryManager::ExternalDataRepositoryManager( string const & name, | ||
Group * const parent ): | ||
Group( name, parent ) | ||
{ | ||
setInputFlags( InputFlags::REQUIRED ); | ||
} | ||
|
||
ExternalDataRepositoryManager::~ExternalDataRepositoryManager() | ||
{} | ||
|
||
Group * ExternalDataRepositoryManager::createChild( string const & childKey, string const & childName ) | ||
{ | ||
GEOS_LOG_RANK_0( "Adding External Data Repository: " << childKey << ", " << childName ); | ||
std::unique_ptr< ExternalDataRepositoryBase > externalDataRepo = ExternalDataRepositoryBase::CatalogInterface::factory( childKey, childName, this ); | ||
return &this->registerGroup< ExternalDataRepositoryBase >( childName, std::move( externalDataRepo ) ); | ||
} | ||
|
||
|
||
void ExternalDataRepositoryManager::expandObjectCatalogs() | ||
{ | ||
// During schema generation, register one of each type derived from ExternalDataRepositoryBase here | ||
for( auto & catalogIter: ExternalDataRepositoryBase::getCatalog()) | ||
{ | ||
createChild( catalogIter.first, catalogIter.first ); | ||
} | ||
} | ||
|
||
|
||
void ExternalDataRepositoryManager::open( DomainPartition & GEOS_UNUSED_PARAM( domain ) ) | ||
{ | ||
forSubGroups< ExternalDataRepositoryBase >( []( ExternalDataRepositoryBase & external ) | ||
{ | ||
external.open(); | ||
} ); | ||
} | ||
|
||
|
||
} /* namespace geos */ |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rrsettgast is this ok?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is fine...but why is this needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reverted