Hermes2D  3.0
Hermes::Hermes2D::WeakForm< Scalar > Class Template Reference

Represents the weak formulation of a PDE problem. More...

#include <weakform.h>

+ Inheritance diagram for Hermes::Hermes2D::WeakForm< Scalar >:

Public Types

enum  FormIntegrationDimension { FormVol = 0, FormSurf = 1 }
 
enum  FormEquationSide { MatrixForm = 0, VectorForm = 1 }
 

Public Member Functions

 WeakForm (unsigned int neq=1, bool mat_free=false)
 
virtual ~WeakForm ()
 Destructor.
 
void add_matrix_form (MatrixFormVol< Scalar > *mfv)
 Adds volumetric matrix form.
 
void add_matrix_form_surf (MatrixFormSurf< Scalar > *mfs)
 Adds surface matrix form.
 
void add_matrix_form_DG (MatrixFormDG< Scalar > *mfDG)
 Adds DG matrix form.
 
void add_vector_form (VectorFormVol< Scalar > *vfv)
 Adds volumetric vector form.
 
void add_vector_form_surf (VectorFormSurf< Scalar > *vfs)
 Adds surface vector form.
 
void add_vector_form_DG (VectorFormDG< Scalar > *vfDG)
 Adds DG vector form.
 
virtual void set_active_state (Element **e)
 
virtual void set_active_edge_state (Element **e, unsigned char isurf)
 
virtual void set_active_DG_state (Element **e, unsigned char isurf)
 
unsigned char get_neq () const
 Returns the number of equations.
 
bool is_matrix_free () const
 This weakform is matrix-free.
 
void set_current_time (double time)
 
void set_current_time_step (double time_step)
 
virtual double get_current_time () const
 
virtual double get_current_time_step () const
 
void set_u_ext_fn (UExtFunctionSharedPtr< Scalar > ext)
 
void set_ext (MeshFunctionSharedPtr< Scalar > ext)
 
void set_u_ext_fn (std::vector< UExtFunctionSharedPtr< Scalar > > ext)
 
void set_ext (std::vector< MeshFunctionSharedPtr< Scalar > > ext)
 
std::vector
< MeshFunctionSharedPtr
< Scalar > > 
get_ext () const
 
virtual WeakFormclone () const
 Cloning.
 
bool is_DG () const
 
std::vector< Form< Scalar > * > get_forms () const
 Internal.
 
std::vector< MatrixFormVol
< Scalar > * > 
get_mfvol () const
 
std::vector< MatrixFormSurf
< Scalar > * > 
get_mfsurf () const
 
std::vector< MatrixFormDG
< Scalar > * > 
get_mfDG () const
 
std::vector< VectorFormVol
< Scalar > * > 
get_vfvol () const
 
std::vector< VectorFormSurf
< Scalar > * > 
get_vfsurf () const
 
std::vector< VectorFormDG
< Scalar > * > 
get_vfDG () const
 
void delete_all ()
 Deletes all volumetric and surface forms.
 

Protected Member Functions

bool ** get_blocks (bool force_diagonal_blocks) const
 
virtual void cloneMembers (const WeakFormSharedPtr< Scalar > &other_wf)
 
void cloneMemberExtFunctions (std::vector< MeshFunctionSharedPtr< Scalar > > source_ext, std::vector< MeshFunctionSharedPtr< Scalar > > &cloned_ext)
 
template<typename FormType >
void processFormMarkers (const std::vector< SpaceSharedPtr< Scalar > > spaces, bool surface, std::vector< FormType > forms_to_process)
 
void processFormMarkers (const std::vector< SpaceSharedPtr< Scalar > > spaces)
 

Protected Attributes

std::vector
< MeshFunctionSharedPtr
< Scalar > > 
ext
 External solutions.
 
std::vector
< UExtFunctionSharedPtr
< Scalar > > 
u_ext_fn
 
double current_time
 
double current_time_step
 
unsigned int neq
 Number of equations.
 
unsigned int original_neq
 Original number of equations in case this is a Runge-Kutta enlarged system.
 
bool is_matfree
 
std::vector< Form< Scalar > * > forms
 Holds all forms.
 
std::vector< MatrixFormVol
< Scalar > * > 
mfvol
 Holds volumetric matrix forms.
 
std::vector< MatrixFormSurf
< Scalar > * > 
mfsurf
 Holds surface matrix forms.
 
std::vector< MatrixFormDG
< Scalar > * > 
mfDG
 Holds DG matrix forms.
 
std::vector< VectorFormVol
< Scalar > * > 
vfvol
 Holds volumetric vector forms.
 
std::vector< VectorFormSurf
< Scalar > * > 
vfsurf
 Holds surface vector forms.
 
std::vector< VectorFormDG
< Scalar > * > 
vfDG
 Holds DG vector forms.
 

Friends

class DiscreteProblem< Scalar >
 
class Form< Scalar >
 
class DiscreteProblemDGAssembler< Scalar >
 
class DiscreteProblemThreadAssembler< Scalar >
 
class DiscreteProblemIntegrationOrderCalculator< Scalar >
 
class DiscreteProblemSelectiveAssembler< Scalar >
 
class RungeKutta< Scalar >
 
class OGProjection< Scalar >
 
class Hermes::Preconditioners::Precond< Scalar >
 

Detailed Description

template<typename Scalar>
class Hermes::Hermes2D::WeakForm< Scalar >

Represents the weak formulation of a PDE problem.

The WeakForm class represents the weak formulation of a system of linear PDEs.
The number of equations ("neq") in the system is fixed and is passed to the constructor.
The weak formulation of the system A(U, V) = L(V) has a block structure. A(U, V) is
a (neq x neq) matrix of bilinear forms a_mn(u, v) and L(V) is a neq-component vector
of linear forms l(v). U and V are the vectors of basis and test functions.

There is a single tutorial just on implementing the weak formulation.
For some basic ideas, please see the examples provided.

Definition at line 86 of file global.h.

Constructor & Destructor Documentation

template<typename Scalar >
Hermes::Hermes2D::WeakForm< Scalar >::WeakForm ( unsigned int  neq = 1,
bool  mat_free = false 
)

Constructor.

Parameters
[in]neqNumber of equations.
[in]mat_freeIf this weak formulation does not include a matrix - e.g. JFNK method.

Definition at line 57 of file weakform.cpp.

Member Function Documentation

template<typename Scalar >
double Hermes::Hermes2D::WeakForm< Scalar >::get_current_time ( ) const
virtual

For time-dependent right-hand side functions. Gets current time.

Definition at line 791 of file weakform.cpp.

template<typename Scalar >
double Hermes::Hermes2D::WeakForm< Scalar >::get_current_time_step ( ) const
virtual

For time-dependent right-hand side functions. Gets current time step.

Definition at line 803 of file weakform.cpp.

template<typename Scalar >
std::vector< MeshFunctionSharedPtr< Scalar > > Hermes::Hermes2D::WeakForm< Scalar >::get_ext ( ) const

External functions. Get external functions.

Definition at line 296 of file weakform.cpp.

template<typename Scalar >
void Hermes::Hermes2D::WeakForm< Scalar >::set_active_DG_state ( Element **  e,
unsigned char  isurf 
)
virtual

Provides possibility of setup edge-wise parameters. For parameters that only depend on element and inner edge and that do not have to be calculated for every form. This is rarely used and typically only for multi-physical tasks where there is a multitude of forms.

Definition at line 104 of file weakform.cpp.

template<typename Scalar >
void Hermes::Hermes2D::WeakForm< Scalar >::set_active_edge_state ( Element **  e,
unsigned char  isurf 
)
virtual

Provides possibility of setup edge-wise parameters. For parameters that only depend on element and edge and that do not have to be calculated for every form. This is rarely used and typically only for multi-physical tasks where there is a multitude of forms.

Definition at line 98 of file weakform.cpp.

template<typename Scalar >
void Hermes::Hermes2D::WeakForm< Scalar >::set_active_state ( Element **  e)
virtual

Provides possibility of setup element-wise parameters. For parameters that only depend on element and that do not have to be calculated for every form. This is rarely used and typically only for multi-physical tasks where there is a multitude of forms.

Definition at line 92 of file weakform.cpp.

template<typename Scalar >
void Hermes::Hermes2D::WeakForm< Scalar >::set_current_time ( double  time)

For time-dependent right-hand side functions. Sets current time.

Definition at line 785 of file weakform.cpp.

template<typename Scalar >
void Hermes::Hermes2D::WeakForm< Scalar >::set_current_time_step ( double  time_step)

For time-dependent right-hand side functions. Sets current time step.

Definition at line 797 of file weakform.cpp.

template<typename Scalar >
void Hermes::Hermes2D::WeakForm< Scalar >::set_ext ( MeshFunctionSharedPtr< Scalar >  ext)

External functions. Set one external function. IMPORTANT: This function will appear at the END (after those functions coming via set_u_ext_fn) of the Func<Scalar>** ext array in the value(), and ord() methods of individual forms.

Definition at line 222 of file weakform.cpp.

template<typename Scalar >
void Hermes::Hermes2D::WeakForm< Scalar >::set_ext ( std::vector< MeshFunctionSharedPtr< Scalar > >  ext)

External functions. Set external functions. IMPORTANT: These functions will appear at the END (after those functions coming via set_u_ext_fn) of the Func<Scalar>** ext array in the value(), and ord() methods of individual forms.

Definition at line 229 of file weakform.cpp.

template<typename Scalar >
void Hermes::Hermes2D::WeakForm< Scalar >::set_u_ext_fn ( UExtFunctionSharedPtr< Scalar >  ext)

External functions. Set one function acting on the u_ext functions in assembling (for fast assembling of nonlinear problems). IMPORTANT: This function will appear at the beginning of the Func<Scalar>** ext array in the value(), and ord() methods of individual forms.

Definition at line 235 of file weakform.cpp.

template<typename Scalar >
void Hermes::Hermes2D::WeakForm< Scalar >::set_u_ext_fn ( std::vector< UExtFunctionSharedPtr< Scalar > >  ext)

External functions. Set functions acting on the u_ext functions in assembling (for fast assembling of nonlinear problems). IMPORTANT: These functions will appear at the beginning of the Func<Scalar>** ext array in the value(), and ord() methods of individual forms.

Definition at line 242 of file weakform.cpp.


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