Revision 8977f9f69dccdeecc339419aca193f3a8fcbe92e authored by Thomas Fischer on 08 July 2021, 13:11:06 UTC, committed by Dmitry Yu. Naumov on 09 July 2021, 10:13:49 UTC
1 parent 7d00a87
VariableType.h
/**
* \file
* \author Norbert Grunwald
* \date Sep 7, 2017
*
* \copyright
* Copyright (c) 2012-2021, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*/
#pragma once
#include <Eigen/Dense>
#include <array>
#include <string>
#include <variant>
namespace MaterialPropertyLib
{
/// Very simple vector data type for holding
/// a pair of values.
using Pair = std::array<double, 2>;
/// Very simple vector data type for holding
/// vector components.
using Vector = std::array<double, 3>;
/// Simple symmetric tensor data type for holding
/// xx, yy, zz, xy, xz, yz tensor components.
using SymmTensor = std::array<double, 6>;
/// Very simple 2d tensor data type for holding tensor components.
using Tensor2d = std::array<double, 4>;
/// Very simple tensor data type for holding
/// tensor components.
using Tensor = std::array<double, 9>;
/// Enum Variable is simply a list of all commonly used variables that are used
/// to determine the size of the VariableArray. If the variable of your choice
/// is missing, simply add it somewhere at the list, but above the last entry.
enum class Variable : int
{
capillary_pressure,
concentration,
density,
displacement,
effective_pore_pressure,
enthalpy_of_evaporation,
equivalent_plastic_strain,
grain_compressibility,
liquid_phase_pressure,
liquid_saturation,
mechanical_strain,
molar_mass,
molar_fraction,
phase_pressure,
porosity,
solid_grain_pressure,
stress,
temperature,
total_strain,
total_stress,
transport_porosity,
vapour_pressure,
volumetric_strain,
number_of_variables
};
static const std::array<std::string,
static_cast<int>(Variable::number_of_variables)>
variable_enum_to_string{{"capillary_pressure",
"concentration",
"density",
"displacement",
"effective_pore_pressure",
"enthalpy_of_evaporation",
"equivalent_plastic_strain",
"grain_compressibility",
"liquid_phase_pressure",
"liquid_saturation",
"mechanical_strain",
"molar_mass",
"molar_fraction",
"phase_pressure",
"porosity",
"solid_grain_pressure",
"stress",
"temperature",
"total_strain",
"total_stress",
"transport_porosity",
"vapour_pressure",
"volumetric_strain"}};
/// Data type for primary variables, designed to contain both scalar and vector
/// data.
using VariableType =
std::variant<std::monostate, double, Vector, Eigen::Matrix<double, 4, 1>,
Eigen::Matrix<double, 6, 1>>;
/// The VariableArray is a std::array of fixed size. Its size is determined by
/// the Variable enumerator list. Data type of that array is defined by the
/// VariableType definition.
using VariableArray =
std::array<VariableType, static_cast<int>(Variable::number_of_variables)>;
/// This function converts a string (e.g. a string from the configuration-tree)
/// into one of the entries of the VariableType enumerator.
Variable convertStringToVariable(std::string const& string);
} // namespace MaterialPropertyLib
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...