OGS
Phase.h
Go to the documentation of this file.
1
12#pragma once
13
14#include <memory>
15#include <span>
16#include <string>
17#include <vector>
18
19#include "Component.h"
20
21namespace MaterialPropertyLib
22{
23class Property;
24}
25namespace MaterialPropertyLib
26{
31class Phase final
32{
33public:
35 Phase(std::string&& phase_name,
36 std::vector<std::unique_ptr<Component>>&& components,
37 std::unique_ptr<PropertyArray>&& properties);
38
41 Component const& component(std::size_t const& index) const;
42 bool hasComponent(std::size_t const& index) const;
43
45 Component const& component(std::string const& name) const;
46
49 Property const& property(PropertyType const& p) const;
50
51 Property const& operator[](PropertyType const& p) const;
52
53 bool hasProperty(PropertyType const& p) const;
54
56 std::size_t numberOfComponents() const;
57
59 std::string description() const;
60
61public:
62 std::string const name;
63
64private:
65 std::vector<std::unique_ptr<Component>> const components_;
66
73};
74
76 Phase const& phase,
77 std::span<PropertyType const> const required_properties);
78
79} // namespace MaterialPropertyLib
This class defines components (substances).
Definition Component.h:26
Property const & property(PropertyType const &p) const
Definition Phase.cpp:53
PropertyArray properties_
Definition Phase.h:72
std::string const name
Definition Phase.h:62
std::string description() const
Short description of the phase with its name.
Definition Phase.cpp:79
std::size_t numberOfComponents() const
A get-function for retrieving the number of components in this phase.
Definition Phase.cpp:74
std::vector< std::unique_ptr< Component > > const components_
Definition Phase.h:65
Property const & operator[](PropertyType const &p) const
Definition Phase.cpp:64
bool hasProperty(PropertyType const &p) const
Definition Phase.cpp:69
Phase(std::string &&phase_name, std::vector< std::unique_ptr< Component > > &&components, std::unique_ptr< PropertyArray > &&properties)
The Phase constructor is called with the optional phase name.
Definition Phase.cpp:22
bool hasComponent(std::size_t const &index) const
Definition Phase.cpp:38
Component const & component(std::size_t const &index) const
Definition Phase.cpp:33
void checkRequiredProperties(Component const &c, std::span< PropertyType const > const required_properties)
Definition Component.cpp:60
std::array< std::unique_ptr< Property >, PropertyType::number_of_properties > PropertyArray