OpenFCST: The open-source Fuel Cell Simulation Toolbox
|
Loop over a sequence of meshes and solve the inner application. More...
#include <mesh_loop.h>
Public Member Functions | |
MeshLoop (ApplicationBase &app) | |
Constructor, receiving the application solved by solve(). | |
virtual void | declare_parameters (ParameterHandler ¶m) |
Declare parameters of the application pointed to and ReductionControl parameters for this object. | |
virtual void | initialize (ParameterHandler ¶m) |
Pure virtual initialization function. | |
virtual void | solve (FEVector &start, const FEVectors &rhs) |
Solve the system assembled with right hand side rhs and return the result in start . | |
virtual void | data_out (const std::string &filename, const FEVectors &src) |
Write data in the format specified by the ParameterHandler. | |
void | set_name (std::string new_name) |
Change base_name, the trunc of the output file names. | |
Public Member Functions inherited from AppFrame::ApplicationCopy | |
ApplicationCopy (ApplicationBase &ex_app) | |
Constructor for a derived application. | |
~ApplicationCopy () | |
virtual void | remesh () |
Generates the next mesh depending on the mesh generation parameters. | |
virtual void | init_vector (FEVector &dst) const |
Initialize vector to problem size. | |
virtual void | start_vector (FEVector &dst, std::string caller) const |
Initialize vector to problem size. | |
virtual double | residual (FEVector &dst, const FEVectors &src) |
virtual void | Tsolve (FEVector &start, const FEVectors &rhs) |
Solve the dual system assembled with right hand side rhs and return the result in start . | |
virtual double | estimate (const FEVectors &src) |
Error estimation. | |
virtual double | evaluate (const FEVectors &src) |
Evaluate whatever the simulation was made for. | |
virtual void | grid_out (const std::string &filename) const |
Write the mesh in the format specified by the ParameterHandler. | |
virtual std::string | id () const |
Return a unique identification string for this application. | |
virtual void | notify (const Event &reason) |
Add a reason for assembling. | |
Public Member Functions inherited from AppFrame::ApplicationBase | |
ApplicationBase (boost::shared_ptr< ApplicationData > ex_data=boost::shared_ptr< ApplicationData >()) | |
Constructor for an application. | |
ApplicationBase (const ApplicationBase &other) | |
Copy constructor. | |
virtual | ~ApplicationBase () |
Virtual destructor. | |
void | print_parameters_to_file (ParameterHandler ¶m, const std::string &file_name, const ParameterHandler::OutputStyle &style) |
Print default parameters for the application to a file. | |
virtual double | residual (FEVector &dst, const FEVectors &src, bool apply_boundaries=true) |
Compute residual of src and store it into dst . | |
virtual void | data_out (const std::string &filename, const FEVectors &src, const std::vector< std::string >) |
boost::shared_ptr < ApplicationData > | get_data () |
Get access to the protected variable data. | |
const boost::shared_ptr < ApplicationData > | get_data () const |
Get read-only access to the protected variable data. | |
virtual void | clear () |
Reset the application class such that a call to initialize() is possible again and will produce the same result as if the object was fresh. | |
void | clear_events () |
Clear all notifications. | |
Static Public Attributes | |
static const Event | new_mesh |
The Event raised by MeshLoop if the mesh has changed. | |
Private Member Functions | |
virtual void | setup (FEVector &v) |
A function called right before the loop starts. | |
virtual void | do_remesh (FEVector &v) |
The function called to perform the remeshing at the beginning of all but the first iterations. | |
virtual void | do_evaluate (const FEVectors &) |
The function called in the iteration right after solving. | |
Private Attributes | |
ReductionControl | control |
The object controlling the mesh iteration. | |
std::string | base_name |
Base name of the file for data output. | |
Additional Inherited Members | |
Protected Member Functions inherited from AppFrame::ApplicationBase | |
void | print_caller_name (const std::string &caller_name) const |
Print caller name. | |
Protected Attributes inherited from AppFrame::ApplicationCopy | |
SmartPointer< ApplicationBase > | app |
Pointer to the application this one depends upon. | |
Loop over a sequence of meshes and solve the inner application.
The function solve of this application solves the innner problem. All other virtual functions except initialize() are handed to the inner application immediately.
The iteration is controlled by an object of type SolverControl, which is usually filled from the parameter file.
AppFrame::MeshLoop::MeshLoop | ( | ApplicationBase & | app | ) |
Constructor, receiving the application solved by solve().
|
virtual |
Write data in the format specified by the ParameterHandler.
Reimplemented from AppFrame::ApplicationCopy.
Reimplemented in AppFrame::DoFMeshLoop< dim >.
|
virtual |
Declare parameters of the application pointed to and ReductionControl parameters for this object.
Reimplemented from AppFrame::ApplicationCopy.
Reimplemented in AppFrame::DoFMeshLoop< dim >.
|
privatevirtual |
The function called in the iteration right after solving.
By default, calls Application::evaluate().
Reimplemented in AppFrame::DoFMeshLoop< dim >.
|
privatevirtual |
The function called to perform the remeshing at the beginning of all but the first iterations.
By default, just calls Application::remesh() and Application::start_vector(), which should be replicated by overloaded functions in derived classes.
v
is the solution vector, which is filled by Application::start_vector(). Reimplemented in AppFrame::DoFMeshLoop< dim >.
|
virtual |
Pure virtual initialization function.
Here, the parameters declared in the constructor are actually read from ParameterHandler.
This function must be overloaded in any derived class using its own values from the parameter file.
Initialization functions of derived classes must make sure to call all functions _initialize() of the base classes.
Reimplemented from AppFrame::ApplicationCopy.
Reimplemented in AppFrame::DoFMeshLoop< dim >.
void AppFrame::MeshLoop::set_name | ( | std::string | new_name | ) |
Change base_name, the trunc of the output file names.
|
privatevirtual |
A function called right before the loop starts.
It allows a derived class to initialize its data at that point.
v
is the iteration vector in solve(), which contains the solution after each step. Reimplemented in AppFrame::DoFMeshLoop< dim >.
Solve the system assembled with right hand side rhs
and return the result in start
.
Reimplemented from AppFrame::ApplicationCopy.
|
private |
Base name of the file for data output.
|
private |
The object controlling the mesh iteration.
|
static |