preCICE v3.2.0
Loading...
Searching...
No Matches
MeshConfiguration.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <list>
4#include <map>
5#include <memory>
6#include <string>
7#include <utility>
8#include <vector>
9#include "logging/Logger.hpp"
10#include "mesh/Data.hpp"
13#include "xml/XMLTag.hpp"
14
15namespace precice::mesh {
17}
18
19// ----------------------------------------------------------- CLASS DEFINITION
20
21namespace precice::mesh {
22
24public:
27 xml::XMLTag &parent,
29
31 const std::vector<PtrMesh> &meshes() const;
32
35
37 bool hasMeshName(const std::string &meshName) const;
38
40 mesh::PtrMesh getMesh(const std::string &meshName) const;
41
42 static mesh::PtrMesh getJustInTimeMappingMesh(int dimension);
43
44 void xmlTagCallback(const xml::ConfigurationContext &context, xml::XMLTag &callingTag) override;
45
47 const xml::ConfigurationContext &context,
48 xml::XMLTag &callingTag) override;
49
51
52 void addMesh(const mesh::PtrMesh &mesh);
53
58
59 void addNeededMesh(
60 const std::string &participant,
61 const std::string &mesh);
62
67
70 int dimensions);
71
72private:
73 logging::Logger _log{"mesh::MeshConfiguration"};
74
80
82
85
87 int getDataDimensions(const std::string &meshName, const Data::typeName typeName) const;
88
91
94
96
98};
99
100} // namespace precice::mesh
This class provides a lightweight logger.
Definition Logger.hpp:17
Performs and provides configuration for Data objects from XML files.
std::map< std::string, std::vector< std::string > > _neededMeshes
to check later if all meshes that any coupling scheme needs are actually used by the participants
std::vector< PtrMesh > _meshes
Configured meshes.
void xmlTagCallback(const xml::ConfigurationContext &context, xml::XMLTag &callingTag) override
Callback at begin of XML tag.
void addNeededMesh(const std::string &participant, const std::string &mesh)
void addMesh(const mesh::PtrMesh &mesh)
mesh::PtrMesh getMesh(const std::string &meshName) const
Returns the configured mesh with given name, or NULL.
std::unique_ptr< utils::ManageUniqueIDs > _meshIdManager
std::unique_ptr< utils::ManageUniqueIDs > extractMeshIdManager()
MeshConfiguration(xml::XMLTag &parent, PtrDataConfiguration config)
Constructor, takes a valid data configuration as argument.
const PtrDataConfiguration & getDataConfiguration() const
utils::ManageUniqueIDs _dataIDManager
void xmlEndTagCallback(const xml::ConfigurationContext &context, xml::XMLTag &callingTag) override
Callback at end of XML tag and at end of subtag.
bool hasMeshName(const std::string &meshName) const
Returns whether Mesh has Data with the dataName.
std::map< std::string, int > _meshDimensionsMap
static mesh::PtrMesh getJustInTimeMappingMesh(int dimension)
int getDataDimensions(const std::string &meshName, const Data::typeName typeName) const
Get the number of dimensions that data values of this type (scalar/vector) have on this mesh.
PtrDataConfiguration _dataConfig
Data configuration.
void insertMeshToMeshDimensionsMap(const std::string &mesh, int dimensions)
Initialize the map between meshes and dimensions, for unit tests that directly create mesh objects wi...
std::map< std::string, std::vector< std::string > > & getNeededMeshes()
const std::vector< PtrMesh > & meshes() const
Returns all configured meshes.
Manages a set of unique IDs.
Represents an XML tag to be configured automatically.
Definition XMLTag.hpp:28
provides Mesh, Data and primitives.
std::shared_ptr< DataConfiguration > PtrDataConfiguration
std::shared_ptr< Mesh > PtrMesh
Tightly coupled to the parameters of Participant()
Definition XMLTag.hpp:21
Callback interface for configuration classes using XMLTag.
Definition XMLTag.hpp:46