From 3437e239d602fc6e42c89d73f4f826bef2de6e3c Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Thu, 16 Oct 2025 10:25:43 -0500 Subject: [PATCH] fix: vtk - add a missing file path error --- .../mesh/generators/VTKMeshGenerator.cpp | 22 +++++++++++-------- .../mesh/generators/VTKMeshGenerator.hpp | 6 +---- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/coreComponents/mesh/generators/VTKMeshGenerator.cpp b/src/coreComponents/mesh/generators/VTKMeshGenerator.cpp index e6023216c29..db8c899cd91 100644 --- a/src/coreComponents/mesh/generators/VTKMeshGenerator.cpp +++ b/src/coreComponents/mesh/generators/VTKMeshGenerator.cpp @@ -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 ). @@ -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 ); @@ -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(); @@ -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 ); diff --git a/src/coreComponents/mesh/generators/VTKMeshGenerator.hpp b/src/coreComponents/mesh/generators/VTKMeshGenerator.hpp index b99145b85a0..cd968c2abd4 100644 --- a/src/coreComponents/mesh/generators/VTKMeshGenerator.hpp +++ b/src/coreComponents/mesh/generators/VTKMeshGenerator.hpp @@ -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"; } @@ -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 @@ -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;