PLaSK library
Loading...
Searching...
No Matches
plask::SolverWithMesh< SpaceT, MeshT > Struct Template Reference

Base class for all solvers operating on specified olding an external mesh. More...

#include <plask/solver.hpp>

Inheritance diagram for plask::SolverWithMesh< SpaceT, MeshT >:
[legend]
Collaboration diagram for plask::SolverWithMesh< SpaceT, MeshT >:
[legend]

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.
 
MeshTmeshRef () const
 Get current module mesh.
 
shared_ptr< MeshTgetMesh () 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< SpaceTgetGeometry () 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, ValTdataLog (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, ValTdataLog (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< MeshTmesh
 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< SpaceTgeometry
 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.
 

Detailed Description

template<typename SpaceT, typename MeshT>
struct plask::SolverWithMesh< SpaceT, MeshT >

Base class for all solvers operating on specified olding an external mesh.

Definition at line 748 of file solver.hpp.

Member Typedef Documentation

◆ MeshType

Type of the mesh for this solver.

Definition at line 751 of file solver.hpp.

Constructor & Destructor Documentation

◆ SolverWithMesh()

template<typename SpaceT , typename MeshT >
plask::SolverWithMesh< SpaceT, MeshT >::SolverWithMesh ( const std::string &  name = "")
inline

Definition at line 799 of file solver.hpp.

◆ ~SolverWithMesh()

Definition at line 801 of file solver.hpp.

Member Function Documentation

◆ getMesh()

template<typename SpaceT , typename MeshT >
shared_ptr< MeshT > plask::SolverWithMesh< SpaceT, MeshT >::getMesh ( ) const
inline

Get current solver mesh.

Returns
current solver mesh

Definition at line 843 of file solver.hpp.

◆ loadConfiguration()

template<typename SpaceT , typename MeshT >
void plask::SolverWithMesh< SpaceT, MeshT >::loadConfiguration ( XMLReader source,
Manager manager 
)
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.

Parameters
sourcesource of configuration
managermanager 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.

◆ meshRef()

template<typename SpaceT , typename MeshT >
MeshT & plask::SolverWithMesh< SpaceT, MeshT >::meshRef ( ) const
inline

Get current module mesh.

It doesn't check if mesh is non-null.

Returns
current module mesh, dereferenced

Definition at line 837 of file solver.hpp.

◆ onGeometryChange()

template<typename SpaceT , typename MeshT >
void plask::SolverWithMesh< SpaceT, MeshT >::onGeometryChange ( const Geometry::Event PLASK_UNUSEDevt)
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.

Parameters
evtinformation about geometry changes

Definition at line 826 of file solver.hpp.

◆ onMeshChange()

template<typename SpaceT , typename MeshT >
virtual void plask::SolverWithMesh< SpaceT, MeshT >::onMeshChange ( const typename MeshT::Event &  PLASK_UNUSEDevt)
inlinevirtual

This method is called just after the mesh has been changed.

It just calls invalidate(); but subclasses can customize it.

Parameters
evtinformation about mesh changes

Definition at line 815 of file solver.hpp.

◆ parseStandardConfiguration()

template<typename SpaceT , typename MeshT >
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.

◆ setMesh() [1/2]

template<typename SpaceT , typename MeshT >
void plask::SolverWithMesh< SpaceT, MeshT >::setMesh ( const shared_ptr< MeshT > &  mesh)
inline

Set new mesh for the solver.

Parameters
meshnew mesh

Definition at line 849 of file solver.hpp.

◆ setMesh() [2/2]

template<typename SpaceT , typename MeshT >
void plask::SolverWithMesh< SpaceT, MeshT >::setMesh ( shared_ptr< MeshGeneratorD< MeshT::DIM > >  generator)
inline

Set new mesh got from generator.

Parameters
generatormesh generator

Definition at line 864 of file solver.hpp.

Member Data Documentation

◆ mesh

template<typename SpaceT , typename MeshT >
shared_ptr<MeshT> plask::SolverWithMesh< SpaceT, MeshT >::mesh
protected

Mesh over which the calculations are performed.

Definition at line 792 of file solver.hpp.

◆ mesh_signal_connection

template<typename SpaceT , typename MeshT >
boost::signals2::connection plask::SolverWithMesh< SpaceT, MeshT >::mesh_signal_connection
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.


The documentation for this struct was generated from the following file: