MATLAB/Octave API

This page documents the API of the MOLE MATLAB/Octave module. Functions are organized by category.

Differential Operators

Gradient Operators

grad(k, m, dx, dc, nc)

PURPOSE

Returns a one-dimensional mimetic gradient operator depending on whether

SYNOPSIS

function grad

DESCRIPTION

or not the operator will contain a periodic boundary condition type
a0 U + b0 dU/dn = g,
(optional) dc : a0 (2x1 vector for left and right vertices, resp.)
(optional) nc : b0 (2x1 vector for left and right vertices, resp.)

               k : Order of accuracy
               m : Number of cells
              dx : Step size

CROSS-REFERENCE INFORMATION

This function calls:

gradNonPeriodic() Returns a m+1 by m+2 one-dimensional mimetic gradient operator

gradPeriodic() Returns a m by m+2 one-dimensional mimetic gradient operator

This function is called by:

weightsP() Returns the m+1 weights of P

grad3DCurv() Returns a 3D curvilinear mimetic gradient

mimeticB() Returns a m+2 by m+1 one-dimensional mimetic boundary operator

lap() Returns a one-dimensional mimetic Laplacian operator depending on whether

addScalarBC1Dlhs() This functions uses geometry and boundary type conditions to create

gradNonUniform() Returns a m+1 by m+2 one-dimensional non-uniform mimetic gradient

robinBC() Returns a m+2 by m+2 one-dimensional mimetic boundary operator that

mixedBC() Constructs a 1D mimetic mixed boundary conditions operator

grad2D(k, m, dx, n, dy, dc, nc)

PURPOSE

Returns a two-dimensional mimetic gradient operator depending on whether

SYNOPSIS

function grad2D

DESCRIPTION

or not the operator will contain a periodic boundary condition type
a0 U + b0 dU/dn = g,
(optional) dc : a0 (4x1 vector for left, right, bottom, top boundaries, resp.)
(optional) nc : b0 (4x1 vector for left, right, bottom, top boundaries, resp.)

               k : Order of accuracy
               m : Number of cells
              dx : Step size
               n : Number of cells along y-axis
              dy : Step size along y-axis

CROSS-REFERENCE INFORMATION

This function calls:

gradNonPeriodic2D() Returns a two-dimensional mimetic gradient operator

gradNonPeriodic() Returns a m+1 by m+2 one-dimensional mimetic gradient operator

gradPeriodic() Returns a m by m+2 one-dimensional mimetic gradient operator

This function is called by:

grad2DCurv() Returns a 2D curvilinear mimetic gradient

lap2D() Returns a two-dimensional mimetic Laplacian operator depending on whether

grad2DCurv(k, X, Y)

PURPOSE

Returns a 2D curvilinear mimetic gradient

SYNOPSIS

function grad2DCurv

DESCRIPTION

CROSS-REFERENCE INFORMATION

This function calls:

GI2()

jacobian2D() Returns:

grad2D() Returns a two-dimensional mimetic gradient operator depending on whether

grad2DNonUniform(k, xticks, yticks)

PURPOSE

Returns a two-dimensional non-uniform mimetic gradient operator

SYNOPSIS

function grad2DNonUniform

DESCRIPTION

(including the boundaries!)

               k : Order of accuracy
          xticks : Centers' ticks (x-axis)
          yticks : Centers' ticks (y-axis)

CROSS-REFERENCE INFORMATION

This function calls:

gradNonUniform() Returns a m+1 by m+2 one-dimensional non-uniform mimetic gradient

grad3D(k, m, dx, n, dy, o, dz, dc, nc)

PURPOSE

Returns a three-dimensional mimetic gradient operator depending on whether

SYNOPSIS

function grad3D

DESCRIPTION

or not the operator will contain a periodic boundary condition type
a0 U + b0 dU/dn = g,
(optional) dc : a0 (6x1 vector for left, right, bottom, top, front, back boundary types, resp.)
(optional) nc : b0 (6x1 vector for left, right, bottom, top, front, back boundary types, resp.)

               k : Order of accuracy
               m : Number of cells
              dx : Step size
               n : Number of cells along y-axis
              dy : Step size along y-axis
               o : Number of cells along z-axis
              dz : Step size along z-axis

CROSS-REFERENCE INFORMATION

This function calls:

gradNonPeriodic3D() Returns a three-dimensional mimetic gradient operator

gradNonPeriodic() Returns a m+1 by m+2 one-dimensional mimetic gradient operator

gradPeriodic() Returns a m by m+2 one-dimensional mimetic gradient operator

This function is called by:

lap3D() Returns a three-dimensional mimetic Laplacian operator depending on whether

grad3DCurv() Returns a 3D curvilinear mimetic gradient

grad3DCurv(k, X, Y, Z)

PURPOSE

Returns a 3D curvilinear mimetic gradient

SYNOPSIS

function grad3DCurv

DESCRIPTION

CROSS-REFERENCE INFORMATION

This function calls:

jacobian3D() Returns:

grad() Returns a one-dimensional mimetic gradient operator depending on whether

grad3D() Returns a three-dimensional mimetic gradient operator depending on whether

GI13()

grad3DNonUniform(k, xticks, yticks, zticks)

PURPOSE

Returns a three-dimensional non-uniform mimetic gradient operator

SYNOPSIS

function grad3DNonUniform

DESCRIPTION

(including the boundaries!)

               k : Order of accuracy
          xticks : Centers' ticks (x-axis)
          yticks : Centers' ticks (y-axis)
          zticks : Centers' ticks (z-axis)

CROSS-REFERENCE INFORMATION

This function calls:

gradNonUniform() Returns a m+1 by m+2 one-dimensional non-uniform mimetic gradient

gradNonUniform(k, ticks)

PURPOSE

Returns a m+1 by m+2 one-dimensional non-uniform mimetic gradient

SYNOPSIS

function gradNonUniform

DESCRIPTION

operator
(including the boundaries!)

               k : Order of accuracy
           ticks : Centers' ticks e.g. [0 0.5 1 3 5 7 8 9 9.5 10]

CROSS-REFERENCE INFORMATION

This function calls:

grad() Returns a one-dimensional mimetic gradient operator depending on whether

This function is called by:

grad2DNonUniform() Returns a two-dimensional non-uniform mimetic gradient operator

grad3DNonUniform() Returns a three-dimensional non-uniform mimetic gradient operator

Divergence Operators

div(k, m, dx, dc, nc)

PURPOSE

Returns a one-dimensional mimetic divergence operator depending on whether

SYNOPSIS

function div

DESCRIPTION

or not the operator will contain a periodic boundary condition type
a0 U + b0 dU/dn = g,
(optional) dc : a0 (2x1 vector for left and right vertices, resp.)
(optional) nc : b0 (2x1 vector for left and right vertices, resp.)

               k : Order of accuracy
               m : Number of cells
              dx : Step size

CROSS-REFERENCE INFORMATION

This function calls:

divPeriodic() Returns a m+2 by m one-dimensional mimetic divergence operator

divNonPeriodic() Returns a m+2 by m+1 one-dimensional mimetic divergence operator

This function is called by:

weightsQ() Returns the m+2 weights of Q

mimeticB() Returns a m+2 by m+1 one-dimensional mimetic boundary operator

divNonUniform() Returns a m+2 by m+1 one-dimensional non-uniform mimetic divergence

lap() Returns a one-dimensional mimetic Laplacian operator depending on whether

div3DCurv()

div2D(k, m, dx, n, dy, dc, nc)

PURPOSE

Returns a two-dimensional mimetic divergence operator depending on whether

SYNOPSIS

function div2D

DESCRIPTION

or not the operator will contain a periodic boundary condition type
a0 U + b0 dU/dn = g,
(optional) dc : a0 (4x1 vector for left, right, bottom, top boundaries, resp.)
(optional) nc : b0 (4x1 vector for left, right, bottom, top boundaries, resp.)

               k : Order of accuracy
               m : Number of cells
              dx : Step size
               n : Number of cells along y-axis
              dy : Step size along y-axis

CROSS-REFERENCE INFORMATION

This function calls:

divPeriodic() Returns a m+2 by m one-dimensional mimetic divergence operator

divNonPeriodic() Returns a m+2 by m+1 one-dimensional mimetic divergence operator

divNonPeriodic2D() Returns a two-dimensional mimetic divergence operator

This function is called by:

curl2D() Returns a two-dimensional mimetic curl operator

div2DCurv()

lap2D() Returns a two-dimensional mimetic Laplacian operator depending on whether

div2DCurv(k, X, Y)
div2DNonUniform(k, xticks, yticks)

PURPOSE

Returns a two-dimensional non-uniform mimetic divergence operator

SYNOPSIS

function div2DNonUniform

DESCRIPTION

     k : Order of accuracy
xticks : Edges' ticks (x-axis)
yticks : Edges' ticks (y-axis)

CROSS-REFERENCE INFORMATION

This function calls:

divNonUniform() Returns a m+2 by m+1 one-dimensional non-uniform mimetic divergence

div3D(k, m, dx, n, dy, o, dz, dc, nc)

PURPOSE

Returns a three-dimensional mimetic divergence operator depending on whether

SYNOPSIS

function div3D

DESCRIPTION

or not the operator will contain a periodic boundary condition type
a0 U + b0 dU/dn = g,
(optional) dc : a0 (6x1 vector for left, right, bottom, top, front, back boundary types, resp.)
(optional) nc : b0 (6x1 vector for left, right, bottom, top, front, back boundary types, resp.)

               k : Order of accuracy
               m : Number of cells
              dx : Step size
               n : Number of cells along y-axis
              dy : Step size along y-axis
               o : Number of cells along z-axis
              dz : Step size along z-axis

CROSS-REFERENCE INFORMATION

This function calls:

divNonPeriodic3D() Returns a three-dimensional mimetic divergence operator

divPeriodic() Returns a m+2 by m one-dimensional mimetic divergence operator

divNonPeriodic() Returns a m+2 by m+1 one-dimensional mimetic divergence operator

This function is called by:

div3DCurv()

lap3D() Returns a three-dimensional mimetic Laplacian operator depending on whether

div3DCurv(k, X, Y, Z)
div3DNonUniform(k, xticks, yticks, zticks)

PURPOSE

Returns a three-dimensional non-uniform mimetic divergence operator

SYNOPSIS

function div3DNonUniform

DESCRIPTION

     k : Order of accuracy
xticks : Edges' ticks (x-axis)
yticks : Edges' ticks (y-axis)
zticks : Edges' ticks (z-axis)

CROSS-REFERENCE INFORMATION

This function calls:

divNonUniform() Returns a m+2 by m+1 one-dimensional non-uniform mimetic divergence

divNonUniform(k, ticks)

PURPOSE

Returns a m+2 by m+1 one-dimensional non-uniform mimetic divergence

SYNOPSIS

function divNonUniform

DESCRIPTION

operator

               k : Order of accuracy
           ticks : Edges' ticks e.g. [0 0.1 0.15 0.2 0.3 0.4 0.45]

CROSS-REFERENCE INFORMATION

This function calls:

div() Returns a one-dimensional mimetic divergence operator depending on whether

This function is called by:

div3DNonUniform() Returns a three-dimensional non-uniform mimetic divergence operator

div2DNonUniform() Returns a two-dimensional non-uniform mimetic divergence operator

Curl Operators

curl2D(k, m, dx, n, dy, west, east, south, north, U, V)

PURPOSE

Returns a two-dimensional mimetic curl operator

SYNOPSIS

function curl2D

DESCRIPTION

west, east,
south, north : west, east, south, north limits
U(X,Y) must be defined as function handle
V(X,Y) must be defined as function handle

               k : Order of accuracy
               m : Number of cells along x-axis
              dx : Step size along x-axis
               n : Number of cells along y-axis
              dy : Step size along y-axis
               U : Vector space function acting on x-direction
               V : Vector space function acting on y-direction

CROSS-REFERENCE INFORMATION

This function calls:

div2D() Returns a two-dimensional mimetic divergence operator depending on whether

Laplacian Operators

lap(k, m, dx, dc, nc)

PURPOSE

Returns a one-dimensional mimetic Laplacian operator depending on whether

SYNOPSIS

function lap

DESCRIPTION

or not the operator will contain a periodic boundary condition type
a0 U + b0 dU/dn = g,
(optional) dc : a0 (2x1 vector for left and right vertices, resp.)
(optional) nc : b0 (2x1 vector for left and right vertices, resp.)

               k : Order of accuracy
               m : Number of cells
              dx : Step size

CROSS-REFERENCE INFORMATION

This function calls:

grad() Returns a one-dimensional mimetic gradient operator depending on whether

lapNonPeriodic() Returns a m+2 by m+2 one-dimensional mimetic laplacian operator

div() Returns a one-dimensional mimetic divergence operator depending on whether

lap2D(k, m, dx, n, dy, dc, nc)

PURPOSE

Returns a two-dimensional mimetic Laplacian operator depending on whether

SYNOPSIS

function lap2D

DESCRIPTION

or not the operator will contain a periodic boundary condition type
a0 U + b0 dU/dn = g,
(optional) dc : a0 (4x1 vector for left, right, bottom, top boundaries, resp.)
(optional) nc : b0 (4x1 vector for left, right, bottom, top boundaries, resp.)

               k : Order of accuracy
               m : Number of cells along x-axis
              dx : Step size along x-axis
               n : Number of cells along y-axis
              dy : Step size along y-axis

CROSS-REFERENCE INFORMATION

This function calls:

lapNonPeriodic2D() Returns a two-dimensional mimetic laplacian operator

div2D() Returns a two-dimensional mimetic divergence operator depending on whether

grad2D() Returns a two-dimensional mimetic gradient operator depending on whether

lap3D(k, m, dx, n, dy, o, dz, dc, nc)

PURPOSE

Returns a three-dimensional mimetic Laplacian operator depending on whether

SYNOPSIS

function lap3D

DESCRIPTION

or not the operator will contain a periodic boundary condition type
a0 U + b0 dU/dn = g,
(optional) dc : a0 (6x1 vector for left, right, bottom, top, front, back boundary types, resp.)
(optional) nc : b0 (6x1 vector for left, right, bottom, top, front, back boundary types, resp.)

               k : Order of accuracy
               m : Number of cells along x-axis
              dx : Step size along x-axis
               n : Number of cells along y-axis
              dy : Step size along y-axis
               o : Number of cells along z-axis
              dz : Step size along z-axis

CROSS-REFERENCE INFORMATION

This function calls:

div3D() Returns a three-dimensional mimetic divergence operator depending on whether

lapNonPeriodic3D() Returns a three-dimensional mimetic laplacian operator

grad3D() Returns a three-dimensional mimetic gradient operator depending on whether

Interpolation Functions

Node to Center Interpolation

interpolNodesToCenters1D(k, m)

PURPOSE

interpolation operator from nodal coordinates to staggered centers

SYNOPSIS

function interpolNodesToCenters1D

DESCRIPTION

m is the number of cells in the logical x-axis
nodal logical coordinates are [1:1:m]
centers logical coordinates [1,1.5:m-0.5,m]

CROSS-REFERENCE INFORMATION

This function calls:

interpolFacesToCentersG1D() 1D interpolation from faces to centers

interpolNodesToCenters2D(k, m, n)

PURPOSE

interpolation operator from nodal coordinates to staggered centers

SYNOPSIS

function interpolNodesToCenters2D

DESCRIPTION

m, n, are the number of cells in the logical x-, y- axes
nodal logical coordinates are [1:1:m]x[1:1:n]
centers logical coordinates [1,1.5:m-0.5,m]x[1,1.5:n-0.5,n]

CROSS-REFERENCE INFORMATION

This function calls:

interpolFacesToCentersG1D() 1D interpolation from faces to centers

interpolNodesToCenters3D(k, m, n, o)

PURPOSE

interpolation operator from nodal coordinates to staggered centers

SYNOPSIS

function interpolNodesToCenters3D

DESCRIPTION

m, n, o, are the number of cells in the logical x-, y-, z- axes
nodal logical coordinates are [1:1:m]x[1:1:n]x[1:1:o]
centers logical coordinates [1,1.5:m-0.5,m]x[1,1.5:n-0.5,n]x[1,1.5:o-0.5,o]

CROSS-REFERENCE INFORMATION

This function calls:

interpolFacesToCentersG1D() 1D interpolation from faces to centers

Center to Node Interpolation

interpolCentersToNodes1D(k, m)

PURPOSE

interpolation operator from nodal coordinates to staggered centers

SYNOPSIS

function interpolCentersToNodes1D

DESCRIPTION

m is the number of cells in the logical x-axis
nodal logical coordinates are [1:1:m]
centers logical coordinates [1,1.5:m-0.5,m]

CROSS-REFERENCE INFORMATION

This function calls:

interpolCentersToFacesD1D() 1D interpolation from centers to faces.

interpolCentersToNodes2D(k, m, n)

PURPOSE

interpolation operator from staggered to nodes

SYNOPSIS

function interpolCentersToNodes2D

DESCRIPTION

m, n, are the number of cells in the logical x-, y- axes
nodal logical coordinates are [1:1:m]x[1:1:n]
centers logical coordinates [1,1.5:m-0.5,m]x[1,1.5:n-0.5,n]

CROSS-REFERENCE INFORMATION

This function calls:

interpolCentersToFacesD1D() 1D interpolation from centers to faces.

interpolCentersToNodes3D(k, m, n, o)

PURPOSE

interpolation operator from staggered to nodes

SYNOPSIS

function interpolCentersToNodes3D

DESCRIPTION

m, n, o, are the number of cells in the logical x-, y-, z- axes
nodal logical coordinates are [1:1:m]x[1:1:n]x[1:1:o]
centers logical coordinates [1,1.5:m-0.5,m]x[1,1.5:n-0.5,n]x[1,1.5:o-0.5,o]

CROSS-REFERENCE INFORMATION

This function calls:

interpolCentersToFacesD1D() 1D interpolation from centers to faces.

Face Interpolation

interpolFacesToCentersG1D(k, m)

PURPOSE

1D interpolation from faces to centers

SYNOPSIS

function interpolFacesToCentersG1D

DESCRIPTION

centers logical coordinates [1,1.5:m-0.5,m]
m is the number of cells in the logical x-axis

CROSS-REFERENCE INFORMATION

This function is called by:

interpolNodesToCenters3D() interpolation operator from nodal coordinates to staggered centers

interpolFacesToCentersG3D() 3D interpolation from faces to centers

interpolFacesToCentersG2D() 2D interpolation from faces to centers

interpolNodesToCenters2D() interpolation operator from nodal coordinates to staggered centers

interpolNodesToCenters1D() interpolation operator from nodal coordinates to staggered centers

interpolFacesToCentersG2D(k, m, n)

PURPOSE

2D interpolation from faces to centers

SYNOPSIS

function interpolFacesToCentersG2D

DESCRIPTION

centers logical coordinates [1,1.5:m-0.5,m]x[1,1.5:n-0.5,n]
m, n, are the number of cells in the logical x- and y- axes

CROSS-REFERENCE INFORMATION

This function calls:

interpolFacesToCentersG1D() 1D interpolation from faces to centers

interpolFacesToCentersG3D(k, m, n, o)

PURPOSE

3D interpolation from faces to centers

SYNOPSIS

function interpolFacesToCentersG3D

DESCRIPTION

centers logical coordinates [1,1.5:m-0.5,m]x[1,1.5:n-0.5,n]x[1,1.5:o-0.5,o]
m, n, o, are the number of cells in the logical x-, y-, z- axes

CROSS-REFERENCE INFORMATION

This function calls:

interpolFacesToCentersG1D() 1D interpolation from faces to centers

General Interpolation

interpol(m, c)

PURPOSE

Returns a m+1 by m+2 one-dimensional interpolator of 2nd-order

SYNOPSIS

function interpol

DESCRIPTION

m : Number of cells
c : Left interpolation coeff.

CROSS-REFERENCE INFORMATION

This function is called by:

interpol3D() Returns a three-dimensional interpolator of 2nd-order

interpol2D() Returns a two-dimensional interpolator of 2nd-order

interpol2D(m, n, c1, c2)

PURPOSE

Returns a two-dimensional interpolator of 2nd-order

SYNOPSIS

function interpol2D

DESCRIPTION

 m : Number of cells along x-axis
 n : Number of cells along y-axis
c1 : Left interpolation coeff.
c2 : Bottom interpolation coeff.

CROSS-REFERENCE INFORMATION

This function calls:

interpol() Returns a m+1 by m+2 one-dimensional interpolator of 2nd-order

interpol3D(m, n, o, c1, c2, c3)

PURPOSE

Returns a three-dimensional interpolator of 2nd-order

SYNOPSIS

function interpol3D

DESCRIPTION

 m : Number of cells along x-axis
 n : Number of cells along y-axis
 o : Number of cells along z-axis
c1 : Left interpolation coeff.
c2 : Bottom interpolation coeff.
c3 : Front interpolation coeff.

CROSS-REFERENCE INFORMATION

This function calls:

interpol() Returns a m+1 by m+2 one-dimensional interpolator of 2nd-order

interpolD(m, c)

PURPOSE

Returns a m+2 by m+1 one-dimensional interpolator of 2nd-order

SYNOPSIS

function interpolD

DESCRIPTION

m : Number of cells
c : Left interpolation coeff.

CROSS-REFERENCE INFORMATION

This function is called by:

interpolD3D() Returns a three-dimensional interpolator of 2nd-order

interpolD2D() Returns a two-dimensional interpolator of 2nd-order

interpolD2D(m, n, c1, c2)

PURPOSE

Returns a two-dimensional interpolator of 2nd-order

SYNOPSIS

function interpolD2D

DESCRIPTION

 m : Number of cells along x-axis
 n : Number of cells along y-axis
c1 : Left interpolation coeff.
c2 : Bottom interpolation coeff.

CROSS-REFERENCE INFORMATION

This function calls:

interpolD() Returns a m+2 by m+1 one-dimensional interpolator of 2nd-order

interpolD3D(m, n, o, c1, c2, c3)

PURPOSE

Returns a three-dimensional interpolator of 2nd-order

SYNOPSIS

function interpolD3D

DESCRIPTION

 m : Number of cells along x-axis
 n : Number of cells along y-axis
 o : Number of cells along z-axis
c1 : Left interpolation coeff.
c2 : Bottom interpolation coeff.
c3 : Front interpolation coeff.

CROSS-REFERENCE INFORMATION

This function calls:

interpolD() Returns a m+2 by m+1 one-dimensional interpolator of 2nd-order

Boundary Conditions

General Boundary Conditions

addBC1D()

PURPOSE

The type of the None singleton.

SYNOPSIS

function addBC1D

DESCRIPTION

CROSS-REFERENCE INFORMATION

No cross-reference information found. This typically means this function neither calls nor is called by other functions in the codebase.

addBC1Dlhs()

PURPOSE

The type of the None singleton.

SYNOPSIS

function addBC1Dlhs

DESCRIPTION

CROSS-REFERENCE INFORMATION

No cross-reference information found. This typically means this function neither calls nor is called by other functions in the codebase.

addBC1Drhs()

PURPOSE

The type of the None singleton.

SYNOPSIS

function addBC1Drhs

DESCRIPTION

CROSS-REFERENCE INFORMATION

No cross-reference information found. This typically means this function neither calls nor is called by other functions in the codebase.

addBC2D()

PURPOSE

The type of the None singleton.

SYNOPSIS

function addBC2D

DESCRIPTION

CROSS-REFERENCE INFORMATION

No cross-reference information found. This typically means this function neither calls nor is called by other functions in the codebase.

addBC2Dlhs()

PURPOSE

The type of the None singleton.

SYNOPSIS

function addBC2Dlhs

DESCRIPTION

CROSS-REFERENCE INFORMATION

No cross-reference information found. This typically means this function neither calls nor is called by other functions in the codebase.

addBC2Drhs()

PURPOSE

The type of the None singleton.

SYNOPSIS

function addBC2Drhs

DESCRIPTION

CROSS-REFERENCE INFORMATION

No cross-reference information found. This typically means this function neither calls nor is called by other functions in the codebase.

addBC3D()

PURPOSE

The type of the None singleton.

SYNOPSIS

function addBC3D

DESCRIPTION

CROSS-REFERENCE INFORMATION

No cross-reference information found. This typically means this function neither calls nor is called by other functions in the codebase.

addBC3Dlhs()

PURPOSE

The type of the None singleton.

SYNOPSIS

function addBC3Dlhs

DESCRIPTION

CROSS-REFERENCE INFORMATION

No cross-reference information found. This typically means this function neither calls nor is called by other functions in the codebase.

addBC3Drhs()

PURPOSE

The type of the None singleton.

SYNOPSIS

function addBC3Drhs

DESCRIPTION

CROSS-REFERENCE INFORMATION

No cross-reference information found. This typically means this function neither calls nor is called by other functions in the codebase.

Neumann Boundary Conditions

neumann2DCurv(G, m, n, b)

PURPOSE

Returns a 2D curvilinear Neumann BC operator

SYNOPSIS

function neumann2DCurv

DESCRIPTION

CROSS-REFERENCE INFORMATION

No cross-reference information found. This typically means this function neither calls nor is called by other functions in the codebase.

neumann3DCurv(G, m, n, o, b)

PURPOSE

Returns a 3D curvilinear Neumann BC operator

SYNOPSIS

function neumann3DCurv

DESCRIPTION

CROSS-REFERENCE INFORMATION

No cross-reference information found. This typically means this function neither calls nor is called by other functions in the codebase.

Robin Boundary Conditions

robinBC(k, m, dx, a, b)

PURPOSE

Returns a m+2 by m+2 one-dimensional mimetic boundary operator that

SYNOPSIS

function robinBC

DESCRIPTION

imposes a boundary condition of Robin's type

               k : Order of accuracy
               m : Number of cells
              dx : Step size
               a : Dirichlet Coefficient
               b : Neumann Coefficient

CROSS-REFERENCE INFORMATION

This function calls:

grad() Returns a one-dimensional mimetic gradient operator depending on whether

This function is called by:

robinBC3D() Returns a three-dimensional mimetic boundary operator that

robinBC2D() Returns a two-dimensional mimetic boundary operator that

robinBC2D(k, m, dx, n, dy, a, b)

PURPOSE

Returns a two-dimensional mimetic boundary operator that

SYNOPSIS

function robinBC2D

DESCRIPTION

imposes a boundary condition of Robin's type

               k : Order of accuracy
               m : Number of cells along x-axis
              dx : Step size along x-axis
               n : Number of cells along y-axis
              dy : Step size along y-axis
               a : Dirichlet Coefficient
               b : Neumann Coefficient

CROSS-REFERENCE INFORMATION

This function calls:

robinBC() Returns a m+2 by m+2 one-dimensional mimetic boundary operator that

robinBC3D(k, m, dx, n, dy, o, dz, a, b)

PURPOSE

Returns a three-dimensional mimetic boundary operator that

SYNOPSIS

function robinBC3D

DESCRIPTION

imposes a boundary condition of Robin's type

               k : Order of accuracy
               m : Number of cells along x-axis
              dx : Step size along x-axis
               n : Number of cells along y-axis
              dy : Step size along y-axis
               o : Number of cells along z-axis
              dz : Step size along z-axis
               a : Dirichlet Coefficient
               b : Neumann Coefficient

CROSS-REFERENCE INFORMATION

This function calls:

robinBC() Returns a m+2 by m+2 one-dimensional mimetic boundary operator that

Mixed Boundary Conditions

mixedBC(k, m, dx, left, coeffs_left, right, coeffs_right)

PURPOSE

Constructs a 1D mimetic mixed boundary conditions operator

SYNOPSIS

function mixedBC

DESCRIPTION

           k : Order of accuracy
           m : Number of cells
          dx : Step size
        left : Type of boundary condition at the left boundary ('Dirichlet', 'Neumann', 'Robin')
 coeffs_left : Coefficients for the left boundary condition (a, b for Robin, otherwise coeff. for Dirichlet or Neumann)
       right : Type of boundary condition at the right boundary ('Dirichlet', 'Neumann', 'Robin')
coeffs_right : Coefficients for the right boundary condition (a, b for Robin, otherwise coeff. for Dirichlet or Neumann)

CROSS-REFERENCE INFORMATION

This function calls:

grad() Returns a one-dimensional mimetic gradient operator depending on whether

This function is called by:

mixedBC2D() Constructs a 2D mimetic mixed boundary conditions operator

mixedBC3D() Constructs a 3D mimetic mixed boundary conditions operator

mixedBC2D(k, m, dx, n, dy, left, coeffs_left, right, coeffs_right, bottom, coeffs_bottom, top, coeffs_top)

PURPOSE

Constructs a 2D mimetic mixed boundary conditions operator

SYNOPSIS

function mixedBC2D

DESCRIPTION

            k : Order of accuracy
            m : Number of cells in x-direction
           dx : Step size in x-direction
            n : Number of cells in y-direction
           dy : Step size in y-direction
         left : Type of boundary condition at the left boundary ('Dirichlet', 'Neumann', 'Robin')
  coeffs_left : Coefficients for the left boundary condition (a, b for Robin, otherwise coeff. for Dirichlet or Neumann)
        right : Type of boundary condition at the right boundary ('Dirichlet', 'Neumann', 'Robin')
 coeffs_right : Coefficients for the right boundary condition (a, b for Robin, otherwise coeff. for Dirichlet or Neumann)
       bottom : Type of boundary condition at the bottom boundary ('Dirichlet', 'Neumann', 'Robin')
coeffs_bottom : Coefficients for the bottom boundary condition (a, b for Robin, otherwise coeff. for Dirichlet or Neumann)
          top : Type of boundary condition at the top boundary ('Dirichlet', 'Neumann', 'Robin')
   coeffs_top : Coefficients for the top boundary condition (a, b for Robin, otherwise coeff. for Dirichlet or Neumann)

CROSS-REFERENCE INFORMATION

This function calls:

mixedBC() Constructs a 1D mimetic mixed boundary conditions operator

mixedBC3D(k, m, dx, n, dy, o, dz, left, coeffs_left, right, coeffs_right, bottom, coeffs_bottom, top, coeffs_top, front, coeffs_front, back, coeffs_back)

PURPOSE

Constructs a 3D mimetic mixed boundary conditions operator

SYNOPSIS

function mixedBC3D

DESCRIPTION

            k : Order of accuracy
            m : Number of cells in x-direction
           dx : Step size in x-direction
            n : Number of cells in y-direction
           dy : Step size in y-direction
            o : Number of cells in z-direction
           dz : Step size in z-direction
         left : Type of boundary condition at the left boundary ('Dirichlet', 'Neumann', 'Robin')
  coeffs_left : Coefficients for the left boundary condition (a, b for Robin, otherwise coeff. for Dirichlet or Neumann)
        right : Type of boundary condition at the right boundary ('Dirichlet', 'Neumann', 'Robin')
 coeffs_right : Coefficients for the right boundary condition (a, b for Robin, otherwise coeff. for Dirichlet or Neumann)
       bottom : Type of boundary condition at the bottom boundary ('Dirichlet', 'Neumann', 'Robin')
coeffs_bottom : Coefficients for the bottom boundary condition (a, b for Robin, otherwise coeff. for Dirichlet or Neumann)
          top : Type of boundary condition at the top boundary ('Dirichlet', 'Neumann', 'Robin')
   coeffs_top : Coefficients for the top boundary condition (a, b for Robin, otherwise coeff. for Dirichlet or Neumann)
        front : Type of boundary condition at the front boundary ('Dirichlet', 'Neumann', 'Robin')
 coeffs_front : Coefficients for the front boundary condition (a, b for Robin, otherwise coeff. for Dirichlet or Neumann)
         back : Type of boundary condition at the back boundary ('Dirichlet', 'Neumann', 'Robin')
  coeffs_back : Coefficients for the back boundary condition (a, b for Robin, otherwise coeff. for Dirichlet or Neumann)

CROSS-REFERENCE INFORMATION

This function calls:

mixedBC() Constructs a 1D mimetic mixed boundary conditions operator

Grid Generation and Transformation

Grid Generation

gridGen(method, grid_name, m, n, plot_grid, varargin)

PURPOSE

Returns X and Y which are both m by n matrices that contains the physical

SYNOPSIS

function gridGen

DESCRIPTION

coordinates

       grid_name : String with the name of the grid folder
               m : Number of nodes along the horizontal axis
               n : Number of nodes along the vertical axis
       plot_grid : If true -> plot the grid
        varargin : Maximum number of iterations (Required for TTM)

CROSS-REFERENCE INFORMATION

This function calls:

ttm() https://www.sciencedirect.com/science/article/pii/0022247X78902172?via%3Dihub

tfi() https://en.wikipedia.org/wiki/Transfinite_interpolation

tfi(grid_name, m, n, plot_grid)

PURPOSE

Returns X and Y which are both m by n matrices that contains the physical

SYNOPSIS

function tfi

DESCRIPTION

coordinates

       grid_name : String with the name of the grid folder
               m : Number of nodes along the horizontal axis
               n : Number of nodes along the vertical axis
       plot_grid : If defined -> grid will be plotted

CROSS-REFERENCE INFORMATION

This function is called by:

gridGen() Returns X and Y which are both m by n matrices that contains the physical

Jacobian Calculation

jacobian2D(k, X, Y)

PURPOSE

returns:

Determinant of the Jacobian (XeYn - XnYe)

SYNOPSIS

function jacobian2D

DESCRIPTION

Xe : dx/de metric
Xn : dx/dn metric
Ye : dy/de metric
Yn : dy/dn metric
 k : Order of accuracy
 X : x-coordinates (physical) of meshgrid
 Y : y-coordinates (physical) of meshgrid

CROSS-REFERENCE INFORMATION

This function calls:

nodal2D() Returns a two-dimensional operator that approximates the first-order

This function is called by:

div2DCurv()

grad2DCurv() Returns a 2D curvilinear mimetic gradient

nodal2DCurv()

jacobian3D(k, X, Y, Z)

PURPOSE

returns:

Determinant of the Jacobian

SYNOPSIS

function jacobian3D

DESCRIPTION

Xe : dx/de metric
Xn : dx/dn metric
Xc : dx/dc metric
Ye : dy/de metric
Yn : dy/dn metric
Yc : dy/dc metric
Ze : dz/de metric
Zn : dz/dn metric
Zc : dz/dc metric
 k : Order of accuracy
 X : x-coordinates (physical) of meshgrid
 Y : y-coordinates (physical) of meshgrid
 Z : z-coordinates (physical) of meshgrid

CROSS-REFERENCE INFORMATION

This function calls:

nodal3D() Returns a three-dimensional operator that approximates the first-order

This function is called by:

div3DCurv()

nodal3DCurv()

grad3DCurv() Returns a 3D curvilinear mimetic gradient

Nodal Operators

nodal(k, m, dx)

PURPOSE

Returns a m+1 by m+1 one-dimensional operator that approximates the

SYNOPSIS

function nodal

DESCRIPTION

first-order derivatives on a uniform nodal grid

               k : Order of accuracy
               m : Number of nodes
              dx : Step size

CROSS-REFERENCE INFORMATION

This function is called by:

nodal3D() Returns a three-dimensional operator that approximates the first-order

nodal2D() Returns a two-dimensional operator that approximates the first-order

nodal2D(k, m, dx, n, dy)

PURPOSE

Returns a two-dimensional operator that approximates the first-order

SYNOPSIS

function nodal2D

DESCRIPTION

derivatives on a uniform nodal grid

               k : Order of accuracy
               m : Number of nodes along x-axis
              dx : Step size along x-axis
               n : Number of nodes along y-axis
              dy : Step size along y-axis

CROSS-REFERENCE INFORMATION

This function calls:

nodal() Returns a m+1 by m+1 one-dimensional operator that approximates the

This function is called by:

jacobian2D() Returns:

nodal2DCurv()

nodal2DCurv(k, X, Y)
nodal3D(k, m, dx, n, dy, o, dz)

PURPOSE

Returns a three-dimensional operator that approximates the first-order

SYNOPSIS

function nodal3D

DESCRIPTION

derivatives on a uniform nodal grid

               k : Order of accuracy
               m : Number of nodes along x-axis
              dx : Step size along x-axis
               n : Number of nodes along y-axis
              dy : Step size along y-axis
               o : Number of nodes along z-axis
              dz : Step size along z-axis

CROSS-REFERENCE INFORMATION

This function calls:

nodal() Returns a m+1 by m+1 one-dimensional operator that approximates the

This function is called by:

nodal3DCurv()

jacobian3D() Returns:

nodal3DCurv(k, X, Y, Z)
sidedNodal(m, dx, type)

PURPOSE

Returns a m+1 by m+1 one-dimensional sided approximation for uniformly

SYNOPSIS

function sidedNodal

DESCRIPTION

spaced data points. This function is handy for advective terms.

               m : Number of cells
              dx : Step size
            type : 'backward', 'forward' or 'centered'

CROSS-REFERENCE INFORMATION

No cross-reference information found. This typically means this function neither calls nor is called by other functions in the codebase.

Mimetic Weights

weightsP(k, m, dx)

PURPOSE

Returns the m+1 weights of P

SYNOPSIS

function weightsP

DESCRIPTION

 k : Order of accuracy
 m : Number of cells
dx : Step size

CROSS-REFERENCE INFORMATION

This function calls:

grad() Returns a one-dimensional mimetic gradient operator depending on whether

This function is called by:

weightsP2D() Returns the 2mn+m+n weights of P in 2-D

mimeticB() Returns a m+2 by m+1 one-dimensional mimetic boundary operator

weightsP2D(k, m, dx, n, dy)

PURPOSE

Returns the 2mn+m+n weights of P in 2-D

SYNOPSIS

function weightsP2D

DESCRIPTION

 k : Order of accuracy
 m : Number of cells along x-axis
dx : Step size along x-axis
 n : Number of cells along y-axis
dy : Step size along y-axis

CROSS-REFERENCE INFORMATION

This function calls:

weightsP() Returns the m+1 weights of P

weightsQ(k, m, dx)

PURPOSE

Returns the m+2 weights of Q

SYNOPSIS

function weightsQ

DESCRIPTION

 k : Order of accuracy
 m : Number of cells
dx : Step size

CROSS-REFERENCE INFORMATION

This function calls:

div() Returns a one-dimensional mimetic divergence operator depending on whether

This function is called by:

mimeticB() Returns a m+2 by m+1 one-dimensional mimetic boundary operator

weightsQ2D(m, n, d)

PURPOSE

Returns the (m+2)(n+2) weights of Q in 2-D

SYNOPSIS

function weightsQ2D

DESCRIPTION

Only works for 2nd-order 2-D Mimetic divergence operator

               m : Number of cells along x-axis
               n : Number of cells along y-axis
               d : Step size (assuming d = dx = dy)

CROSS-REFERENCE INFORMATION

No cross-reference information found. This typically means this function neither calls nor is called by other functions in the codebase.

Utility Functions

amean(X)

PURPOSE

Returns the arithmetic mean for every two pairs in a column vector

SYNOPSIS

function amean

DESCRIPTION

And, Y(1) = X(1), Y(end) = X(end)

               X : Column vector

CROSS-REFERENCE INFORMATION

No cross-reference information found. This typically means this function neither calls nor is called by other functions in the codebase.

hmean(X)

PURPOSE

Returns the harmonic mean for every two pairs in a column vector

SYNOPSIS

function hmean

DESCRIPTION

And, Y(1) = X(1), Y(end) = X(end)

               X : Column vector

CROSS-REFERENCE INFORMATION

No cross-reference information found. This typically means this function neither calls nor is called by other functions in the codebase.

rk4(func, tspan, dt, y0)

PURPOSE

Explicit Runge-Kutta 4th-order method

SYNOPSIS

function rk4

DESCRIPTION

Returns : t (evaluation points) and y (solutions) of the specified ODE
   func : Function handler
  tspan : [t0 tf]
     dt : Step size
     y0 : Initial conditions

CROSS-REFERENCE INFORMATION

No cross-reference information found. This typically means this function neither calls nor is called by other functions in the codebase.

ttm(grid_name, m, n, iters, plot_grid)

PURPOSE

Returns X and Y which are both m by n matrices that contains the physical

SYNOPSIS

function ttm

DESCRIPTION

coordinates

       grid_name : String with the name of the grid folder
               m : Number of nodes along the horizontal axis
               n : Number of nodes along the vertical axis
       plot_grid : If defined -> grid will be plotted

CROSS-REFERENCE INFORMATION

This function is called by:

gridGen() Returns X and Y which are both m by n matrices that contains the physical

boundaryIdx2D(m, n)

PURPOSE

Returns the indices of the nodes that lie on the boundary of a 2D nodal

SYNOPSIS

function boundaryIdx2D

DESCRIPTION

grid

               m : Number of nodes along x-axis
               n : Number of nodes along y-axis

CROSS-REFERENCE INFORMATION

No cross-reference information found. This typically means this function neither calls nor is called by other functions in the codebase.

DI2(m, n, type)
DI3(m, n, o, type)
GI1(M, m, n, type)
GI13(M, m, n, o, type)
GI2(M, m, n, type)
mimeticB(k, m)

PURPOSE

Returns a m+2 by m+1 one-dimensional mimetic boundary operator

SYNOPSIS

function mimeticB

DESCRIPTION

k : Order of accuracy
m : Number of cells

CROSS-REFERENCE INFORMATION

This function calls:

weightsP() Returns the m+1 weights of P

weightsQ() Returns the m+2 weights of Q

grad() Returns a one-dimensional mimetic gradient operator depending on whether

div() Returns a one-dimensional mimetic divergence operator depending on whether

tensorGrad2D(K, G)

PURPOSE

Returns a two-dimensional flux operator

SYNOPSIS

function tensorGrad2D

DESCRIPTION

K : Tensor (e.g. diffusion tensor)
G : 2D mimetic gradient operator

CROSS-REFERENCE INFORMATION

No cross-reference information found. This typically means this function neither calls nor is called by other functions in the codebase.