Documentation ¶
Overview ¶
Package pde implements numerical methods for the solution of Partial Differential Equations. For example, this package includes the Finite Difference and the Spectral Collocation methods.
Index ¶
- type BoundaryConds
- func (o *BoundaryConds) AddUsingTag(tag, dof int, cvalue float64, fvalue fun.Svs)
- func (o *BoundaryConds) Has(node int) bool
- func (o *BoundaryConds) Nodes() (list []int)
- func (o *BoundaryConds) NormalGrid(N la.Vector, node int)
- func (o *BoundaryConds) Print() (l string)
- func (o *BoundaryConds) Tags(node int) []int
- func (o *BoundaryConds) Value(node, dof int, t float64) (tags []int, val float64, available bool)
- type FdmLaplacian
- type SpcLaplacian
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BoundaryConds ¶
type BoundaryConds struct {
// contains filtered or unexported fields
}
BoundaryConds holds data for prescribing a SET of boundary conditions
func NewBoundaryCondsGrid ¶
func NewBoundaryCondsGrid(grid *gm.Grid, ndof int) (o *BoundaryConds)
NewBoundaryCondsGrid returns a new structure using Grid
func NewBoundaryCondsMesh ¶
func NewBoundaryCondsMesh(mesh *msh.Mesh, ndof int) (o *BoundaryConds)
NewBoundaryCondsMesh returns a new structure using Mesh
func (*BoundaryConds) AddUsingTag ¶
func (o *BoundaryConds) AddUsingTag(tag, dof int, cvalue float64, fvalue fun.Svs)
AddUsingTag sets boundary condition using edge or face tag from grid or mesh
tag -- edge or face tag dof -- index of "degree-of-freedom"; e.g. 0⇒horizontal displacement, 1⇒vertical displacement cvalue -- constant value [optional]; or fvalue -- function value [optional]
func (*BoundaryConds) Has ¶
func (o *BoundaryConds) Has(node int) bool
Has tells whether node has prescribed boundary condition or not
func (*BoundaryConds) Nodes ¶
func (o *BoundaryConds) Nodes() (list []int)
Nodes returns (unique/sorted) list of nodes with prescribed boundary conditions
func (*BoundaryConds) NormalGrid ¶
func (o *BoundaryConds) NormalGrid(N la.Vector, node int)
NormalGrid computes the outward normal at node (summed at corners) [when using Grid only] NOTE: returns zero normal if node doesn't have prescribed condition
func (*BoundaryConds) Print ¶
func (o *BoundaryConds) Print() (l string)
Print prints boundary conditions
func (*BoundaryConds) Tags ¶
func (o *BoundaryConds) Tags(node int) []int
Tags returns tags used to prescribe boundary condition at node NOTE: returns empty list of node does not have boundary condition
type FdmLaplacian ¶
type FdmLaplacian struct { Kx float64 // isotropic coefficient x Ky float64 // isotropic coefficient y Kz float64 // isotropic coefficient z Grid *gm.Grid // grid Source fun.Svs // source term function s({x},t) EssenBcs *BoundaryConds // essential boundary conditions Eqs *la.Equations // equations // contains filtered or unexported fields }
FdmLaplacian implements the Finite Difference (FDM) Laplacian operator (2D or 3D)
∂²u ∂²u ∂²u L{u} = kx ——— + ky ——— + kz ——— ∂x² ∂y² ∂z²
func NewFdmLaplacian ¶
NewFdmLaplacian creates a new FDM Laplacian operator with given parameters
func (*FdmLaplacian) AddEbc ¶
func (o *FdmLaplacian) AddEbc(tag int, cvalue float64, fvalue fun.Svs)
AddEbc adds essential boundary condition given tag of edge or face
tag -- edge or face tag in grid cvalue -- constant value [optional]; or fvalue -- function value [optional]
func (*FdmLaplacian) Assemble ¶
func (o *FdmLaplacian) Assemble(reactions bool)
Assemble assembles operator into A matrix from [A] ⋅ {u} = {b}
reactions -- prepare for computation of RHS
func (*FdmLaplacian) SetHbc ¶
func (o *FdmLaplacian) SetHbc()
SetHbc sets homogeneous boundary conditions; i.e. all boundaries with zero EBC
func (*FdmLaplacian) SolveSteady ¶
func (o *FdmLaplacian) SolveSteady(reactions bool) (u, f []float64)
SolveSteady solves steady problem
Solves: [K]⋅{u} = {f} represented by [A]⋅{x} = {b}
type SpcLaplacian ¶
type SpcLaplacian struct { LagInt fun.LagIntSet // Lagrange interpolators [ndim] Grid *gm.Grid // grid Source fun.Svs // source term function s({x},t) EssenBcs *BoundaryConds // essential boundary conditions NaturBcs *BoundaryConds // natural boundary conditions Eqs *la.Equations // equations // contains filtered or unexported fields }
SpcLaplacian implements the Spectral Collocation (SPC) Laplacian operator (2D or 3D)
∂²φ ∂²φ ∂²φ ∂φ ∂φ L{φ} = ∇²φ = ——— g¹¹ + ——— g²² + ———— 2g¹² - —— L¹ - —— L² ∂a² ∂b² ∂a∂b ∂a ∂b with a=u[0]=r and b=u[1]=s
func NewSpcLaplacian ¶
func NewSpcLaplacian(params dbf.Params, lis fun.LagIntSet, grid *gm.Grid, source fun.Svs) (o *SpcLaplacian)
NewSpcLaplacian creates a new SPC Laplacian operator with given parameters
NOTE: params is not used at the moment
func (*SpcLaplacian) AddEbc ¶
func (o *SpcLaplacian) AddEbc(tag int, cvalue float64, fvalue fun.Svs)
AddEbc adds essential boundary condition given tag of edge or face
tag -- edge or face tag in grid cvalue -- constant value [optional]; or fvalue -- function value [optional]
func (*SpcLaplacian) AddNbc ¶
func (o *SpcLaplacian) AddNbc(tag int, cvalue float64, fvalue fun.Svs)
AddNbc adds natural boundary condition given tag of edge or face
tag -- edge or face tag in grid cvalue -- constant value [optional]; or fvalue -- function value [optional]
func (*SpcLaplacian) Assemble ¶
func (o *SpcLaplacian) Assemble(reactions bool)
Assemble assembles operator into A matrix from [A] ⋅ {u} = {b}
reactions -- prepare for computation of RHS
func (*SpcLaplacian) SetHbc ¶
func (o *SpcLaplacian) SetHbc()
SetHbc sets homogeneous boundary conditions; i.e. all boundaries with zero EBC
func (*SpcLaplacian) SolveSteady ¶
func (o *SpcLaplacian) SolveSteady(reactions bool) (u, f []float64)
SolveSteady solves steady problem
Solves: [K]⋅{u} = {f} represented by [A]⋅{x} = {b}