OGS
MaterialSpatialDistributionMap.h
Go to the documentation of this file.
1
12#pragma once
13
14#include <map>
15#include <memory>
16#include <range/v3/view.hpp>
17#include <vector>
18
19namespace MeshLib
20{
21template <typename PROP_VAL_TYPE>
22class PropertyVector;
23} // namespace MeshLib
24
25namespace MaterialPropertyLib
26{
27class Medium;
28
30{
31public:
33 std::map<int, std::shared_ptr<Medium>> const& media,
34 MeshLib::PropertyVector<int> const* const material_ids)
35 : media_(media), material_ids_(material_ids)
36 {
37 }
38
39 auto media() const { return media_ | ranges::views::values; }
40
41 Medium* getMedium(std::size_t element_id);
42 Medium const* getMedium(std::size_t element_id) const;
43 void checkElementHasMedium(std::size_t const element_id) const;
44
45private:
46 std::map<int, std::shared_ptr<Medium>> const& media_;
48};
49} // namespace MaterialPropertyLib
MeshLib::PropertyVector< int > const *const material_ids_
std::map< int, std::shared_ptr< Medium > > const & media_
MaterialSpatialDistributionMap(std::map< int, std::shared_ptr< Medium > > const &media, MeshLib::PropertyVector< int > const *const material_ids)