OpenFCST: The open-source Fuel Cell Simulation Toolbox
|
A derivate form MeshLoop providing additional functionality which needs information from a DoFApplication. More...
#include <mesh_loop.h>
Public Member Functions | |
DoFMeshLoop (ApplicationBase &app, DoFApplication< dim > &dof_app) | |
Constructor, receiving the application solved by solve(). | |
~DoFMeshLoop () | |
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 | data_out (const std::string &filename, const FEVectors &src) |
Write data in the format specified by the ParameterHandler. | |
Public Member Functions inherited from AppFrame::MeshLoop | |
MeshLoop (ApplicationBase &app) | |
Constructor, receiving the application solved by solve(). | |
virtual void | solve (FEVector &start, const FEVectors &rhs) |
Solve the system assembled with right hand side rhs and return the result in start . | |
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. | |
Private Member Functions | |
virtual void | setup (FEVector &) |
A function called right before the loop starts. | |
virtual void | do_remesh (FEVector &) |
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 | |
SmartPointer< DoFApplication < dim > > | dof_app |
Pointer to the DoFHandler. | |
bool | transfer_solution |
The flag controlling, whether the previous solution should be transfered to the new mesh. | |
bool | intrinsic_error |
A flag determining whether the difference of two successive meshes should be provided to Application::evaluate() instead of the last solution. | |
bool | output_difference |
Additionally, output the difference of two conseutive steps. | |
FEVector * | old_solution |
Pointer needed to store the old solution. | |
Additional Inherited Members | |
Static Public Attributes inherited from AppFrame::MeshLoop | |
static const Event | new_mesh |
The Event raised by MeshLoop if the mesh has changed. | |
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. | |
A derivate form MeshLoop providing additional functionality which needs information from a DoFApplication.
This MeshLoop can compute the difference between two successive solutions automatically.
AppFrame::DoFMeshLoop< dim >::DoFMeshLoop | ( | ApplicationBase & | app, |
DoFApplication< dim > & | dof_app | ||
) |
Constructor, receiving the application solved by solve().
AppFrame::DoFMeshLoop< dim >::~DoFMeshLoop | ( | ) |
|
virtual |
Write data in the format specified by the ParameterHandler.
Reimplemented from AppFrame::MeshLoop.
|
virtual |
Declare parameters of the application pointed to and ReductionControl parameters for this object.
Reimplemented from AppFrame::MeshLoop.
|
privatevirtual |
The function called in the iteration right after solving.
By default, calls Application::evaluate().
Reimplemented from AppFrame::MeshLoop.
|
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 from AppFrame::MeshLoop.
|
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::MeshLoop.
|
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 from AppFrame::MeshLoop.
|
private |
Pointer to the DoFHandler.
|
private |
A flag determining whether the difference of two successive meshes should be provided to Application::evaluate() instead of the last solution.
If this is true
, Application::evaluate() should compute errors with respect to ZeroFunction instead of the true solution.
|
private |
Pointer needed to store the old solution.
|
private |
Additionally, output the difference of two conseutive steps.
|
private |
The flag controlling, whether the previous solution should be transfered to the new mesh.
This function will not only add the solution vector to DoFApplication::transfer_vectors, it also eliminates the call to Application::start_vector after remeshing.