Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions src/coreComponents/mesh/generators/VTKMeshGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ VTKMeshGenerator::VTKMeshGenerator( string const & name,
: ExternalMeshGeneratorBase( name, parent ),
m_dataSource( nullptr )
{
getWrapperBase( ExternalMeshGeneratorBase::viewKeyStruct::filePathString()).
getWrapperBase( viewKeyStruct::filePathString()).
setInputFlag( InputFlags::OPTIONAL );

registerWrapper( viewKeyStruct::regionAttributeString(), &m_regionAttributeName ).
Expand Down Expand Up @@ -101,14 +101,18 @@ void VTKMeshGenerator::postInputInitialization()
{
ExternalMeshGeneratorBase::postInputInitialization();

GEOS_ERROR_IF( !this->m_filePath.empty() && !m_dataSourceName.empty(),
getDataContext() << ": Access to the mesh via file or data source are mutually exclusive. "
"You can't set " << viewKeyStruct::dataSourceString() << " or " << viewKeyStruct::meshPathString() << " and " <<
ExternalMeshGeneratorBase::viewKeyStruct::filePathString() );
GEOS_ERROR_IF( m_filePath.empty() && m_dataSourceName.empty(),
GEOS_FMT( "{}: Either {} or {} must be specified.",
getDataContext(), viewKeyStruct::filePathString(), viewKeyStruct::dataSourceString() ) );

GEOS_ERROR_IF( !m_filePath.empty() && !m_dataSourceName.empty(),
GEOS_FMT( "{}: Access to the mesh via file and data source are mutually exclusive. "
"You can't set both {} and {} at the same time.",
getDataContext(), viewKeyStruct::filePathString(), viewKeyStruct::dataSourceString() ) );

if( !m_dataSourceName.empty())
{
ExternalDataSourceManager & externalDataManager = this->getGroupByPath< ExternalDataSourceManager >( "/Problem/ExternalDataSource" );
ExternalDataSourceManager & externalDataManager = getGroupByPath< ExternalDataSourceManager >( "/Problem/ExternalDataSource" );

m_dataSource = externalDataManager.getGroupPointer< VTKHierarchicalDataSource >( m_dataSourceName );

Expand Down Expand Up @@ -150,9 +154,9 @@ void VTKMeshGenerator::fillCellBlockManager( CellBlockManager & cellBlockManager
stdVector< vtkSmartPointer< vtkPartitionedDataSet > > partitions;
vtkNew< vtkAppendFilter > appender;
appender->MergePointsOn();
for( auto & [key, value] : this->getSubGroups())
for( auto & [key, value] : getSubGroups())
{
Region const & region = this->getGroup< Region >( key );
Region const & region = getGroup< Region >( key );

string path = region.getWrapper< string >( Region::viewKeyStruct::pathInRepositoryString()).reference();
integer region_id = region.getWrapper< integer >( Region::viewKeyStruct::idString()).reference();
Expand Down Expand Up @@ -220,7 +224,7 @@ void VTKMeshGenerator::fillCellBlockManager( CellBlockManager & cellBlockManager
m_cellMap = vtk::buildCellMap( *m_vtkMesh, m_regionAttributeName );

GEOS_LOG_LEVEL_RANK_0( logInfo::VTKSteps, GEOS_FMT( "{} '{}': writing nodes...", catalogName(), getName() ) );
writeNodes( getLogLevel(), *m_vtkMesh, m_nodesetNames, cellBlockManager, this->m_translate, this->m_scale );
writeNodes( getLogLevel(), *m_vtkMesh, m_nodesetNames, cellBlockManager, m_translate, m_scale );

GEOS_LOG_LEVEL_RANK_0( logInfo::VTKSteps, GEOS_FMT( "{} '{}': writing cells...", catalogName(), getName() ) );
writeCells( getLogLevel(), *m_vtkMesh, m_cellMap, m_structuredIndexAttributeName, cellBlockManager );
Expand Down
6 changes: 1 addition & 5 deletions src/coreComponents/mesh/generators/VTKMeshGenerator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class VTKMeshGenerator : public ExternalMeshGeneratorBase
private:

///@cond DO_NOT_DOCUMENT
struct viewKeyStruct
struct viewKeyStruct : public ExternalMeshGeneratorBase::viewKeyStruct
{
constexpr static char const * regionAttributeString() { return "regionAttribute"; }
constexpr static char const * structuredIndexAttributeString() { return "structuredIndexAttribute"; }
Expand All @@ -116,7 +116,6 @@ class VTKMeshGenerator : public ExternalMeshGeneratorBase
constexpr static char const * partitionMethodString() { return "partitionMethod"; }
constexpr static char const * useGlobalIdsString() { return "useGlobalIds"; }
constexpr static char const * dataSourceString() { return "dataSourceName"; }
constexpr static char const * meshPathString() { return "meshPath"; }
};

struct groupKeyStruct
Expand Down Expand Up @@ -174,9 +173,6 @@ class VTKMeshGenerator : public ExternalMeshGeneratorBase
/// Repository name
string m_dataSourceName;

/// path to the mesh in the repository
string m_meshPath;

/// Repository of VTK objects
VTKHierarchicalDataSource * m_dataSource;

Expand Down
Loading