BELFEM 0.9.3
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
cl_MaterialFactory.hpp
Go to the documentation of this file.
1/*
2 * BELFEM -- The Berkeley Lab Finite Element Framework
3 * Copyright (c) 2026, The Regents of the University of California,
4 * through Lawrence Berkeley National Laboratory (subject to receipt of any required
5 * approvals from the U.S. Dept. of Energy). All rights reserved.
6 *
7 * Developers: Christian Messe, Gregory Giard
8 *
9 * See the top-level LICENSE file for the complete license and disclaimer.
10 */
11
12#ifndef CL_MATERIALFACTORY_HPP
13#define CL_MATERIALFACTORY_HPP
14
15#include "cl_Material.hpp"
16#include "cl_BhCurve.hpp"
17#include "cl_JcFunction.hpp"
18#include "cl_Input_Section.hpp"
19
20namespace belfem
21{
22//------------------------------------------------------------------------------
23
74 {
75
76 Map < string ,Material * > mMaterialsMap ; //the material map, with labels as keys
77
78 // the body of the input-section constructor; the constructor frees
79 // the map if it throws
80 void
81 create_materials( const input::Section * aSection, const bool aBuildTables );
82//------------------------------------------------------------------------------
83 public:
84//------------------------------------------------------------------------------
85
86 MaterialFactory() = default;
87
96 MaterialFactory( const input::Section * aSection,
97 const bool aBuildTables = true );
98
99 ~MaterialFactory() = default;
100
101//------------------------------------------------------------------------------
102
133 Material *
134 create_material( const string & aLabel,
135 const real aRRR = BELFEM_QUIET_NAN,
136 const bool aBuildTables = true );
137
138//------------------------------------------------------------------------------
139
140 enum class BuiltinKind
141 {
142 Iron,
143 OtherKnown,
144 Unknown
145 };
146
156 static BuiltinKind
157 builtin_kind( const string & aName );
158
167 static bool
168 curve_tolerates_builtin( const string & aValue );
169
176 static bool
177 is_pure_metal_label( const string & aLabel );
178
179//------------------------------------------------------------------------------
180
181 void
182 print_material_list( std::ostream & aStream );
183
184//------------------------------------------------------------------------------
185
239 Material *
240 create_material( const string & aLibraryPath, const string & aLabel );
241
242//------------------------------------------------------------------------------
243
244 Map <string, Material *> &
245 materials();
246
247//------------------------------------------------------------------------------
248
279 create_bh_curve( const string & aPath, const string & aLabel );
280
281//------------------------------------------------------------------------------
282
320 create_jc_function( const real aJc0, const real aB, const real aBc, const real aK );
321
322//------------------------------------------------------------------------------
323
364 create_jc_function( const string & aPath, const string & aLabel );
365
366//------------------------------------------------------------------------------
367
390 void
392 const input::Section * aSection,
393 const string & aLabel,
394 const string & aShape,
395 const Cell< string > & aKeys,
396 const Cell< string > & aSections );
397
398//------------------------------------------------------------------------------
399 };
400
401 inline Map <string, Material *> &
403 {
404 return mMaterialsMap ;
405 }
406
407//------------------------------------------------------------------------------
408}
409#endif //CL_MATERIALFACTORY_HPP
Base class hierarchy for critical current density (Jc) and n-value functions.
void check_unused_input(const input::Section *aSection, const string &aLabel, const string &aShape, const Cell< string > &aKeys, const Cell< string > &aSections)
refuse any key or subsection the resolved material shape does not read
Definition cl_MaterialFactory.cpp:556
static BuiltinKind builtin_kind(const string &aName)
Classify a builtin name the way create_material() resolves it.
Definition cl_MaterialFactory.cpp:663
BuiltinKind
Definition cl_MaterialFactory.hpp:141
Map< string, Material * > & materials()
Definition cl_MaterialFactory.hpp:402
Material * create_material(const string &aLabel, const real aRRR=BELFEM_QUIET_NAN, const bool aBuildTables=true)
Create a material by label.
Definition cl_MaterialFactory.cpp:629
static bool is_pure_metal_label(const string &aLabel)
Whether a name is an alias of a builtin pure metal.
Definition cl_MaterialFactory.cpp:735
material::BhCurve * create_bh_curve(const string &aPath, const string &aLabel)
Create a B-H curve from file for ferromagnetic materials.
Definition cl_MaterialFactory.cpp:809
void print_material_list(std::ostream &aStream)
Definition cl_MaterialFactory.cpp:750
static bool curve_tolerates_builtin(const string &aValue)
Whether a 'builtin' value may stand beside a b-h curve.
Definition cl_MaterialFactory.cpp:743
material::JcFunction * create_jc_function(const real aJc0, const real aB, const real aBc, const real aK)
Create a Jc function using the modified Kim analytical model.
Definition cl_MaterialFactory.cpp:818
Base class for all materials in BELFEM.
Definition cl_Material.hpp:270
One hierarchical section of a configuration file.
Definition cl_Input_Section.hpp:34
B-H curve for ferromagnetic materials.
Definition cl_BhCurve.hpp:61
Base class for critical current density (Jc) and n-value functions.
Definition cl_JcFunction.hpp:135
USER GUIDES:
Definition cl_Capacitor.cpp:16
double real
Definition typedefs.hpp:36
#define BELFEM_QUIET_NAN
Definition typedefs.hpp:86