Commit 219db39d authored by Jakub Klinkovský's avatar Jakub Klinkovský Committed by Jakub Klinkovský
Browse files

Added convenient overload of the loadMesh function for non-distributed meshes

parent a0133466
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
#include <TNL/Meshes/Readers/VTKReader.h>
#include <TNL/Meshes/TypeResolver/GridTypeResolver.h>
#include <TNL/Meshes/TypeResolver/MeshTypeResolver.h>
#include <TNL/Communicators/NoDistrCommunicator.h>

// TODO: implement this in TNL::String
inline bool ends_with( const std::string& value, const std::string& ending )
@@ -278,5 +279,16 @@ decomposeMesh( const Config::ParameterContainer& parameters,
      return true;
}

// convenient overload for non-distributed meshes
template< typename Mesh >
bool
loadMesh( const String& fileName, Mesh& mesh )
{
   using Communicator = TNL::Communicators::NoDistrCommunicator;
   using DistributedMesh = DistributedMeshes::DistributedMesh< Mesh>;
   DistributedMesh distributedMesh;
   return loadMesh< Communicator >( fileName, mesh, distributedMesh );
}

} // namespace Meshes
} // namespace TNL