OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
AppFrame::MeshLoop Class Reference

Loop over a sequence of meshes and solve the inner application. More...

#include <mesh_loop.h>

Inheritance diagram for AppFrame::MeshLoop:
Inheritance graph
[legend]
Collaboration diagram for AppFrame::MeshLoop:
Collaboration graph
[legend]

Public Member Functions

 MeshLoop (ApplicationBase &app)
 Constructor, receiving the application solved by solve().
 
virtual void declare_parameters (ParameterHandler &param)
 Declare parameters of the application pointed to and ReductionControl parameters for this object.
 
virtual void initialize (ParameterHandler &param)
 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 &param, 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< ApplicationBaseapp
 Pointer to the application this one depends upon.
 

Detailed Description

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.

Author
Guido Kanschat, 2006

Constructor & Destructor Documentation

AppFrame::MeshLoop::MeshLoop ( ApplicationBase app)

Constructor, receiving the application solved by solve().

Member Function Documentation

virtual void AppFrame::MeshLoop::data_out ( const std::string &  filename,
const FEVectors src 
)
virtual

Write data in the format specified by the ParameterHandler.

Reimplemented from AppFrame::ApplicationCopy.

Reimplemented in AppFrame::DoFMeshLoop< dim >.

virtual void AppFrame::MeshLoop::declare_parameters ( ParameterHandler &  param)
virtual

Declare parameters of the application pointed to and ReductionControl parameters for this object.

Reimplemented from AppFrame::ApplicationCopy.

Reimplemented in AppFrame::DoFMeshLoop< dim >.

virtual void AppFrame::MeshLoop::do_evaluate ( const FEVectors )
privatevirtual

The function called in the iteration right after solving.

By default, calls Application::evaluate().

Reimplemented in AppFrame::DoFMeshLoop< dim >.

virtual void AppFrame::MeshLoop::do_remesh ( FEVector v)
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 void AppFrame::MeshLoop::initialize ( ParameterHandler &  param)
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.

virtual void AppFrame::MeshLoop::setup ( FEVector v)
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 >.

virtual void AppFrame::MeshLoop::solve ( FEVector start,
const FEVectors rhs 
)
virtual

Solve the system assembled with right hand side rhs and return the result in start.

Reimplemented from AppFrame::ApplicationCopy.

Member Data Documentation

std::string AppFrame::MeshLoop::base_name
private

Base name of the file for data output.

ReductionControl AppFrame::MeshLoop::control
private

The object controlling the mesh iteration.

const Event AppFrame::MeshLoop::new_mesh
static

The Event raised by MeshLoop if the mesh has changed.


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