PLaSK library
|
Materials database. More...
#include <plask/material/db.hpp>
Classes | |
struct | DelegateMaterialConstructor |
Specialization of this implements MaterialConstructor. More... | |
struct | DelegateMaterialConstructor< MaterialType, false, false > |
struct | DelegateMaterialConstructor< MaterialType, false, true > |
struct | DelegateMaterialConstructor< MaterialType, true, false > |
struct | DelegateMaterialConstructor< MaterialType, true, true > |
struct | DummyMixedCompositionFactory |
Dummy mixed factory for use in draft mode. More... | |
struct | MaterialConstructor |
Object of this class (inherited from it) construct material instance. More... | |
struct | MixedCompositionAndDopantFactory |
Factory of alloy material which construct its versions with mixed version of two compositions and dopants. More... | |
struct | MixedCompositionFactory |
Base class for factories of alloy materials which construct their versions with mixed compositions and/or doping amounts. More... | |
struct | MixedCompositionOnlyFactory |
Factory of alloy material which construct it version with mixed version of two compositions (for materials without dopants). More... | |
struct | MixedDopantFactory |
Factory of alloy material which construct its versions with mixed versions of two dopants (for material with same compositions). More... | |
class | ProxyMaterialConstructor |
Material constructor that holds other constructor or complete material object based on the provided name. More... | |
struct | Register |
Helper which calls getDefault().add<MaterialType>([name]) in constructor. More... | |
struct | RegisterUnderName |
Same as Register but for materials without static field NAME. More... | |
Public Types | |
typedef TemporaryReplaceDefault | TemporaryClearDefault |
typedef boost::transform_iterator< iter_val, constructors_map_t::const_iterator > | iterator |
Iterator over material constructors (shared_ptr<shared_ptr<const MaterialConstructor>>). | |
typedef iterator | const_iterator |
Iterator over material constructors (shared_ptr<shared_ptr<const MaterialConstructor>>). | |
Public Member Functions | |
void | clear () |
Clear the database. | |
void | update (const MaterialsDB &src) |
Update with values from different database. | |
const_iterator | begin () const |
Get iterator which refer to first record in database. | |
const_iterator | end () const |
Get iterator which refer one step after last record in database. | |
size_t | size () const |
Get number of material types in database. | |
shared_ptr< Material > | get (const Material::Composition &composition, const std::string &label, const std::string &dopant_name="", double doping=0.0) const |
Create material object. | |
shared_ptr< Material > | get (const std::string &name_with_dopant, double doping) const |
Create material object. | |
shared_ptr< const MaterialConstructor > | getConstructor (const std::string &name_without_composition) const |
Get constructor of material. | |
shared_ptr< Material > | get (const Material::Parameters ¶m) const |
shared_ptr< Material > | get (const std::string &full_name) const |
Create material object. | |
shared_ptr< MixedCompositionFactory > | getFactory (const std::string &material1_fullname, const std::string &material2_fullname, double shape=1.) const |
Construct mixed material factory. | |
void | addSimple (shared_ptr< MaterialConstructor > constructor) |
Add simple material (which does snot require composition parsing) to DB. | |
void | addAlloy (shared_ptr< MaterialConstructor > constructor) |
Add alloy material (which require composition parsing) to DB. | |
template<typename MaterialType , bool requireComposition, bool requireDopant> | |
void | add (const std::string &name) |
Add material to DB. | |
template<typename MaterialType > | |
void | add (const std::string &name) |
Add material to DB. | |
template<typename MaterialType > | |
void | add () |
Add material to DB. | |
void | remove (const std::string &name) |
Remove material from DB. | |
bool | isAlloy (const std::string &material_name) const |
Check if a material (given without parameters) is simple. | |
shared_ptr< const MaterialConstructor > | getConstructor (const Material::Composition &composition, const std::string &label="", const std::string &dopant_name="") const |
shared_ptr< const MaterialConstructor > | getConstructor (const Material::Parameters &material, bool allow_alloy_without_composition=false) const |
TemporaryReplaceDefault (const TemporaryReplaceDefault &)=delete | |
TemporaryReplaceDefault & | operator= (const TemporaryReplaceDefault &)=delete |
TemporaryReplaceDefault (TemporaryReplaceDefault &&)=delete | |
TemporaryReplaceDefault & | operator= (TemporaryReplaceDefault &&)=delete |
TemporaryReplaceDefault (MaterialsDB temporaryValue=MaterialsDB()) | |
Construct an object which replace default database with temporaryValue and revert its original state in destructor. | |
~TemporaryReplaceDefault () | |
Static Public Member Functions | |
static MaterialsDB & | getDefault () |
Get default material database. | |
static void | loadToDefault (const std::string &fileName_mainpart) |
Load materials from file (dynamic library which is in plask directory with materials) to default database. | |
static void | loadAllToDefault (const std::string &dir=plaskMaterialsPath()) |
Load all materials from given dir (plask materials directory by default) to default database. | |
static void | ensureCompositionIsNotEmpty (const Material::Composition &composition) |
Throw exception if given composition is empty. | |
Public Attributes | |
MaterialInfo::DB | info |
Info for this database. | |
MaterialsDB | toRevert |
Materials database.
Create materials with given name, composition and dopant.
typedef boost::transform_iterator<iter_val, constructors_map_t::const_iterator> plask::MaterialsDB::iterator |
|
inline |
Add material to DB.
Replace existing material if there is one already in DB.
Use DelegateMaterialConstructor as material construction object. Deduce from constructors if material needs either composition or dopant information. Material name is read from static field MaterialType::NAME.
Add material to DB.
Replace existing material if there is one already in DB.
Use DelegateMaterialConstructor as material construction object.
name | material name (with dopant after ':') |
MaterialType,requireComposition,requireDopant | see DelegateMaterialConstructor |
|
inline |
Add material to DB.
Replace existing material if there is one already in DB.
Use DelegateMaterialConstructor as material construction object. Deduce from constructors if material needs either composition or dopant information.
name | material name (with dopant after ':') |
void plask::MaterialsDB::addAlloy | ( | shared_ptr< MaterialConstructor > | constructor | ) |
void plask::MaterialsDB::addSimple | ( | shared_ptr< MaterialConstructor > | constructor | ) |
|
inline |
|
inline |
|
static |
shared_ptr< Material > plask::MaterialsDB::get | ( | const Material::Composition & | composition, |
const std::string & | label, | ||
const std::string & | dopant_name = "" , |
||
double | doping = 0.0 |
||
) | const |
Create material object.
composition | complete objects composition |
dopant_name | name of dopant (if any) |
doping | amount of dopant |
NoSuchMaterial | if database doesn't know material with name parsed_name_with_donor |
shared_ptr< Material > plask::MaterialsDB::get | ( | const Material::Parameters & | param | ) | const |
Create material object.
full_name | material name, with encoded parameters in format composition[:dopant], see get(const std::string&, const std::string&) |
full_name
NoSuchMaterial | if material with given name not exists |
MaterialParseException | if can't parse full_name |
shared_ptr< Material > plask::MaterialsDB::get | ( | const std::string & | name_with_dopant, |
double | doping | ||
) | const |
Create material object.
parsed_name_with_dopant | material name with dopant name in format material_name[:dopant_name], for example: "AlGaN" or "AlGaN:Mg" |
composition | amounts of objects, with NaN for each object for which composition was not given |
doping | amount of dopant |
NoSuchMaterial | if database doesn't know material with name parsed_name_with_donor Create material object. |
name_with_dopant | material name with dopant name in format material[_label][:dopant_name], for example: "Al(0.2)GaN" or "Al(0.2)GaN:Mg" |
doping | amount of dopant |
NoSuchMaterial | if database doesn't know material with name parsed_name_with_donor |
shared_ptr< const MaterialsDB::MaterialConstructor > plask::MaterialsDB::getConstructor | ( | const Material::Composition & | composition, |
const std::string & | label = "" , |
||
const std::string & | dopant_name = "" |
||
) | const |
shared_ptr< const MaterialsDB::MaterialConstructor > plask::MaterialsDB::getConstructor | ( | const Material::Parameters & | material, |
bool | allow_alloy_without_composition = false |
||
) | const |
shared_ptr< const MaterialsDB::MaterialConstructor > plask::MaterialsDB::getConstructor | ( | const std::string & | name_without_composition | ) | const |
Get constructor of material.
name_without_composition | material name, without encoded parameters, in format composition[_label][:dopant] |
NoSuchMaterial | if database doesn't know material with name name_without_composition |
|
static |
shared_ptr< MaterialsDB::MixedCompositionFactory > plask::MaterialsDB::getFactory | ( | const std::string & | material1_fullname, |
const std::string & | material2_fullname, | ||
double | shape = 1. |
||
) | const |
Construct mixed material factory.
material1_fullname,material2_fullname | materials name, with encoded parameters in format composition[_label][:dopant], both must refer to the same material with the same dopant and in case of doping materials, amounts of dopants must be given in the same format |
shape | changing material shape exponent |
Check if a material (given without parameters) is simple.
name_without_composition | material name, without encoded parameters, in format composition[:dopant] |
true
only if the material is simple NoSuchMaterial | if database doesn't know the material with name name_without_composition |
|
static |
|
delete |
|
delete |
|
inline |
|
delete |
|
inline |
|
delete |
|
inline |
MaterialInfo::DB plask::MaterialsDB::info |
MaterialsDB plask::MaterialsDB::toRevert |