4#ifndef lethe_magnetic_permeability_model_h
5#define lethe_magnetic_permeability_model_h
25 static std::shared_ptr<MagneticPermeabilityModel>
34 static std::shared_ptr<MagneticPermeabilityModel>
59 value([[maybe_unused]]
const std::map<field, double> &field_values)
override
72 [[maybe_unused]]
const std::map<
field, std::vector<double>> &field_vectors,
73 std::vector<double> &property_vector)
override
106 const std::map<
field, std::vector<double>> & ,
107 [[maybe_unused]]
const field id,
108 std::vector<double> &jacobian_vector)
override
110 std::ranges::fill(jacobian_vector, 0);
127 const std::vector<double> &p_magnetic_permeability_polynomial_coefficients)
129 p_magnetic_permeability_polynomial_coefficients)
141 value(
const std::map<field, double> &field_values)
override
144 PhysicialPropertyModelFieldUndefined(
145 "PolynomialMagneticPermeability",
"temperature"));
151 for (
const auto &coefficient :
169 std::vector<double> &property_vector)
override
172 PhysicialPropertyModelFieldUndefined(
173 "PolynomialMagneticPermeability",
"temperature"));
177 for (
unsigned int i = 0; i < property_vector.size(); ++i)
183 for (
const auto &coefficient :
204 jacobian(
const std::map<field, double> &field_values,
const field id)
override
211 PhysicialPropertyModelFieldUndefined(
212 "PolynomialMagneticPermeability",
"temperature"));
215 unsigned int polynomial_order =
217 double magnetic_permeability_derivative =
222 for (
unsigned int i = 1; i < polynomial_order; ++i)
224 magnetic_permeability_derivative =
226 (polynomial_order - i) *
230 return magnetic_permeability_derivative;
251 std::vector<double> &jacobian_vector)
override
257 PhysicialPropertyModelFieldUndefined(
"PolynomialMagneticPermeability",
262 for (
unsigned int i = 0; i < jacobian_vector.size(); ++i)
265 unsigned int polynomial_order =
267 double magnetic_permeability_derivative =
270 for (
unsigned int j = 1; j < polynomial_order; ++j)
272 magnetic_permeability_derivative =
273 magnetic_permeability_derivative *
temperature[i] +
274 (polynomial_order - j) *
278 jacobian_vector[i] = magnetic_permeability_derivative;
283 std::ranges::fill(jacobian_vector, 0);
const double magnetic_permeability
ConstantMagneticPermeability(const double p_magnetic_permeability)
Default constructor.
void vector_jacobian(const std::map< field, std::vector< double > > &, const field id, std::vector< double > &jacobian_vector) override
Calculates, in a vector, the derivatives of the magnetic permeability with respect to a field.
void vector_value(const std::map< field, std::vector< double > > &field_vectors, std::vector< double > &property_vector) override
Calculates, in a vector, values of magnetic permeabilities.
double value(const std::map< field, double > &field_values) override
Calculates the value of the magnetic permeability.
double jacobian(const std::map< field, double > &, field) override
Calculates the jacobian (the partial derivative) of the magnetic permeability with respect to a field...
Abstract class that allows to calculate the magnetic permeability on each quadrature point.
static std::shared_ptr< MagneticPermeabilityModel > model_cast_imag(const Parameters::Material &material_properties)
Instantiates and returns a pointer to a MagneticPermeabilityModel object by casting it to the proper ...
static std::shared_ptr< MagneticPermeabilityModel > model_cast_real(const Parameters::Material &material_properties)
Instantiates and returns a pointer to a MagneticPermeabilityModel object by casting it to the proper ...
Material - Class that defines the physical property of a material. Generally a material will be a flu...
PhysicalPropertyModel()
Default constructor. Set the model_depends_on to false for all variables.
std::map< field, bool > model_depends_on
double jacobian(const std::map< field, double > &field_values, const field id) override
Calculates the jacobian (the partial derivative) of the magnetic permeability with respect to a field...
void vector_jacobian(const std::map< field, std::vector< double > > &field_vectors, const field id, std::vector< double > &jacobian_vector) override
Calculates, in a vector, the derivatives of the magnetic permeability with respect to a field.
void vector_value(const std::map< field, std::vector< double > > &field_vectors, std::vector< double > &property_vector) override
Calculates, in a vector, values of magnetic permeabilities.
PolynomialMagneticPermeability(const std::vector< double > &p_magnetic_permeability_polynomial_coefficients)
Default constructor.
const std::vector< double > magnetic_permeability_polynomial_coefficients
double value(const std::map< field, double > &field_values) override
Calculates the value of the magnetic permeability.
@ temperature
Temperature scalar field from heat transfer.