PLaSK library
|
Base class for all solvers operating on specified olding an external mesh. More...
#include <plask/solver.hpp>
Public Types | |
typedef MeshT | MeshType |
Type of the mesh for this solver. | |
Public Types inherited from plask::SolverOver< SpaceT > | |
typedef SpaceT | SpaceType |
of the space for this solver | |
Public Member Functions | |
SolverWithMesh (const std::string &name="") | |
~SolverWithMesh () | |
void | loadConfiguration (XMLReader &source, Manager &manager) override |
Load configuration from given source . | |
void | parseStandardConfiguration (XMLReader &source, Manager &manager, const std::string &expected_msg="solver configuration element") |
virtual void | onMeshChange (const typename MeshT::Event &PLASK_UNUSED(evt)) |
This method is called just after the mesh has been changed. | |
void | onGeometryChange (const Geometry::Event &PLASK_UNUSED(evt)) override |
This method is called when the geometry is changed. | |
MeshT & | meshRef () const |
Get current module mesh. | |
shared_ptr< MeshT > | getMesh () const |
Get current solver mesh. | |
void | setMesh (const shared_ptr< MeshT > &mesh) |
Set new mesh for the solver. | |
void | setMesh (shared_ptr< MeshGeneratorD< MeshT::DIM > > generator) |
Set new mesh got from generator. | |
Public Member Functions inherited from plask::SolverOver< SpaceT > | |
SolverOver (const std::string &name="") | |
~SolverOver () | |
void | parseStandardConfiguration (XMLReader &source, Manager &manager, const std::string &expected_msg="solver configuration element") |
virtual void | onGeometryChange (const Geometry::Event &) |
This method is called when the geometry is changed. | |
shared_ptr< SpaceT > | getGeometry () const |
Get current solver geometry space. | |
void | setGeometry (const shared_ptr< SpaceT > &geometry) |
Set new geometry for the solver. | |
Public Member Functions inherited from plask::Solver | |
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. | |
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 Attributes | |
shared_ptr< MeshT > | mesh |
Mesh over which the calculations are performed. | |
boost::signals2::connection | mesh_signal_connection |
Connection of mesh to onMeshChange method, see http://www.boost.org/doc/libs/1_55_0/doc/html/signals2/tutorial.html#idp204830936. | |
Protected Attributes inherited from plask::SolverOver< SpaceT > | |
shared_ptr< SpaceT > | geometry |
Space in which the calculations are performed. | |
Protected Attributes inherited from plask::Solver | |
bool | initialized |
true only if solver is initialized | |
Additional Inherited Members | |
Protected Member Functions inherited from plask::SolverOver< SpaceT > | |
template<typename Boundary , typename ConditionT > | |
void | readBoundaryConditions (Manager &manager, XMLReader &reader, BoundaryConditions< Boundary, ConditionT > &dest) |
Read boundary conditions using information about the geometry of this solver. | |
Protected Member Functions inherited from plask::Solver | |
virtual void | onInitialize () |
Initialize the solver. | |
virtual void | onInvalidate () |
This method is called by invalidate() to reset stored values. | |
Base class for all solvers operating on specified olding an external mesh.
Definition at line 748 of file solver.hpp.
typedef MeshT plask::SolverWithMesh< SpaceT, MeshT >::MeshType |
Type of the mesh for this solver.
Definition at line 751 of file solver.hpp.
|
inline |
Definition at line 799 of file solver.hpp.
|
inline |
Definition at line 801 of file solver.hpp.
|
inline |
|
overridevirtual |
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 from plask::SolverOver< SpaceT >.
Reimplemented in plask::ccategory::your_solver::YourSolver, plask::thermal::tstatic::ThermalFem2DSolver< Geometry2DType >, and plask::thermal::tstatic::ThermalFem3DSolver.
Definition at line 886 of file solver.hpp.
|
inline |
Get current module mesh.
It doesn't check if mesh is non-null.
Definition at line 837 of file solver.hpp.
|
inlineoverride |
This method is called when the geometry is changed.
It calls invalidate(); and regenerateMesh();
Typically, you should call SolverWithMesh::onGeometryChange(const Geometry::Event&) when you overwrite this method.
evt | information about geometry changes |
Definition at line 826 of file solver.hpp.
|
inlinevirtual |
This method is called just after the mesh has been changed.
It just calls invalidate(); but subclasses can customize it.
evt | information about mesh changes |
Definition at line 815 of file solver.hpp.
void plask::SolverWithMesh< SpaceT, MeshT >::parseStandardConfiguration | ( | XMLReader & | source, |
Manager & | manager, | ||
const std::string & | expected_msg = "solver configuration element" |
||
) |
Definition at line 911 of file solver.hpp.
|
inline |
Set new mesh got from generator.
generator | mesh generator |
Definition at line 864 of file solver.hpp.
|
protected |
Mesh over which the calculations are performed.
Definition at line 792 of file solver.hpp.
|
protected |
Connection of mesh to onMeshChange method, see http://www.boost.org/doc/libs/1_55_0/doc/html/signals2/tutorial.html#idp204830936.
Definition at line 795 of file solver.hpp.