Docs/Finite Element (MFEM)/mfem.gridfunction.projectBdrCoefficient
Back to Finite Element (MFEM)

mfem.gridfunction.projectBdrCoefficient

Projects a constant value onto boundary DOFs for specified boundary attributes.

Syntax

mfem.gridfunction.projectBdrCoefficient(gf, value, bdrAttrs)

Description

Projects a constant value onto boundary DOFs for specified boundary attributes. This sets the DOF values on the specified boundaries to the given constant value. It is useful for applying Dirichlet boundary conditions where the boundary value is known. Only DOFs that lie on boundary elements with the specified attributes are modified. Interior DOFs remain unchanged.

Parameters

NameDescription
gf- GridFunction to modify
value- The constant value to project on boundary
bdrAttrs- Array of boundary attributes (1-based) to apply the value to

Returns

void