MFEM v4.7.0
Finite element discretization library
Loading...
Searching...
No Matches
mfem::PetscBCHandler Class Reference

Helper class for handling essential boundary conditions. More...

#include <petsc.hpp>

Public Types

enum  Type { ZERO , CONSTANT , TIME_DEPENDENT }
 

Public Member Functions

 PetscBCHandler (Type type_=ZERO)
 
 PetscBCHandler (Array< int > &ess_tdof_list, Type type_=ZERO)
 
virtual ~PetscBCHandler ()
 
Type GetType () const
 Returns the type of boundary conditions.
 
void SetType (enum Type type_)
 Sets the type of boundary conditions.
 
virtual void Eval (real_t t, Vector &g)
 Boundary conditions evaluation.
 
void SetTDofs (Array< int > &list)
 Sets essential dofs (local, per-process numbering)
 
Array< int > & GetTDofs ()
 Gets essential dofs (local, per-process numbering)
 
void SetTime (real_t t)
 Sets the current time.
 
void SetUp (PetscInt n)
 SetUp the helper object, where n is the size of the solution vector.
 
void ApplyBC (const Vector &x, Vector &y)
 y = x on ess_tdof_list_c and y = g (internally evaluated) on ess_tdof_list
 
void ApplyBC (Vector &x)
 Replace boundary dofs with the current value.
 
void FixResidualBC (const Vector &x, Vector &y)
 y = x-g on ess_tdof_list, the rest of y is unchanged
 
void Zero (Vector &x)
 Replace boundary dofs with 0.
 
void ZeroBC (const Vector &x, Vector &y)
 y = x on ess_tdof_list_c and y = 0 on ess_tdof_list
 

Detailed Description

Helper class for handling essential boundary conditions.

Definition at line 591 of file petsc.hpp.

Member Enumeration Documentation

◆ Type

Enumerator
ZERO 
CONSTANT 

Constant in time b.c.

TIME_DEPENDENT 

Definition at line 594 of file petsc.hpp.

Constructor & Destructor Documentation

◆ PetscBCHandler() [1/2]

mfem::PetscBCHandler::PetscBCHandler ( Type type_ = ZERO)
inline

Definition at line 601 of file petsc.hpp.

◆ PetscBCHandler() [2/2]

mfem::PetscBCHandler::PetscBCHandler ( Array< int > & ess_tdof_list,
enum PetscBCHandler::Type type_ = ZERO )

Definition at line 2804 of file petsc.cpp.

◆ ~PetscBCHandler()

virtual mfem::PetscBCHandler::~PetscBCHandler ( )
inlinevirtual

Definition at line 606 of file petsc.hpp.

Member Function Documentation

◆ ApplyBC() [1/2]

void mfem::PetscBCHandler::ApplyBC ( const Vector & x,
Vector & y )

y = x on ess_tdof_list_c and y = g (internally evaluated) on ess_tdof_list

Definition at line 2835 of file petsc.cpp.

◆ ApplyBC() [2/2]

void mfem::PetscBCHandler::ApplyBC ( Vector & x)

Replace boundary dofs with the current value.

Definition at line 2860 of file petsc.cpp.

◆ Eval()

virtual void mfem::PetscBCHandler::Eval ( real_t t,
Vector & g )
inlinevirtual

Boundary conditions evaluation.

In the result vector, g, only values at the essential dofs need to be set.

Definition at line 617 of file petsc.hpp.

◆ FixResidualBC()

void mfem::PetscBCHandler::FixResidualBC ( const Vector & x,
Vector & y )

y = x-g on ess_tdof_list, the rest of y is unchanged

Definition at line 2884 of file petsc.cpp.

◆ GetTDofs()

Array< int > & mfem::PetscBCHandler::GetTDofs ( )
inline

Gets essential dofs (local, per-process numbering)

Definition at line 624 of file petsc.hpp.

◆ GetType()

Type mfem::PetscBCHandler::GetType ( ) const
inline

Returns the type of boundary conditions.

Definition at line 609 of file petsc.hpp.

◆ SetTDofs()

void mfem::PetscBCHandler::SetTDofs ( Array< int > & list)

Sets essential dofs (local, per-process numbering)

Definition at line 2812 of file petsc.cpp.

◆ SetTime()

void mfem::PetscBCHandler::SetTime ( real_t t)
inline

Sets the current time.

Definition at line 627 of file petsc.hpp.

◆ SetType()

void mfem::PetscBCHandler::SetType ( enum Type type_)
inline

Sets the type of boundary conditions.

Definition at line 612 of file petsc.hpp.

◆ SetUp()

void mfem::PetscBCHandler::SetUp ( PetscInt n)

SetUp the helper object, where n is the size of the solution vector.

Definition at line 2819 of file petsc.cpp.

◆ Zero()

void mfem::PetscBCHandler::Zero ( Vector & x)

Replace boundary dofs with 0.

Definition at line 2903 of file petsc.cpp.

◆ ZeroBC()

void mfem::PetscBCHandler::ZeroBC ( const Vector & x,
Vector & y )

y = x on ess_tdof_list_c and y = 0 on ess_tdof_list

Definition at line 2912 of file petsc.cpp.


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