6#include <deal.II/base/exceptions.h>
11#include <prismspf/config.h>
29 std::string _name =
"",
31 bool _is_nucleation_rate_variable =
false,
32 std::vector<Types::Index> _nucleating_field_indices = std::vector<Types::Index>())
63inline std::map<std::string, Types::Index>
66 std::map<std::string, Types::Index> map;
67 for (
unsigned int i = 0; i < fields.size(); ++i)
69 AssertThrow(map.find(fields[i].name) == map.end(),
71 "The names of the fields are not unique. This is not allowed."));
72 map[fields[i].name] = i;
80inline std::map<std::string, FieldAttributes>
81field_map(
const std::vector<FieldAttributes> &fields)
83 std::map<std::string, FieldAttributes> map;
86 AssertThrow(map.find(field.name) == map.end(),
88 "The names of the fields are not unique. This is not allowed."));
89 map[field.name] = field;
98PRISMS_PF_END_NAMESPACE
std::map< std::string, Types::Index > field_index_map(const std::vector< FieldAttributes > &fields)
Make a map that maps field names to field indices.
Definition field_attributes.h:64
std::map< std::string, FieldAttributes > field_map(const std::vector< FieldAttributes > &fields)
Make a map that maps field names to field attributes.
Definition field_attributes.h:81
Definition conditional_ostreams.cc:20
Definition vectorized_operations.h:17
Structure to hold the attributes of a field. This includes things like the name, rank,...
Definition field_attributes.h:24
TensorRank field_type
Field type (Scalar/Vector).
Definition field_attributes.h:47
std::vector< Types::Index > nucleating_field_indices
If this is a nucleation rate, the indices of the nucleating fields.
Definition field_attributes.h:57
bool is_nucleation_rate_variable
Is a nucleation rate.
Definition field_attributes.h:52
FieldAttributes(std::string _name="", TensorRank _field_type=TensorRank::Scalar, bool _is_nucleation_rate_variable=false, std::vector< Types::Index > _nucleating_field_indices=std::vector< Types::Index >())
Constructor.
Definition field_attributes.h:28
std::string name
Field name.
Definition field_attributes.h:42
TensorRank
Tensor rank of the field.
Definition type_enums.h:30
@ Scalar
Definition type_enums.h:32