12#ifndef BELFEM_CL_MATERIAL_USERDEFINED_HPP
13#define BELFEM_CL_MATERIAL_USERDEFINED_HPP
26 template <
typename T >
28 polyval(
const std::vector< T > & coeffs,
const T x )
30 const index_t n = coeffs.size() ;
44 template <
typename T >
46 dpolyval(
const std::vector< T > & coeffs,
const T x )
48 const index_t n = coeffs.size() - 1 ;
50 T dydx = p * coeffs[ 0 ];
56 dydx += p * coeffs[ k ];
146 MatFunc2 * mUserMuFunction = nullptr ;
147 MatFunc3 * mUserRhoFunction = nullptr ;
148 MatFunc3 * mUserLambdaFunction = nullptr ;
305 const std::vector< real > & Coefficients )
override ;
321 const real T )
const override ;
326 const real T )
const override ;
362 return ( * mUserLambdaFunction ) (
this, T, normB, angle );
376 return ( * mUserRhoFunction ) (
this, T, normB, angle );
411 return ( this->*mMuFunction )(
H, T );
418 mu_polynomial(
const real H,
const real T )
const
425 mu_user(
const real H,
const real T )
const
427 return mUserMuFunction(
this,
H, T );
440 BELFEM_ASSERT( mPolynomials(
static_cast<size_t>(Property) ).size() > 0,
441 "return polynomial for %s of %s is not defined",
443 this->
label().c_str()
446 return polyval( mPolynomials(
static_cast<size_t>(Property) ).vector_data(), T );
452 BELFEM_ASSERT( mPolynomials(
static_cast<size_t>(Property) ).size() > 0,
453 "return polynomial for %s of %s is not defined",
455 this->
label().c_str()
458 return dpolyval( mPolynomials(
static_cast<size_t>(Property) ).vector_data(), T );
#define BELFEM_ASSERT(aCheck,...)
Definition assert.hpp:244
virtual real H(const real B) const
Magnetic field strength from flux density.
Definition cl_Material.hpp:2137
Material(const MaterialType aType, const bool aIsIsotropic=true)
Constructor.
Definition cl_Material.cpp:149
const string & label() const
Get material label.
Definition cl_Material.hpp:1683
void set_user_defined_polynomial(const MaterialProperty Property, const Cell< real > &Coefficients) override
Set a polynomial function for a material property.
Definition cl_Material_UserDefined.cpp:230
real nu_custom(const real T) const override
Custom Poisson's ratio evaluation - calls user function.
Definition cl_Material_UserDefined.hpp:339
real jc_custom(const real T) const override
Custom jc evaluation (temperature only) - calls user function.
Definition cl_Material_UserDefined.hpp:381
real Rp02_custom(const real T) const override
Custom 0.2% proof stress evaluation - calls user function.
Definition cl_Material_UserDefined.hpp:402
real alpha_custom(const real T) const override
Custom thermal expansion coefficient evaluation - calls user function.
Definition cl_Material_UserDefined.hpp:395
real cp_custom(const real T) const override
Custom specific heat evaluation - calls user function.
Definition cl_Material_UserDefined.hpp:346
real n_custom(const real T) const override
Custom n evaluation (temperature only) - calls user function.
Definition cl_Material_UserDefined.hpp:388
real E_custom(const real T) const override
Custom Young's modulus evaluation - calls user function.
Definition cl_Material_UserDefined.hpp:332
real mu_custom(const real H, const real T) const override
Custom magnetic permeability evaluation - dispatches to polynomial or user function.
Definition cl_Material_UserDefined.hpp:409
real evaluate_polynomial(const MaterialProperty Property, const real T) const override
Evaluate a polynomial function for a given property and temperature.
Definition cl_Material_UserDefined.hpp:438
UserDefinedMaterial(const string &aLibraryPath, const string &aLabel)
Constructor - loads and initializes user-defined material.
Definition cl_Material_UserDefined.cpp:24
real lambda_custom(const real T, const real normB, const real angle) const override
Custom thermal conductivity evaluation (with field) - calls user function.
Definition cl_Material_UserDefined.hpp:360
real lambda_custom(const real T) const override
Custom thermal conductivity evaluation (temperature only) - calls user function.
Definition cl_Material_UserDefined.hpp:353
real rho_kohler(const real T, const real normB, const real angle) const override
Custom electrical resistivity evaluation (with field) - calls user function.
Definition cl_Material_UserDefined.hpp:374
void set_user_defined_function(const MaterialProperty Property, const MaterialDependency Dependency, MatFunc1 *Function) override
Set a user-defined function with one dependency (typically temperature).
Definition cl_Material_UserDefined.cpp:55
real rho_custom(const real T) const override
Custom electrical resistivity evaluation (temperature only) - calls user function.
Definition cl_Material_UserDefined.hpp:367
real evaluate_derivative_of_polynomial(const MaterialProperty Property, const real T) const override
Definition cl_Material_UserDefined.hpp:450
Definition cl_BhCurve.cpp:19
T dpolyval(const std::vector< T > &coeffs, const T x)
Definition cl_Material_UserDefined.hpp:46
T polyval(const std::vector< T > &coeffs, const T x)
Definition cl_Material_UserDefined.hpp:28
@ T
Definition cl_JcFunction.hpp:83
USER GUIDES:
Definition cl_Capacitor.cpp:16
MaterialDependency
Dependencies that material properties can have.
Definition cl_Material.hpp:121
real MatFunc1(const Material *, const real)
Definition cl_Material.hpp:241
real MatFunc3(const Material *, const real, const real, const real)
Definition cl_Material.hpp:243
MaterialProperty
All material properties that can be defined.
Definition cl_Material.hpp:153
@ nu
Definition cl_Material.hpp:156
@ alpha
Definition cl_Material.hpp:161
@ E
Definition cl_Material.hpp:155
@ n
Definition cl_Material.hpp:187
@ rho
Definition cl_Material.hpp:160
@ mu
Definition cl_Material.hpp:159
@ lambda
Definition cl_Material.hpp:158
@ cp
Definition cl_Material.hpp:157
@ Rp02
Definition cl_Material.hpp:162
@ jc
Definition cl_Material.hpp:186
uint32_t index_t
Definition typedefs.hpp:52
real MatFunc2(const Material *, const real, const real)
Definition cl_Material.hpp:242
double real
Definition typedefs.hpp:36
string to_string(const DomainType aDomainType)
Definition en_DomainType.cpp:21