fdm

package
v0.0.0-...-1b5bcbe Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2016 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assemble

func Assemble(K11, K12 *la.Triplet, F1 []float64, src Cb_src, g *Grid2D, e *Equations)

func InitK11andK12

func InitK11andK12(K11, K12 *la.Triplet, e *Equations)

func JoinVecs

func JoinVecs(U, U1, U2 []float64, e *Equations)

Types

type Cb_fxy

type Cb_fxy func(x, y float64) (z float64) // z = f(x,y)

callbacks

type Cb_src

type Cb_src func(x, y float64) float64

type Equations

type Equations struct {
	N1, N2, N int   // unknowns, prescribed, total numbers
	RF1, FR1  []int // reduced=>full/full=>reduced maps for unknowns
	RF2, FR2  []int // reduced=>full/full=>reduced maps for prescribed
}

Equations

=========
K11 K12 => unknowns
K21 K22 => prescribed
 |   +---> prescribed
 +-------> unknowns

"RF" means "reduced to full"
"FR" means "full to reduced"
reduced 1: is a reduced system of equations where only unknown    equations are present
reduced 2: is a reduced system of equations where only prescribed equations are present
full     : corresponds to all equations, unknown and prescribed

Example:

N   = 9         => total number of equations
peq = [0  3  6] => prescribed equations

  0  1  2  3  4  5  6  7  8                       0   1  2   3   4  5   6   7  8
0 +--------+--------+------ 0 -- prescribed -- 0 [22] 21 21 [22] 21 21 [22] 21 21 0
1 |        |        |       1                  1  12  .. ..  12  .. ..  12  .. .. 1
2 |        |        |       2                  2  12  .. ..  12  .. ..  12  .. .. 2
3 +--------+--------+------ 3 -- prescribed -- 3 [22] 21 21 [22] 21 21 [22] 21 21 3
4 |        |        |       4                  4  12  .. ..  12  .. ..  12  .. .. 4
5 |        |        |       5                  5  12  .. ..  12  .. ..  12  .. .. 5
6 +--------+--------+------ 6 -- prescribed -- 6 [22] 21 21 [22] 21 21 [22] 21 21 6
7 |        |        |       7                  7  12  .. ..  12  .. ..  12  .. .. 7
8 |        |        |       8                  8  12  .. ..  12  .. ..  12  .. .. 8
  0  1  2  3  4  5  6  7  8                       0   1  2   3   4  5   6   7  8
  |        |        |
 pre      pre      pre                                 .. => 11 equations

N1 = 6 => number of equations of type 1 (unknowns)
N2 = 3 => number of equations of type 2 (prescribed)
N1 + N2 == N

       0  1  2  3  4  5
RF1 = [1  2  4  5  7  8]           => ex:  RF1[3] = full system equation # 5

       0  1  2  3  4  5  6  7  8
FR1 = [   0  1     2  3     4  5]  => ex:  FR1[5] = reduced system equation # 3
      -1       -1       -1         => indicates 'value not set'

       0  1  2
RF2 = [0  3  6]                    => ex:  RF2[1] = full system equation # 3

       0  1  2  3  4  5  6  7  8
FR2 = [0        1        2      ]  => ex:  FR2[3] = reduced system equation # 1
         -1 -1    -1 -1    -1 -1   => indicates 'value not set'

func (*Equations) Init

func (e *Equations) Init(n int, peq_notsorted []int)

func (*Equations) Print

func (e *Equations) Print()

type Grid2D

type Grid2D struct {
	Lx, Ly     float64
	Nx, Ny, N  int
	Dx, Dy     float64
	Dxx, Dyy   float64
	L, R, B, T []int
}

func (*Grid2D) Contour

func (g *Grid2D) Contour(dirout, fnkey string, fxy Cb_fxy, z []float64, nlevels int, show bool)

fxy or z must be nil

func (*Grid2D) Draw

func (g *Grid2D) Draw(dirout, fnkey string, show bool)

func (*Grid2D) Init

func (g *Grid2D) Init(lx, ly float64, nx, ny int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL