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

#include <essential_boundary_conditions.h>

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

Public Member Functions

 DefaultEssentialBCNonConst (std::vector< std::string > markers_, MeshFunctionSharedPtr< Scalar > exact_solution)
 
 DefaultEssentialBCNonConst (std::string marker, MeshFunctionSharedPtr< Scalar > exact_solution)
 
virtual Scalar value (double x, double y) const
 
EssentialBCValueType get_value_type () const
 Function giving info that u_Essential is a non-constant function.
 
- Public Member Functions inherited from Hermes::Hermes2D::EssentialBoundaryCondition< Scalar >
 EssentialBoundaryCondition ()
 Default constructor.
 
 EssentialBoundaryCondition (std::vector< std::string > markers)
 
 EssentialBoundaryCondition (std::string marker)
 
virtual ~EssentialBoundaryCondition ()
 Virtual destructor.
 
void set_current_time (double time)
 Set the current time for time-dependent boundary conditions.
 
double get_current_time () const
 Get the current time for time-dependent boundary conditions.
 

Public Attributes

ExactSolutionScalar< Scalar > * exact_solution
 

Additional Inherited Members

- Protected Attributes inherited from Hermes::Hermes2D::EssentialBoundaryCondition< Scalar >
Scalar value_const
 Special case of a constant function.
 
double current_time
 Current time.
 
std::vector< std::string > markers
 Markers.
 

Detailed Description

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

Class representing non-constant essential boundary condition for Scalar approximation. Typical usage - this example is a non-const Dirichlet boundary condition for the incompressible Navier-Stokes equations. class MyEssentialBCNonConst : public DefaultEssentialBCNonConst<double> { public:    MyEssentialBCNonConst(std::vector<std::string> markers, double vel_inlet, double H, double startup_time) :   EssentialBoundaryCondition<double>(markers), vel_inlet(vel_inlet), H(H), startup_time(startup_time) {};

// VERY IMPORTANT - overriding the method of the base class (DefaultEssentialBCNonConst::value) with a custom implementation. // NOTE - one can use the top-level base class (EssentialBoundaryCondition)'s methods for handling the time variable for time-dependent problems: get_current_time(). // NOTE - the 'virtual' keyword is not here anymore - because we will not need to further derive from this class and override this method. double value(double x, double y) const {   double val_y = vel_inlet * y*(H-y) / (H/2.)/(H/2.);   if (get_current_time() <= startup_time)   return val_y * get_current_time()/startup_time;   else   return val_y; };

protected:    double vel_inlet;  double H;  double startup_time; };

Definition at line 135 of file essential_boundary_conditions.h.

Member Function Documentation

template<typename Scalar >
Scalar Hermes::Hermes2D::DefaultEssentialBCNonConst< Scalar >::value ( double  x,
double  y 
) const
virtual

Represents a function prescribed on the boundary. Gets the boundary point coordinate as well as the normal and tangential vectors.

Parameters
[in]xx-coordinate of the point where the value is evaluated.
[in]yy-coordinate of the point where the value is evaluated.
[in]n_xthe x-component of the unit outer normal.
[in]n_ythe y-component of the unit outer normal.
[in]t_xthe x-component of the tangent(perpendicular to normal).
[in]t_ythe y-component of the tangent(perpendicular to normal).

Implements Hermes::Hermes2D::EssentialBoundaryCondition< Scalar >.

Definition at line 113 of file essential_boundary_conditions.cpp.


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