![]() |
OpenPFC
0.1.4
Phase Field Crystal simulation framework
|
Registry for field modifiers (initial conditions and boundary conditions) More...
#include "errors.hpp"#include "from_json.hpp"#include "openpfc/boundary_conditions/fixed_bc.hpp"#include "openpfc/boundary_conditions/moving_bc.hpp"#include "openpfc/field_modifier.hpp"#include "openpfc/initial_conditions/constant.hpp"#include "openpfc/initial_conditions/file_reader.hpp"#include "openpfc/initial_conditions/random_seeds.hpp"#include "openpfc/initial_conditions/seed_grid.hpp"#include "openpfc/initial_conditions/single_seed.hpp"#include <functional>#include <memory>#include <string>#include <unordered_map>

Go to the source code of this file.
Classes | |
| class | pfc::ui::FieldModifierRegistry |
| A registry for field modifiers used in the application. More... | |
| struct | pfc::ui::FieldModifierInitializer |
| Helper struct for registering field modifiers during static initialization. More... | |
Typedefs | |
| using | pfc::ui::FieldModifier_p = std::unique_ptr< FieldModifier > |
Functions | |
| template<typename T > | |
| void | pfc::ui::register_field_modifier (const std::string &type) |
| Register a field modifier type with the FieldModifierRegistry. | |
| std::unique_ptr< FieldModifier > | pfc::ui::create_field_modifier (const std::string &type, const json ¶ms) |
| Create an instance of a field modifier based on its type. | |
Registry for field modifiers (initial conditions and boundary conditions)
This header provides a registry system for field modifiers that allows dynamic registration and creation of field modifiers from JSON configuration. It supports both initial conditions and boundary conditions.
| std::unique_ptr< FieldModifier > pfc::ui::create_field_modifier | ( | const std::string & | type, |
| const json & | params | ||
| ) |
Create an instance of a field modifier based on its type.
| type | The type string of the field modifier to create. |
| params | A json object describing the parameters for field modifier. |
| std::invalid_argument | if the specified type is not registered. |
This function creates an instance of a field modifier based on its registered type. It retrieves the registered creator function associated with the specified type string from the FieldModifierRegistry and uses it to create the field modifier instance.


| void pfc::ui::register_field_modifier | ( | const std::string & | type | ) |
Register a field modifier type with the FieldModifierRegistry.
| T | The type of the field modifier to register. |
| type | The type string associated with the field modifier. |
This function registers a field modifier type with the FieldModifierRegistry. It associates the specified type string with a creator function that creates an instance of the field modifier.

