PLaSK library
|
Base class for all solvers. More...
#include <plask/solver.hpp>
Public Member Functions | |
bool | initCalculation () |
This should be called on beginning of each calculation method to ensure that solver will be initialized. | |
Solver (const std::string &name="") | |
Construct uninitialized solver. | |
virtual | ~Solver () |
Virtual destructor (for subclassing). Do nothing. | |
virtual void | loadConfiguration (XMLReader &source, Manager &manager) |
Load configuration from given source . | |
void | parseStandardConfiguration (XMLReader &source, Manager &manager, const std::string &expected_msg="solver configuration element") |
Load standard configuration (geometry, mesh) tags from source . | |
bool | isInitialized () |
Check if solver is already initialized. | |
void | invalidate () |
This method should be and is called if something important was changed: calculation space, mesh, etc. | |
virtual std::string | getClassName () const =0 |
Get name of solver. | |
std::string | getId () const |
Get solver id. | |
std::string | getName () const |
virtual std::string | getClassDescription () const |
Get a description of this solver. | |
template<typename ArgT = double, typename ValT = double> | |
DataLog< ArgT, ValT > | dataLog (const std::string &chart_name, const std::string &axis_arg_name, const std::string &axis_val_name) |
template<typename ArgT = double, typename ValT = double> | |
DataLog< ArgT, ValT > | dataLog (const std::string &axis_arg_name, const std::string &axis_val_name) |
template<typename ... Args> | |
void | writelog (LogLevel level, std::string msg, Args &&... params) const |
Log a message for this solver. | |
Protected Member Functions | |
virtual void | onInitialize () |
Initialize the solver. | |
virtual void | onInvalidate () |
This method is called by invalidate() to reset stored values. | |
Protected Attributes | |
bool | initialized |
true only if solver is initialized | |
|
inline |
Construct uninitialized solver.
name | Id of the instance of this solver |
Definition at line 563 of file solver.hpp.
|
inlinevirtual |
Virtual destructor (for subclassing). Do nothing.
Definition at line 566 of file solver.hpp.
|
inline |
Definition at line 645 of file solver.hpp.
|
inline |
Definition at line 639 of file solver.hpp.
|
inlinevirtual |
Get a description of this solver.
Reimplemented in plask::ccategory::your_solver::YourSolver, plask::optical::effective::EffectiveFrequencyCyl, and plask::optical::effective::EffectiveIndex2D.
Definition at line 636 of file solver.hpp.
|
pure virtual |
Get name of solver.
Implemented in plask::electrical::drift_diffusion::DriftDiffusionModel2DSolver< Geometry2DType >, plask::electrical::drift_diffusion::DriftDiffusionModel2DSolver< Geometry2DType >, plask::electrical::diffusion::Diffusion2DSolver< Geometry2DType >, plask::electrical::diffusion::Diffusion2DSolver< Geometry2DType >, plask::electrical::diffusion1d::DiffusionFem2DSolver< Geometry2DType >, plask::electrical::diffusion1d::DiffusionFem2DSolver< Geometry2DType >, plask::gain::freecarrier::FreeCarrierGainSolver2D< GeometryT >, plask::gain::freecarrier::FreeCarrierGainSolver2D< GeometryT >, plask::solvers::FermiNew::FermiNewGainSolver< GeometryType >, plask::solvers::FermiNew::FermiNewGainSolver< GeometryT >, plask::solvers::FermiNew::FermiNewGainSolver< GeometryType >, plask::solvers::FermiNew::FermiNewGainSolver< GeometryT >, plask::solvers::FermiNew::FermiNewGainSolver< GeometryType >, plask::solvers::FermiNew::FermiNewGainSolver< GeometryT >, plask::ccategory::your_solver::YourSolver, plask::thermal::dynamic::DynamicThermalFem2DSolver< Geometry2DType >, plask::thermal::dynamic::DynamicThermalFem2DSolver< Geometry2DType >, plask::thermal::tstatic::ThermalFem2DSolver< Geometry2DType >, plask::thermal::tstatic::ThermalFem2DSolver< Geometry2DType >, plask::FilterBaseImpl< PropertyT, FIELD_PROPERTY, OutputSpaceType, VariadicTemplateTypesHolder< ExtraArgs... > >, plask::FilterBaseImpl< PropertyT, MULTI_FIELD_PROPERTY, OutputSpaceType, VariadicTemplateTypesHolder< ExtraArgs... > >, plask::electrical::drift_diffusion::DriftDiffusionModel2DSolver< Geometry2DType >, plask::electrical::diffusion::Diffusion2DSolver< Geometry2DType >, plask::electrical::diffusion::Diffusion3DSolver, plask::electrical::diffusion1d::DiffusionFem2DSolver< Geometry2DType >, plask::gain::freecarrier::FreeCarrierGainSolver2D< GeometryT >, plask::gain::freecarrier::FreeCarrierGainSolver3D, plask::optical::effective::EffectiveFrequencyCyl, plask::optical::effective::EffectiveIndex2D, plask::optical::modal::BesselSolverCyl, plask::optical::modal::FourierSolver2D, plask::optical::modal::FourierSolver3D, plask::thermal::dynamic::DynamicThermalFem2DSolver< Geometry2DType >, plask::thermal::dynamic::DynamicThermalFem3DSolver, plask::thermal::tstatic::ThermalFem2DSolver< Geometry2DType >, and plask::thermal::tstatic::ThermalFem3DSolver.
|
inline |
|
inline |
Definition at line 630 of file solver.hpp.
bool plask::Solver::initCalculation | ( | ) |
This should be called on beginning of each calculation method to ensure that solver will be initialized.
It's does nothing if solver is already initialized and calls onInitialize() if it's not.
true
only if solver is newly initialized (it was previously uninitialized) and onInitialize has just been called. Definition at line 27 of file solver.cpp.
|
inline |
This method should be and is called if something important was changed: calculation space, mesh, etc.
Default implementation set initialization flag to false
and can call onInvalidate() if initialization flag was true
.
Definition at line 603 of file solver.hpp.
|
inline |
Check if solver is already initialized.
true
only if solver is already initialized Definition at line 595 of file solver.hpp.
Load configuration from given source
.
XML reader (source
) point to opening of this
solver tag and after return from this method should point to this solver closing tag.
source | source of configuration |
manager | manager from which information about geometry, meshes, materials, and so on can be get if needed |
Reimplemented in plask::solvers::FermiNew::FermiNewGainSolver< GeometryType >, plask::solvers::FermiNew::FermiNewGainSolver< GeometryT >, plask::ccategory::your_solver::YourSolver, plask::gain::freecarrier::FreeCarrierGainSolver< SolverOver< Geometry3D > >, plask::gain::freecarrier::FreeCarrierGainSolver< SolverWithMesh< GeometryT, MeshAxis > >, plask::optical::effective::EffectiveFrequencyCyl, plask::optical::effective::EffectiveIndex2D, plask::electrical::diffusion1d::DiffusionFem2DSolver< Geometry2DType >, plask::optical::modal::BesselSolverCyl, plask::optical::modal::FourierSolver2D, plask::optical::modal::FourierSolver3D, plask::SolverOver< SpaceT >, plask::SolverOver< ForExample_Geometry2DCartesian >, plask::SolverOver< Geometry2DCartesian >, plask::SolverOver< Geometry2DCylindrical >, plask::SolverOver< Geometry2DType >, plask::SolverOver< Geometry3D >, plask::SolverOver< GeometryT >, plask::SolverOver< GeometryType >, plask::SolverWithMesh< SpaceT, MeshT >, plask::SolverWithMesh< ForExample_Geometry2DCartesian, ForExample_RectilinearMesh2D >, plask::SolverWithMesh< Geometry2DCartesian, MeshAxis >, plask::SolverWithMesh< Geometry2DCartesian, RectangularMesh< 2 > >, plask::SolverWithMesh< Geometry2DCylindrical, MeshAxis >, plask::SolverWithMesh< Geometry2DCylindrical, RectangularMesh< 2 > >, plask::SolverWithMesh< Geometry2DType, RectangularMesh< 2 > >, plask::SolverWithMesh< Geometry2DType, RegularMesh1D >, plask::SolverWithMesh< Geometry3D, RectangularMesh< 3 > >, plask::SolverWithMesh< GeometryT, MeshAxis >, plask::SolverWithMesh< GeometryType, MeshAxis >, plask::electrical::drift_diffusion::DriftDiffusionModel2DSolver< Geometry2DType >, plask::electrical::diffusion::Diffusion2DSolver< Geometry2DType >, plask::electrical::diffusion::Diffusion3DSolver, plask::electrical::shockley::ElectricalFem2DSolver< Geometry2DType >, plask::electrical::shockley::ElectricalFem3DSolver, plask::thermal::dynamic::DynamicThermalFem2DSolver< Geometry2DType >, plask::thermal::dynamic::DynamicThermalFem3DSolver, plask::thermal::tstatic::ThermalFem2DSolver< Geometry2DType >, and plask::thermal::tstatic::ThermalFem3DSolver.
Definition at line 19 of file solver.cpp.
Initialize the solver.
Default implementation just does nothing, however it is a good idea to overwrite it in subclasses and put initialization code in it.
Reimplemented in plask::FemSolverWithMaskedMesh< SpaceT, MeshT >, plask::FemSolverWithMaskedMesh< Geometry2DType, RectangularMesh< 2 > >, plask::FemSolverWithMaskedMesh< Geometry3D, RectangularMesh< 3 > >, plask::solvers::FermiNew::FermiNewGainSolver< GeometryType >, plask::solvers::FermiNew::FermiNewGainSolver< GeometryT >, plask::ccategory::your_solver::YourSolver, plask::electrical::drift_diffusion::DriftDiffusionModel2DSolver< Geometry2DType >, plask::electrical::diffusion::Diffusion2DSolver< Geometry2DType >, plask::electrical::diffusion::Diffusion3DSolver, plask::electrical::diffusion1d::DiffusionFem2DSolver< Geometry2DType >, plask::electrical::shockley::ElectricalFem2DSolver< Geometry2DType >, plask::electrical::shockley::ElectricalFem3DSolver, plask::gain::freecarrier::FreeCarrierGainSolver< SolverOver< Geometry3D > >, plask::gain::freecarrier::FreeCarrierGainSolver< SolverWithMesh< GeometryT, MeshAxis > >, plask::optical::effective::EffectiveFrequencyCyl, plask::optical::effective::EffectiveIndex2D, plask::optical::modal::BesselSolverCyl, plask::optical::modal::FourierSolver2D, plask::optical::modal::FourierSolver3D, plask::optical::modal::ModalSolver< SolverOver< Geometry3D > >, plask::optical::modal::ModalSolver< SolverWithMesh< Geometry2DCartesian, MeshAxis > >, plask::optical::modal::ModalSolver< SolverWithMesh< Geometry2DCylindrical, MeshAxis > >, plask::thermal::dynamic::DynamicThermalFem2DSolver< Geometry2DType >, plask::thermal::dynamic::DynamicThermalFem3DSolver, plask::thermal::tstatic::ThermalFem2DSolver< Geometry2DType >, and plask::thermal::tstatic::ThermalFem3DSolver.
Definition at line 540 of file solver.hpp.
This method is called by invalidate() to reset stored values.
Default implementation does nothing.
Reimplemented in plask::solvers::FermiNew::FermiNewGainSolver< GeometryType >, plask::solvers::FermiNew::FermiNewGainSolver< GeometryT >, plask::ccategory::your_solver::YourSolver, plask::electrical::drift_diffusion::DriftDiffusionModel2DSolver< Geometry2DType >, plask::electrical::diffusion::Diffusion2DSolver< Geometry2DType >, plask::electrical::diffusion::Diffusion3DSolver, plask::electrical::diffusion1d::DiffusionFem2DSolver< Geometry2DType >, plask::electrical::shockley::ElectricalFem2DSolver< Geometry2DType >, plask::electrical::shockley::ElectricalFem3DSolver, plask::gain::freecarrier::FreeCarrierGainSolver< SolverOver< Geometry3D > >, plask::gain::freecarrier::FreeCarrierGainSolver< SolverWithMesh< GeometryT, MeshAxis > >, plask::optical::effective::EffectiveFrequencyCyl, plask::optical::effective::EffectiveIndex2D, plask::optical::modal::BesselSolverCyl, plask::optical::modal::FourierSolver2D, plask::optical::modal::FourierSolver3D, plask::thermal::dynamic::DynamicThermalFem2DSolver< Geometry2DType >, plask::thermal::dynamic::DynamicThermalFem3DSolver, plask::thermal::tstatic::ThermalFem2DSolver< Geometry2DType >, and plask::thermal::tstatic::ThermalFem3DSolver.
Definition at line 548 of file solver.hpp.
void plask::Solver::parseStandardConfiguration | ( | XMLReader & | source, |
Manager & | manager, | ||
const std::string & | expected_msg = "solver configuration element" |
||
) |
Load standard configuration (geometry, mesh) tags from source
.
Throws an exception if the current tag is not a standard tag (so parse your own solver configuration first).
[in,out] | source | source of configuration which point to opening of parameter tag |
[in,out] | manager | manager from which information about geometry, meshes, materials, and so on can be get if needed |
[in] | expected_msg | optional message stating what was expected |
XMLUnexpectedElementException | if the current tag is not recognized |
Definition at line 23 of file solver.cpp.
|
inline |
Log a message for this solver.
level | log level to log |
msg | log message |
params | parameters passed to format |
Definition at line 656 of file solver.hpp.
|
protected |
true
only if solver is initialized
Definition at line 533 of file solver.hpp.