Hermes2D  3.0
Hermes::Hermes2D::DiscreteProblem< Scalar > Singleton Reference

#include <discrete_problem.h>

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

Public Types

typedef void(* reassembled_states_reuse_linear_system_fn )(Traverse::State **&states, unsigned int &num_states, SparseMatrix< Scalar > *mat, Vector< Scalar > *rhs, Vector< Scalar > *dirichlet_lift_rhs, Scalar *&coeff_vec)
 Experimental.
 

Public Member Functions

 DiscreteProblem (WeakFormSharedPtr< Scalar > wf, std::vector< SpaceSharedPtr< Scalar > > spaces, bool linear=false, bool dirichlet_lift_accordingly=true)
 
 DiscreteProblem (WeakFormSharedPtr< Scalar > wf, SpaceSharedPtr< Scalar > space, bool linear=false, bool dirichlet_lift_accordingly=true)
 
 DiscreteProblem (bool linear=false, bool dirichlet_lift_accordingly=true)
 
virtual ~DiscreteProblem ()
 Destuctor.
 
bool assemble (Scalar *&coeff_vec, SparseMatrix< Scalar > *mat, Vector< Scalar > *rhs=nullptr)
 Assembling.
 
bool assemble (Scalar *&coeff_vec, Vector< Scalar > *rhs=nullptr)
 
bool assemble (SparseMatrix< Scalar > *mat, Vector< Scalar > *rhs=nullptr)
 
bool assemble (Vector< Scalar > *rhs)
 
void set_time (double time)
 set time information for time-dependent problems.
 
void set_time_step (double time_step)
 
void set_spaces (std::vector< SpaceSharedPtr< Scalar > > spaces)
 Sets new_ spaces for the instance.
 
void set_space (SpaceSharedPtr< Scalar > space)
 
void set_weak_formulation (WeakFormSharedPtr< Scalar > wf)
 Set the weak forms.
 
std::vector< SpaceSharedPtr
< Scalar > > 
get_spaces ()
 Get all spaces as a std::vector.
 
void set_reassembled_states_reuse_linear_system_fn (reassembled_states_reuse_linear_system_fn fn)
 
void set_reusable_DOFs (bool **reusable_DOFs, bool **reusable_Dirichlet)
 
virtual void set_verbose_output (bool to_set)
 See Hermes::Mixins::Loggable.
 
- Public Member Functions inherited from Hermes::Hermes2D::Mixins::SettableSpaces< Scalar >
virtual SpaceSharedPtr< Scalar > get_space (int n)
 
- Public Member Functions inherited from Hermes::Hermes2D::Mixins::DiscreteProblemWeakForm< Scalar >
WeakFormSharedPtr< Scalar > get_weak_formulation () const
 

Public Attributes

reassembled_states_reuse_linear_system_fn reassembled_states_reuse_linear_system
 

Protected Member Functions

void init_assembling (Traverse::State **&states, unsigned int &num_states, std::vector< MeshSharedPtr > &meshes)
 Initialize states.
 
void deinit_assembling (Traverse::State **states, unsigned int num_states)
 
void set_RK (int original_spaces_count, bool force_diagonal_blocks=nullptr, Table *block_weights=nullptr)
 RungeKutta helpers.
 
bool isOkay () const
 State querying helpers.
 
std::string getClassName () const
 
void init (bool linear, bool dirichlet_lift_accordingly)
 Init function. Common code for the constructors.
 
bool set_matrix (SparseMatrix< Scalar > *mat)
 DiscreteProblemMatrixVector methods.
 
bool set_rhs (Vector< Scalar > *rhs)
 
void invalidate_matrix ()
 
- Protected Member Functions inherited from Hermes::Hermes2D::Mixins::DiscreteProblemRungeKutta< Scalar >
 DiscreteProblemRungeKutta ()
 Constructor for multiple components / equations.
 
double block_scaling_coeff (MatrixForm< Scalar > *form) const
 
double block_scaling_coeff (MatrixFormDG< Scalar > *form) const
 
- Protected Member Functions inherited from Hermes::Hermes2D::Mixins::DiscreteProblemWeakForm< Scalar >
 DiscreteProblemWeakForm (WeakFormSharedPtr< Scalar > wf=WeakFormSharedPtr< Scalar >(nullptr))
 

Protected Attributes

std::vector< SpaceSharedPtr
< Scalar > > 
spaces
 Space instances for all equations in the system.
 
int spaces_size
 
Vector< Scalar > * dirichlet_lift_rhs
 Dirichlet lift rhs part.
 
bool nonlinear
 Internal.
 
bool add_dirichlet_lift
 
DiscreteProblemThreadAssembler
< Scalar > ** 
threadAssembler
 Assembly data.
 
DiscreteProblemSelectiveAssembler
< Scalar > 
selectiveAssembler
 Select the right things to assemble.
 
- Protected Attributes inherited from Hermes::Hermes2D::Mixins::DiscreteProblemRungeKutta< Scalar >
bool rungeKutta
 Turn on Runge-Kutta specific handling of external functions.
 
int RK_original_spaces_count
 Number of spaces in the original problem in a Runge-Kutta method.
 
bool force_diagonal_blocks
 
Table * block_weights
 
- Protected Attributes inherited from Hermes::Hermes2D::Mixins::DiscreteProblemWeakForm< Scalar >
WeakFormSharedPtr< Scalar > wf
 Weak formulation.
 
- Protected Attributes inherited from Hermes::Hermes2D::Mixins::DiscreteProblemMatrixVector< Scalar >
SparseMatrix< Scalar > * current_mat
 
Vector< Scalar > * current_rhs
 
- Protected Attributes inherited from Hermes::Hermes2D::Mixins::Parallel
unsigned char num_threads_used
 
std::string exceptionMessageCaughtInParallelBlock
 

Friends

template<typename T >
class Solver
 
template<typename T >
class LinearSolver
 
template<typename T , typename S >
class AdaptSolver
 
template<typename T >
class NonlinearSolver
 
template<typename T >
class NewtonSolver
 
template<typename T >
class PicardSolver
 
template<typename T >
class RungeKutta
 
template<typename T >
class KellyTypeAdapt
 

Detailed Description

template<typename Scalar>
singleton Hermes::Hermes2D::DiscreteProblem< Scalar >

Discrete problem class.

This class does assembling into external matrix / vector structures.

Definition at line 37 of file discrete_problem.h.

Constructor & Destructor Documentation

template<typename Scalar >
Hermes::Hermes2D::DiscreteProblem< Scalar >::DiscreteProblem ( WeakFormSharedPtr< Scalar >  wf,
std::vector< SpaceSharedPtr< Scalar > >  spaces,
bool  linear = false,
bool  dirichlet_lift_accordingly = true 
)

Constructor for multiple components / equations. Making this DiscreteProblem linear does 2 things 1 - turns off initialization of previous iterations for nonlinear solvers. 2 - allows for assembling Dirichlet boundary conditions using a Dirichlet lift.

Parameters
[in]dirichlet_lift_accordinglyIf true, the appropriate settings for (linear / nonlinear) problem will be used (use Dirichlet lift iff the problem is linear). If false, the other way round.

Definition at line 32 of file discrete_problem.cpp.

template<typename Scalar >
Hermes::Hermes2D::DiscreteProblem< Scalar >::DiscreteProblem ( WeakFormSharedPtr< Scalar >  wf,
SpaceSharedPtr< Scalar >  space,
bool  linear = false,
bool  dirichlet_lift_accordingly = true 
)

Constructor for one equation. Making this DiscreteProblem linear does 2 things 1 - turns off initialization of previous iterations for nonlinear solvers. 2 - allows for assembling Dirichlet boundary conditions using a Dirichlet lift.

Parameters
[in]dirichlet_lift_accordinglyIf true, the appropriate settings for (linear / nonlinear) problem will be used (use Dirichlet lift iff the problem is linear). If false, the other way round.

Definition at line 40 of file discrete_problem.cpp.

template<typename Scalar >
Hermes::Hermes2D::DiscreteProblem< Scalar >::DiscreteProblem ( bool  linear = false,
bool  dirichlet_lift_accordingly = true 
)

Non-parameterized constructor. Making this DiscreteProblem linear does 2 things 1 - turns off initialization of previous iterations for nonlinear solvers. 2 - allows for assembling Dirichlet boundary conditions using a Dirichlet lift.

Parameters
[in]dirichlet_lift_accordinglyIf true, the appropriate settings for (linear / nonlinear) problem will be used (use Dirichlet lift iff the problem is linear). If false, the other way round.

Definition at line 48 of file discrete_problem.cpp.

Member Function Documentation

template<typename Scalar >
bool Hermes::Hermes2D::DiscreteProblem< Scalar >::assemble ( Scalar *&  coeff_vec,
Vector< Scalar > *  rhs = nullptr 
)

Assembling. Without the matrix.

Definition at line 236 of file discrete_problem.cpp.

template<typename Scalar >
bool Hermes::Hermes2D::DiscreteProblem< Scalar >::assemble ( SparseMatrix< Scalar > *  mat,
Vector< Scalar > *  rhs = nullptr 
)

Light version passing nullptr for the coefficient vector. External solutions are initialized with zeros.

Definition at line 229 of file discrete_problem.cpp.

template<typename Scalar >
bool Hermes::Hermes2D::DiscreteProblem< Scalar >::assemble ( Vector< Scalar > *  rhs)

Light version passing nullptr for the coefficient vector. External solutions are initialized with zeros. Without the matrix.

Definition at line 242 of file discrete_problem.cpp.


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