User-defined critical current density (Jc) or power law exponent (n) function.
More...
|
| | JcFunctionUserDefined (Material *Mat) |
| | Constructor.
|
| | JcFunctionUserDefined (const JcFunctionUserDefined &)=delete |
| JcFunctionUserDefined & | operator= (const JcFunctionUserDefined &)=delete |
| | ~JcFunctionUserDefined () override=default |
| real | eval (const real normB, const real angle) const override |
| | Evaluate the function (2-parameter version).
|
| real | eval (const real normB, const real angle, const real T) const override |
| | Evaluate the function (3-parameter version).
|
| void | set_jc_function (MatFunc2 *Function) |
| | Set the user-defined function pointer (2-parameter version).
|
| void | set_jc_function (MatFunc3 *Function) |
| | Set the user-defined function pointer (3-parameter version).
|
| | JcFunction ()=default |
| | Default constructor.
|
| virtual | ~JcFunction ()=default |
| | Virtual destructor.
|
| bool | depends_on (const JcParameter aParameter) const |
| | Check if function depends on a parameter.
|
| virtual real | min_value () const |
| | Smallest value this function can return, when known.
|
| bool | is_constant () const |
| | Check if function is constant (no dependencies).
|
| virtual real | deval_dB (const real normB, const real angle, const real T) const |
| | Derivative of eval with respect to the field magnitude.
|
| virtual real | deval_dbeta (const real normB, const real angle, const real T) const |
| | Derivative of eval with respect to the field angle.
|
| virtual real | deval_dT (const real normB, const real angle, const real T) const |
| | Derivative of eval with respect to temperature.
|
User-defined critical current density (Jc) or power law exponent (n) function.
This class provides a wrapper for user-defined functions that compute Jc or n for superconducting materials. It supports both 2-parameter and 3-parameter function signatures:
- MatFunc2: f(Material*, normB, angle) - Field and angle dependent
- MatFunc3: f(Material*, normB, angle, T) - Field, angle, and temperature dependent
ANGLE CONTRACT (changed 2026-08-16): the angle is the UNFOLDED field-to-tape-normal angle θ ∈ [0, π] — before that change it arrived folded into [0, π/2]. A user function that is even in θ (cos², sin² only) is unaffected; one that used cos(θ) linearly or assumed θ ≤ π/2 must fold internally now. Plugins compiled against the old contract get the new angle silently — recompile and review.
The user provides a function pointer that will be called to evaluate the property. This allows complete customization while maintaining compatibility with the material framework.
IMPORTANT: This class is typically created and managed by UserDefinedMaterial. The material owns the JcFunctionUserDefined instance and will delete it.
Example usage (within a user-defined material library):
return 1e9 / (1.0 + B/5.0) * exp(-T/90.0);
}
extern "C" void MyMaterial_init(
Material* mat) {
&my_jc_function
);
}
Base class for all materials in BELFEM.
Definition cl_Material.hpp:279
virtual void set_user_defined_function(const MaterialProperty Property, const MaterialDependency Dependency, MatFunc1 *Function)
Set a user-defined function with one dependency (for UserDefinedMaterial).
Definition cl_Material.cpp:749
@ angleNxB
Definition cl_Material.hpp:125
@ normB
Definition cl_Material.hpp:123
@ T
Definition cl_Material.hpp:122
@ jc
Definition cl_Material.hpp:186
double real
Definition typedefs.hpp:36