fem

package
v0.0.0-...-54c0f88 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2015 License: BSD-3-Clause Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const SQ2 = math.Sqrt2

Variables

View Source
var Global struct {

	// constants
	LogPrefix string // extra string to prefix log file

	// multiprocessing data
	Rank     int   // my rank in distributed cluster
	Nproc    int   // number of processors
	Root     bool  // am I root? (i.e. myrank == 0)
	Distr    bool  // distributed simulation with more than one mpi processor
	Verbose  bool  // verbose == root
	WspcStop []int // stop flags [nprocs]
	WspcInum []int // workspace of integer numbers [nprocs]

	// simulation, materials, meshes and convenience variables
	Sim    *inp.Simulation // simulation data
	Ndim   int             // space dimension
	Dirout string          // directory for output of results
	Fnkey  string          // filename key; e.g. mysim.sim => mysim
	Enc    string          // encoder; e.g. "gob" or "json"
	Stat   bool            // save residuals in summary
	LogBcs bool            // log essential and ptnatural boundary conditions
	Debug  bool            // debug flag

	// auxiliar structures
	DynCoefs *DynCoefs    // dynamic coefficients
	HydroSt  *HydroStatic // computes hydrostatic states

	// for debugging
	DebugKb func(d *Domain, it int) // debug Kb callback function
}

Global holds global data

Functions

func BuildCoordsMatrix

func BuildCoordsMatrix(c *inp.Cell, msh *inp.Mesh) (x [][]float64)

BuildCoordsMatrix returns the coordinate matrix of a particular Cell

func DerivSig

func DerivSig(DσDun [][]float64, n, ndim int, G, D [][]float64)

DerivSig returns the derivative of σ (Mandel) with respect to displacement at nodes

Note: DσDun = ∂σ/∂un  [nσ][ndim]

func End

func End()

End must be called and the end to flush log file

func FlowKeys

func FlowKeys() []string

func GetAndInitPorousModel

func GetAndInitPorousModel(matname string) *mporous.Model

GetAndInitPorousModel get porous model from material name It returns nil on errors, after logging

func GetAndInitSolidModel

func GetAndInitSolidModel(matname string, ndim int) (msolid.Model, fun.Prms)

func GetIntegrationPoints

func GetIntegrationPoints(nip, nipf int, cellType string) (ipsElem, ipsFace []*shp.Ipoint)

func GetIsEssenKeyMap

func GetIsEssenKeyMap() map[string]bool

GetFirstYandCmap returns the initial "yandc" map with additional keys that EssentialBcs can handle

rigid  -- define rigid element constraints
incsup -- inclined support constraints
hst    -- set hydrostatic pressures

func GetSeepFaceFlags

func GetSeepFaceFlags(extra string) (Macaulay bool, BetRamp, Kappa float64)

func GetSolidFlags

func GetSolidFlags(extra string) (useB, debug bool, thickness float64)

func GetVertsWithCond

func GetVertsWithCond(fconds []*FaceCond, conds ...string) (verts []int)

GetVertsWithCond gets all vertices with any of the given conditions

"seepH" => localVerts={1,2,3}

func IpAddToKt

func IpAddToKt(Kt [][]float64, nne, ndim int, coef float64, G, D [][]float64)

func IpBmatrix

func IpBmatrix(B [][]float64, ndim, nne int, G [][]float64, radius float64, S []float64)

func IpBmatrix_sparse

func IpBmatrix_sparse(B *la.Triplet, ndim, nne int, G [][]float64, radius float64, S []float64)

func IpStrains

func IpStrains(εs []float64, nne, ndim int, u []float64, Umap []int, G [][]float64)

func IpStrainsAndInc

func IpStrainsAndInc(εs, Δεs []float64, nne, ndim int, u, Δu []float64, Umap []int, G [][]float64)

func IpStrainsAndIncB

func IpStrainsAndIncB(εs, Δεs []float64, nσ, nu int, B [][]float64, u, Δu []float64, Umap []int)

func Ivs2sigmas

func Ivs2sigmas(σ []float64, i int, ivs map[string][]float64)

Ivs2sigmas converts ivs map to σ values [nsig]

σ -- [ndim] stresses
i -- index of integration point

func LogErr

func LogErr(err error, msg string) (stop bool)

func LogErrCond

func LogErrCond(condition bool, msg string, prm ...interface{}) (stop bool)

func Run

func Run() (runisok bool)

Run runs FE simulation

func Start

func Start(simfilepath string, erasefiles, verbose bool) (startisok bool)

Start initialises 'global' and starts logging

func Stop

func Stop() bool

func StressKeys

func StressKeys() []string

func TestingCompareResultsU

func TestingCompareResultsU(tst *testing.T, simfname, cmpfname string, tolK, tolu, tols float64, skipK, verbose bool)

testing_compare_results_u compares results with u-formulation

Types

type Beam

type Beam struct {

	// basic data
	Cid int         // cell/element id
	X   [][]float64 // matrix of nodal coordinates [ndim][nnode]
	Nu  int         // total number of unknowns == 2 * nsn

	// parameters
	E   float64 // Young's modulus
	A   float64 // cross-sectional area
	Izz float64 // Inertia zz

	// variables for dynamics
	Rho  float64  // density of solids
	Gfcn fun.Func // gravity function

	// vectors and matrices
	T   [][]float64 // global-to-local transformation matrix [nnode*ndim][nnode*ndim]
	Kl  [][]float64 // local K matrix
	K   [][]float64 // global K matrix
	Ml  [][]float64 // local M matrices
	M   [][]float64 // global M matrices
	Rus []float64   // residual: Rus = fi - fx

	// problem variables
	Umap []int    // assembly map (location array/element equations)
	Hasq bool     // has distributed loads
	QnL  fun.Func // distributed normal load functions: left
	QnR  fun.Func // distributed normal load functions: right
	Qt   fun.Func // distributed tangential load
	// contains filtered or unexported fields
}

Beam represents a structural beam element (Euler-Bernoulli, linear elastic)

func (Beam) AddToKb

func (o Beam) AddToKb(Kb *la.Triplet, sol *Solution, firstIt bool) (ok bool)

adds element K to global Jacobian matrix Kb

func (Beam) AddToRhs

func (o Beam) AddToRhs(fb []float64, sol *Solution) (ok bool)

adds -R to global residual vector fb

func (Beam) Decode

func (o Beam) Decode(dec Decoder) (ok bool)

Decode decodes internal variables

func (Beam) Encode

func (o Beam) Encode(enc Encoder) (ok bool)

Encode encodes internal variables

func (Beam) Id

func (o Beam) Id() int

Id returns the cell Id

func (*Beam) InterpStarVars

func (o *Beam) InterpStarVars(sol *Solution) (ok bool)

InterpStarVars interpolates star variables to integration points

func (Beam) OutIpsData

func (o Beam) OutIpsData() (data []*OutIpData)

OutIpsData returns data from all integration points for output

func (*Beam) SetEleConds

func (o *Beam) SetEleConds(key string, f fun.Func, extra string) (ok bool)

SetEleConds set element conditions

func (*Beam) SetEqs

func (o *Beam) SetEqs(eqs [][]int, mixedform_eqs []int) (ok bool)

SetEqs set equations [2][?]. Format of eqs == format of info.Dofs

func (*Beam) Update

func (o *Beam) Update(sol *Solution) (ok bool)

Update perform (tangent) update

type Decoder

type Decoder interface {
	Decode(e interface{}) error
}

Decoder defines decoders; e.g. gob or json

func GetDecoder

func GetDecoder(r goio.Reader) Decoder

GetDecoder returns a new decoder

type Dof

type Dof struct {
	Key string // primary variable key. e.g. "ux"
	Eq  int    // equation number
}

Dof holds information about a degree-of-freedom == solution variable

func (*Dof) String

func (o *Dof) String() string

String returns the string representation of this Dof

type Domain

type Domain struct {

	// init: region, mesh, linear solver
	Reg    *inp.Region // region data
	Msh    *inp.Mesh   // mesh data
	LinSol la.LinSol   // linear solver

	// stage: auxiliary maps for setting boundary conditions
	FaceConds map[int][]*FaceCond // maps cell id to its face boundary conditions

	// stage: nodes (active) and elements (active AND in this processor)
	Nodes  []*Node // active nodes (for each stage)
	Elems  []Elem  // [procNcells] only active elements in this processor (for each stage)
	MyCids []int   // [procNcells] the ids of cells in this processor

	// stage: auxiliary maps for dofs and equation types
	F2Y      map[string]string // converts f-keys to y-keys; e.g.: "ux" => "fx"
	YandC    map[string]bool   // y and constraints keys; e.g. "ux", "pl", "H", "incsup", "rigid"
	Dof2Tnum map[string]int    // {t1,t2}-types: dof => t_number; e.g. "ux" => 2, "pl" => 1

	// stage: auxiliary maps for nodes and elements
	Vid2node   []*Node // [nverts] VertexId => index in Nodes. Inactive vertices are 'nil'
	Cid2elem   []Elem  // [ncells] CellId => index in Elems. Cells in other processors or inactive are 'nil'
	Cid2active []bool  // [ncells] CellId => whether cell is active or not in ANY processor

	// stage: subsets of elements
	ElemIntvars []ElemIntvars   // elements with internal vars in this processor
	ElemConnect []ElemConnector // connector elements in this processor

	// stage: coefficients and prescribed forces
	EssenBcs EssentialBcs // constraints (Lagrange multipliers)
	PtNatBcs PtNaturalBcs // point loads such as prescribed forces at nodes

	// stage: t1 and t2 variables
	T1eqs []int // first t-derivative variables; e.g.:  dp/dt vars (subset of ykeys)
	T2eqs []int // second t-derivative variables; e.g.: d²u/dt² vars (subset of ykeys)

	// stage: dimensions
	NnzKb int // number of nonzeros in Kb matrix
	Ny    int // total number of dofs, except λ
	Nlam  int // total number of Lagrange multipliers
	NnzA  int // number of nonzeros in A (constraints) matrix
	Nyb   int // total number of equations: ny + nλ

	// stage: solution and linear solver
	Sol      *Solution   // solution state
	Kb       *la.Triplet // Jacobian == dRdy
	Fb       []float64   // residual == -fb
	Wb       []float64   // workspace
	InitLSol bool        // flag telling that linear solver needs to be initialised prior to any further call
	// contains filtered or unexported fields
}

Domain holds all Nodes and Elements active during a stage in addition to the Solution at nodes. Only elements in this processor are recorded here; however information from all cells might be recorded as well.

func NewDomain

func NewDomain(reg *inp.Region, distr bool) *Domain

NewDomain returns a new domain

func (*Domain) In

func (o *Domain) In(sum *Summary, tidx int, allInOne bool) (ok bool)

In performes the inverse operation from Out

allInOne -- indicates that all results must be read into the root processor only
            For example when plotting or generating VTU files (or testing)

If allInOne is false, each processor will read its part as described by Summary.
Thus, recoreving the state as in the previous simulation.

func (*Domain) Out

func (o *Domain) Out(tidx int) (ok bool)

Out performs output of Solution and Internal values to files

func (*Domain) ReadIvs

func (o *Domain) ReadIvs(dir, fnkey string, tidx, proc int) (ok bool)

ReadIvs reads elements's internal values from a file which name is set with tidx (time output index)

func (*Domain) ReadSol

func (o *Domain) ReadSol(dir, fnkey string, tidx int) (ok bool)

ReadSol reads Solution from a file which name is set with tidx (time output index)

func (Domain) SaveIvs

func (o Domain) SaveIvs(tidx int) (ok bool)

SaveIvs saves elements's internal values to a file which name is set with tidx (time output index)

func (Domain) SaveSol

func (o Domain) SaveSol(tidx int) (ok bool)

SaveSol saves Solution to a file which name is set with tidx (time output index)

func (*Domain) SetGeoSt

func (o *Domain) SetGeoSt(stg *inp.Stage) (ok bool)

SetGeoSt sets the initial state to a hydrostatic condition

func (*Domain) SetHydroSt

func (o *Domain) SetHydroSt(stg *inp.Stage) (ok bool)

SetHydroSt sets the initial state to a hydrostatic condition

func (*Domain) SetIniStress

func (o *Domain) SetIniStress(stg *inp.Stage) (ok bool)

SetIniStress sets the initial state with initial stresses

func (*Domain) SetStage

func (o *Domain) SetStage(idxstg int, stg *inp.Stage, distr bool) (setstageisok bool)

SetStage set nodes, equation numbers and auxiliary data for given stage

type DynCoefs

type DynCoefs struct {
	HHT bool
	// contains filtered or unexported fields
}

DynCoefs calculates θ-method, Newmark's or HHT coefficients.

Notes:
 θ1  -- Newmark parameter (gamma)  [0 <= θ1 <= 1]
 θ2  -- Newmark parameter (2*beta) [0 <= θ2 <= 1]
 HHT -- use Hilber-Hughes-Taylor method ?
 α   -- Hilber-Hughes-Taylor parameter [-1/3 <= α <= 0]
 if HHT==True, θ1 and θ2 are automatically calculated for unconditional stability

func (*DynCoefs) CalcAlphas

func (o *DynCoefs) CalcAlphas(Δt float64) (err error)

CalcAlphas computes only alphas

func (*DynCoefs) CalcBetas

func (o *DynCoefs) CalcBetas(Δt float64) (err error)

CalcBetas computes only betas

func (*DynCoefs) CalcBoth

func (o *DynCoefs) CalcBoth(Δt float64) (err error)

CalcBoth computes betas and alphas

func (*DynCoefs) Init

func (o *DynCoefs) Init(dat *inp.SolverData) (ok bool)

Init initialises this structure

func (*DynCoefs) Print

func (o *DynCoefs) Print()

Print prints coefficients

type Elem

type Elem interface {

	// information and initialisation
	Id() int                                           // returns the cell Id
	SetEqs(eqs [][]int, mixedform_eqs []int) (ok bool) // set equations

	// conditions (natural BCs and element's)
	SetEleConds(key string, f fun.Func, extra string) (ok bool) // set element conditions

	// called for each time step
	InterpStarVars(sol *Solution) (ok bool) // interpolate star variables to integration points

	// called for each iteration
	AddToRhs(fb []float64, sol *Solution) (ok bool)                // adds -R to global residual vector fb
	AddToKb(Kb *la.Triplet, sol *Solution, firstIt bool) (ok bool) // adds element K to global Jacobian matrix Kb
	Update(sol *Solution) (ok bool)                                // perform (tangent) update

	// reading and writing of element data
	Encode(enc Encoder) (ok bool) // encodes internal variables
	Decode(dec Decoder) (ok bool) // decodes internal variables

	// output
	OutIpsData() (data []*OutIpData) // returns data from all integration points for output
}

Elem defines what elements must calculate

func NewElem

func NewElem(edat *inp.ElemData, cid int, msh *inp.Mesh, faceConds []*FaceCond) Elem

NewElem returns a new element from its type; e.g. "p", "u" or "up"

type ElemConnector

type ElemConnector interface {
	Id() int                                                  // returns the cell Id
	Connect(cid2elem []Elem, c *inp.Cell) (nnzK int, ok bool) // connect multiple elements; e.g.: connect rod/solid elements in Rjoints
}

ElemConnector defines connector elements; elements that depend upon others

type ElemIntvars

type ElemIntvars interface {
	Ipoints() (coords [][]float64)                               // returns the real coordinates of integration points [nip][ndim]
	SetIniIvs(sol *Solution, ivs map[string][]float64) (ok bool) // sets initial ivs for given values in sol and ivs map
	BackupIvs(aux bool) (ok bool)                                // create copy of internal variables
	RestoreIvs(aux bool) (ok bool)                               // restore internal variables from copies
	Ureset(sol *Solution) (ok bool)                              // fixes internal variables after u (displacements) have been zeroed
}

ElemIntvars defines elements with {z,q} internal variables

type ElemP

type ElemP struct {

	// basic data
	Cid int         // cell/element id
	X   [][]float64 // matrix of nodal coordinates [ndim][nnode]
	Shp *shp.Shape  // shape structure
	Np  int         // total number of unknowns == number of vertices

	// integration points
	IpsElem []*shp.Ipoint // integration points of element
	IpsFace []*shp.Ipoint // integration points corresponding to faces

	// material model
	Mdl *mporous.Model // model

	// problem variables
	Pmap []int // assembly map (location array/element equations)

	// internal variables
	States    []*mporous.State
	StatesBkp []*mporous.State
	StatesAux []*mporous.State

	// gravity
	Gfcn fun.Func // gravity function

	// natural boundary conditions
	NatBcs []*NaturalBc // natural boundary conditions

	Emat     [][]float64 // [nverts][nips] extrapolator matrix
	DoExtrap bool        // do extrapolation of ρl and Cpl => for use with flux and seepage conditions

	// seepage face
	Nf         int   // number of fl variables
	HasSeep    bool  // indicates if this element has seepage faces
	Vid2seepId []int // [nverts] maps local vertex id to index in Fmap
	SeepId2vid []int // [nf] maps seepage face variable id to local vertex id
	Fmap       []int // [nf] map of "fl" variables (seepage face)
	Macaulay   bool  // use discrete ramp function instead of smooth ramp

	Hst   []bool      // [nf] set hydrostatic plmax
	Plmax [][]float64 // [nf][nipsFace] specified plmax (not corrected by multiplier)

	Kpp [][]float64 // [np][np] Kpp := dRpl/dpl consistent tangent matrix
	Kpf [][]float64 // [np][nf] Kpf := dRpl/dfl consistent tangent matrix
	Kfp [][]float64 // [nf][np] Kfp := dRfl/dpl consistent tangent matrix
	Kff [][]float64 // [nf][nf] Kff := dRfl/dfl consistent tangent matrix
	// contains filtered or unexported fields
}

ElemP implements an element for transient seepage analyses [1]

References:
 [1] Pedroso DM (2015) A solution to transient seepage in unsaturated porous media.
     Computer Methods in Applied Mechanics and Engineering, 285 791-816,
     http://dx.doi.org/10.1016/j.cma.2014.12.009

func (ElemP) AddToKb

func (o ElemP) AddToKb(Kb *la.Triplet, sol *Solution, firstIt bool) (ok bool)

AddToKb adds element K to global Jacobian matrix Kb

func (ElemP) AddToRhs

func (o ElemP) AddToRhs(fb []float64, sol *Solution) (ok bool)

AddToRhs adds -R to global residual vector fb

func (*ElemP) BackupIvs

func (o *ElemP) BackupIvs(aux bool) (ok bool)

BackupIvs creates copy of internal variables

func (ElemP) Decode

func (o ElemP) Decode(dec Decoder) (ok bool)

Decode decodes internal variables

func (ElemP) Encode

func (o ElemP) Encode(enc Encoder) (ok bool)

Encode encodes internal variables

func (ElemP) Id

func (o ElemP) Id() int

Id returns the cell Id

func (*ElemP) InterpStarVars

func (o *ElemP) InterpStarVars(sol *Solution) (ok bool)

InterpStarVars interpolates star variables to integration points

func (ElemP) Ipoints

func (o ElemP) Ipoints() (coords [][]float64)

Ipoints returns the real coordinates of integration points [nip][ndim]

func (ElemP) OutIpsData

func (o ElemP) OutIpsData() (data []*OutIpData)

OutIpsData returns data from all integration points for output

func (*ElemP) RestoreIvs

func (o *ElemP) RestoreIvs(aux bool) (ok bool)

RestoreIvs restores internal variables from copies

func (*ElemP) SetEleConds

func (o *ElemP) SetEleConds(key string, f fun.Func, extra string) (ok bool)

SetEleConds sets element conditions

func (*ElemP) SetEqs

func (o *ElemP) SetEqs(eqs [][]int, mixedform_eqs []int) (ok bool)

SetEqs sets equations

func (*ElemP) SetIniIvs

func (o *ElemP) SetIniIvs(sol *Solution, ignored map[string][]float64) (ok bool)

SetIniIvs sets initial ivs for given values in sol and ivs map

func (*ElemP) Update

func (o *ElemP) Update(sol *Solution) (ok bool)

Update performs (tangent) update

func (*ElemP) Ureset

func (o *ElemP) Ureset(sol *Solution) (ok bool)

Ureset fixes internal variables after u (displacements) have been zeroed

type ElemPhi

type ElemPhi struct {

	// basic data
	Cid int         // cell/element id
	X   [][]float64 // [ndim][nnode] matrix of nodal coordinates
	Shp *shp.Shape  // shape structure
	Nu  int         // total number of unknowns == number of vertices

	// integration points
	IpsElem []*shp.Ipoint // [nip] integration points of element

	// scratchpad. computed @ each ip
	K [][]float64 // [nu][nu] consistent tangent matrix

	// problem variables
	Umap []int // assembly map (location array/element equations)
	// contains filtered or unexported fields
}

ElemPhi implementes a general element to solve the following equation

dφ       ∂φ
-- + v . -- = s(x)
dt       ∂x

Notes: v is a constant vector

func (*ElemPhi) AddToKb

func (o *ElemPhi) AddToKb(Kb *la.Triplet, sol *Solution, firstIt bool) (ok bool)

AddToKb adds element K to global Jacobian matrix Kb

func (*ElemPhi) AddToRhs

func (o *ElemPhi) AddToRhs(fb []float64, sol *Solution) (ok bool)

AddToRhs adds -R to global residual vector fb

func (*ElemPhi) Decode

func (o *ElemPhi) Decode(dec Decoder) (ok bool)

Decode decodes internal variables

func (*ElemPhi) Encode

func (o *ElemPhi) Encode(enc Encoder) (ok bool)

Encode encodes internal variables

func (*ElemPhi) Id

func (o *ElemPhi) Id() int

Id returns the cell Id

func (*ElemPhi) InterpStarVars

func (o *ElemPhi) InterpStarVars(sol *Solution) (ok bool)

InterpStarVars interpolate star variables to integration points

func (*ElemPhi) OutIpsData

func (o *ElemPhi) OutIpsData() (data []*OutIpData)

OutIpsData returns data from all integration points for output

func (*ElemPhi) SetEleConds

func (o *ElemPhi) SetEleConds(key string, f fun.Func, extra string) (ok bool)

SetEleConds set element conditions

func (*ElemPhi) SetEqs

func (o *ElemPhi) SetEqs(eqs [][]int, mixedform_eqs []int) (ok bool)

SetEqs set equations

func (*ElemPhi) Update

func (o *ElemPhi) Update(sol *Solution) (ok bool)

Update perform (tangent) update

type ElemU

type ElemU struct {

	// basic data
	Cid int         // cell/element id
	X   [][]float64 // matrix of nodal coordinates [ndim][nnode]
	Shp *shp.Shape  // shape structure
	Nu  int         // total number of unknowns

	// variables for dynamics
	Rho  float64  // density of solids
	Cdam float64  // coefficient for damping
	Gfcn fun.Func // gravity function

	// optional data
	UseB      bool    // use B matrix
	Thickness float64 // thickness (for plane-stress)
	Debug     bool    // debugging flag

	// integration points
	IpsElem []*shp.Ipoint // integration points of element
	IpsFace []*shp.Ipoint // integration points corresponding to faces

	// material model and internal variables
	Model    msolid.Model // material model
	MdlSmall msolid.Small // model specialisation for small strains
	MdlLarge msolid.Large // model specialisation for large deformations

	// internal variables
	States    []*msolid.State // [nip] states
	StatesBkp []*msolid.State // [nip] backup states
	StatesAux []*msolid.State // [nip] auxiliary backup states

	// problem variables
	Umap []int // assembly map (location array/element equations)

	// natural boundary conditions
	NatBcs []*NaturalBc

	K [][]float64 // [nu][nu] consistent tangent (stiffness) matrix
	B [][]float64 // [nsig][nu] B matrix for axisymetric case
	D [][]float64 // [nsig][nsig] constitutive consistent tangent matrix

	Δε []float64 // incremental strains leading to updated strains
	// contains filtered or unexported fields
}

ElemU represents a solid element with displacements u as primary variables

func (*ElemU) AddToKb

func (o *ElemU) AddToKb(Kb *la.Triplet, sol *Solution, firstIt bool) (ok bool)

AddToKb adds element K to global Jacobian matrix Kb

func (*ElemU) AddToRhs

func (o *ElemU) AddToRhs(fb []float64, sol *Solution) (ok bool)

AddToRhs adds -R to global residual vector fb

func (*ElemU) BackupIvs

func (o *ElemU) BackupIvs(aux bool) (ok bool)

BackupIvs create copy of internal variables

func (ElemU) Decode

func (o ElemU) Decode(dec Decoder) (ok bool)

Decode decodes internal variables

func (ElemU) Encode

func (o ElemU) Encode(enc Encoder) (ok bool)

Encode encodes internal variables

func (ElemU) Id

func (o ElemU) Id() int

Id returns the cell Id

func (*ElemU) InterpStarVars

func (o *ElemU) InterpStarVars(sol *Solution) (ok bool)

InterpStarVars interpolates star variables to integration points

func (ElemU) Ipoints

func (o ElemU) Ipoints() (coords [][]float64)

Ipoints returns the real coordinates of integration points [nip][ndim]

func (ElemU) OutIpsData

func (o ElemU) OutIpsData() (data []*OutIpData)

OutIpsData returns data from all integration points for output

func (*ElemU) RestoreIvs

func (o *ElemU) RestoreIvs(aux bool) (ok bool)

RestoreIvs restore internal variables from copies

func (*ElemU) SetEleConds

func (o *ElemU) SetEleConds(key string, f fun.Func, extra string) (ok bool)

SetEleConds set element conditions

func (*ElemU) SetEqs

func (o *ElemU) SetEqs(eqs [][]int, mixedform_eqs []int) (ok bool)

SetEqs set equations

func (*ElemU) SetIniIvs

func (o *ElemU) SetIniIvs(sol *Solution, ivs map[string][]float64) (ok bool)

SetIniIvs sets initial ivs for given values in sol and ivs map

func (*ElemU) Update

func (o *ElemU) Update(sol *Solution) (ok bool)

Update perform (tangent) update

func (*ElemU) Ureset

func (o *ElemU) Ureset(sol *Solution) (ok bool)

Ureset fixes internal variables after u (displacements) have been zeroed

type ElemUP

type ElemUP struct {

	// auxiliary
	Fconds []*FaceCond // face conditions; e.g. seepage faces
	CtypeU string      // u: cell type
	CtypeP string      // p: cell type

	// underlying elements
	U *ElemU // u-element
	P *ElemP // p-element

	Kup [][]float64 // [nu][np] Kup := dRus/dpl consistent tangent matrix
	Kpu [][]float64 // [np][nu] Kpu := dRpl/dus consistent tangent matrix
	// contains filtered or unexported fields
}

ElemUP represents an element for porous media based on the u-p formulation [1]

References:
 [1] Pedroso DM (2015) A consistent u-p formulation for porous media with hysteresis.
     Int Journal for Numerical Methods in Engineering, 101(8) 606-634
     http://dx.doi.org/10.1002/nme.4808
 [2] Pedroso DM (2015) A solution to transient seepage in unsaturated porous media.
     Computer Methods in Applied Mechanics and Engineering, 285 791-816,
     http://dx.doi.org/10.1016/j.cma.2014.12.009

func (ElemUP) AddToKb

func (o ElemUP) AddToKb(Kb *la.Triplet, sol *Solution, firstIt bool) (ok bool)

adds element K to global Jacobian matrix Kb

func (ElemUP) AddToRhs

func (o ElemUP) AddToRhs(fb []float64, sol *Solution) (ok bool)

adds -R to global residual vector fb

func (*ElemUP) BackupIvs

func (o *ElemUP) BackupIvs(aux bool) (ok bool)

BackupIvs create copy of internal variables

func (ElemUP) Decode

func (o ElemUP) Decode(dec Decoder) (ok bool)

Decode decodes internal variables

func (ElemUP) Encode

func (o ElemUP) Encode(enc Encoder) (ok bool)

Encode encodes internal variables

func (ElemUP) Id

func (o ElemUP) Id() int

Id returns the cell Id

func (*ElemUP) InterpStarVars

func (o *ElemUP) InterpStarVars(sol *Solution) (ok bool)

InterpStarVars interpolates star variables to integration points

func (ElemUP) Ipoints

func (o ElemUP) Ipoints() (coords [][]float64)

Ipoints returns the real coordinates of integration points [nip][ndim]

func (ElemUP) OutIpsData

func (o ElemUP) OutIpsData() (data []*OutIpData)

OutIpsData returns data from all integration points for output

func (*ElemUP) RestoreIvs

func (o *ElemUP) RestoreIvs(aux bool) (ok bool)

RestoreIvs restore internal variables from copies

func (*ElemUP) SetEleConds

func (o *ElemUP) SetEleConds(key string, f fun.Func, extra string) (ok bool)

SetEleConds set element conditions

func (*ElemUP) SetEqs

func (o *ElemUP) SetEqs(eqs [][]int, mixedform_eqs []int) (ok bool)

SetEqs set equations

func (*ElemUP) SetIniIvs

func (o *ElemUP) SetIniIvs(sol *Solution, ivs map[string][]float64) (ok bool)

SetIniIvs sets initial ivs for given values in sol and ivs map

func (*ElemUP) Update

func (o *ElemUP) Update(sol *Solution) (ok bool)

Update perform (tangent) update

func (*ElemUP) Ureset

func (o *ElemUP) Ureset(sol *Solution) (ok bool)

Ureset fixes internal variables after u (displacements) have been zeroed

type Encoder

type Encoder interface {
	Encode(e interface{}) error
}

Encoder defines encoders; e.g. gob or json

func GetEncoder

func GetEncoder(w goio.Writer) Encoder

GetEncoder returns a new encoder

type EssentialBc

type EssentialBc struct {
	Key   string    // ux, uy, rigid, incsup
	Eqs   []int     // equations
	ValsA []float64 // values for matrix A
	Fcn   fun.Func  // function that implements the "c" in A * y = c
	Inact bool      // inactive
}

EssentialBc holds information about essential bounday conditions such as constrained nodes. Lagrange multipliers are used to implement both single- and multi-point constraints.

In general, essential bcs / constraints are defined by means of:

    A * y = c

The resulting Kb matrix will then have the following form:
    _       _
   |  K  At  | / δy \   / -R - At*λ \
   |         | |    | = |           |
   |_ A   0 _| \ δλ /   \  c - A*y  /
       Kb       δyb          fb

type EssentialBcs

type EssentialBcs struct {
	Eq2idx map[int][]int  // maps eq number to indices in BcsTmp
	Bcs    []*EssentialBc // active essential bcs / constraints
	A      la.Triplet     // matrix of coefficients 'A'
	Am     *la.CCMatrix   // compressed form of A matrix

	// temporary
	BcsTmp eqbcpairs // temporary essential bcs / constraints, including inactive ones. maps the first equation number to bcs
}

EssentialBcs implements a structure to record the definition of essential bcs / constraints. Each constraint will have a unique Lagrange multiplier index.

func (EssentialBcs) AddToRhs

func (o EssentialBcs) AddToRhs(fb []float64, sol *Solution)

AddtoRhs adds the essential bcs / constraints terms to the augmented fb vector

func (*EssentialBcs) Build

func (o *EssentialBcs) Build(ny int) (nλ, nnzA int)

Build builds this structure and its iternal data

nλ -- is the number of essential bcs / constraints == number of Lagrange multipliers
nnzA -- is the number of non-zeros in matrix 'A'

func (*EssentialBcs) List

func (o *EssentialBcs) List(t float64) (l string)

List returns a simple list logging bcs at time t

func (*EssentialBcs) Reset

func (o *EssentialBcs) Reset()

Reset initialises this structure. It also performs a reset of internal structures.

func (*EssentialBcs) Set

func (o *EssentialBcs) Set(key string, nodes []*Node, fcn fun.Func, extra string) (setisok bool)

Set sets a constraint if it does NOT exist yet.

key   -- can be Dof key such as "ux", "uy" or constraint type such as "mpc" or "rigid"
extra -- is a keycode-style data. e.g. "!type:incsup2d !alp:30"
Notes: 1) the default for key is single point constraint; e.g. "ux", "uy", ...
       2) hydraulic head can be set with key == "H"

type FaceCond

type FaceCond struct {
	FaceId      int      // msh: cell's face local id
	LocalVerts  []int    // msh: cell's face local vertices ids (sorted)
	GlobalVerts []int    // msh: global vertices ids (sorted)
	Cond        string   // sim: condition; e.g. "qn" or "seepH"
	Func        fun.Func // sim: function to compute boundary condition
	Extra       string   // sim: extra information
}

type GeoLayer

type GeoLayer struct {
	Tags  []int   // tags of cells within this layer
	Zmin  float64 // coordinate (elevation) at bottom of layer
	Zmax  float64 // coordinate (elevation) at top of layer
	Nodes []*Node // nodes in layer
	Elems []Elem  // elements in layer
	Cl    float64 // liquid compressibility
	RhoS0 float64 // initial density of solids

	K0    float64 // earth-pressure at rest
	Dpl   float64 // liquid pressure added by this layer
	DsigV float64 // absolute value of vertical stress increment added by this layer

	Jac ode.Cb_jac // Jacobian for ode solver
	// contains filtered or unexported fields
}

GeoLayer holds information of one soil layer. It computes pressures (σVabs, pl) and densities (ρL, ρ) based on the following model (fully liquid saturated)

ρL  = ρL0 + Cl・pl   thus   dρL/dpl = Cl
sl  = 1
ρ   = nf・sl・ρL + (1 - nf)・ρS
ns  = 1 - nf

Z(z) = zmax + T・(z - zmax)   with 0 ≤ T ≤ 1
dZ   = (z - zmax)・dT
dpl  = ρL(pl)・g・(-dZ)
dpl  = ρL(pl)・g・(zmax - z)・dT
dσV  = ρ(pl)・g・(zmax - z)・dT
Δz   = zmax - z

        / dpl/dT \   / ρL(pl)・g・Δz  \
dY/dT = | dρL/dT | = | Cl・dpl/dT     |
        | dρ/dT  |   | nf・sl・dρL/dT |
        \ dσV/dT /   \ ρ(pl)・g・Δz   /

func (GeoLayer) Calc

func (o GeoLayer) Calc(z float64) (*geostate, error)

Calc computes state @ level z

func (*GeoLayer) Start

func (o *GeoLayer) Start(prev *geostate)

Start starts ODE solver for computing state variables in Calc

prev -- previous state @ top of this layer

type GeoLayers

type GeoLayers []*GeoLayer

GeoLayers is a set of Layer

func (GeoLayers) Len

func (o GeoLayers) Len() int

Len the length of Layers

func (GeoLayers) Less

func (o GeoLayers) Less(i, j int) bool

Less compares Layers: sort from top to bottom

func (GeoLayers) String

func (o GeoLayers) String() string

String prints a json formatted string with GeoLayers' content

func (GeoLayers) Swap

func (o GeoLayers) Swap(i, j int)

Swap swaps two Layers

type HydroStatic

type HydroStatic struct {
	Cl float64

	Jac ode.Cb_jac
	// contains filtered or unexported fields
}

HydroStatic computes water pressure (pl) and intrinsic liquid density (ρL) based on the following model

ρL = ρL0 + Cl・pl   thus   dρL/dpl = Cl

Z(z) = zmax + T・(z - zmax)   with 0 ≤ T ≤ 1
dZ   = (z - zmax)・dT
dpl  = ρL(pl)・g・(-dZ)
dpl  = ρL(pl)・g・(zmax - z)・dT
Δz   = zmax - z

        / dpl/dT \   / ρL(pl)・g・Δz \
dY/dT = |        | = |               |
        \ dρL/dT /   \ Cl・dpl/dT    /

func (HydroStatic) Calc

func (o HydroStatic) Calc(z float64) (pl, ρL float64, err error)

Calc computes pressure and density

func (*HydroStatic) Init

func (o *HydroStatic) Init()

Init initialises this structure

type Info

type Info struct {

	// essential
	Dofs [][]string        // solution variables PER NODE. ex for 2 nodes: [["ux", "uy", "rz"], ["ux", "uy", "rz"]]
	Y2F  map[string]string // maps "y" keys to "f" keys. ex: "ux" => "fx", "pl" => "ql"

	// internal Dofs; e.g. for mixed formulations
	NintDofs int // number of internal dofs

	// t1 and t2 variables (time-derivatives of first and second order)
	T1vars []string // "pl"
	T2vars []string // "ux", "uy"
}

Info holds all information required to set a simulation stage

func GetElemInfo

func GetElemInfo(cellType, elemType string, faceConds []*FaceCond) *Info

GetElemInfo returns information about elements/formulations

cellType -- e.g. "qua8"
elemType -- e.g. "u"

type NaturalBc

type NaturalBc struct {
	Key     string   // key such as qn, qn0, ql, seepH, seepP, etc...
	IdxFace int      // local index of face
	Fcn     fun.Func // function callback
	Extra   string   // extra information
}

NaturalBc holds information on natural boundary conditioins such as distributed loads or fluxes acting on surfaces

type Node

type Node struct {
	Dofs []*Dof    // degrees-of-freedom == solution variables
	Vert *inp.Vert // pointer to Vertex
}

Node holds node dofs information

func NewNode

func NewNode(v *inp.Vert) *Node

NewNode allocates a new Node

func (*Node) AddDofAndEq

func (o *Node) AddDofAndEq(ukey string, eqnum int) (nexteq int)

AddDof adds a new dof to thisnode; ignores it if it exists already

nexteq -- is the next equation number == eqnum + 1;
          returns eqnum if dof exists already

func (*Node) GetDof

func (o *Node) GetDof(ukey string) *Dof

GetDof returns the Dof structure for given Dof name (ukey)

Note: returns nil if not found

func (*Node) GetEq

func (o *Node) GetEq(ukey string) (eqNumber int)

GetEq returns the equation number for given Dof name (ukey)

Note: returns -1 if not found

func (*Node) GetKeys

func (o *Node) GetKeys() []string

GetKeys returns a slice of keys from all dofs

func (*Node) SetEq

func (o *Node) SetEq(ukey string, eqNumber int)

SetEq numbers a specific Dof with the equation number in the current (stage) global system

func (*Node) String

func (o *Node) String() string

String returns the string representation of this node

type OutIpData

type OutIpData struct {
	Eid  int                                    // id of element that owns this ip
	X    []float64                              // coordinates
	Calc func(sol *Solution) map[string]float64 // [nkeys] function to calculate secondary values
}

OutIpData is an auxiliary structure to transfer data from integration points (IP) to output routines.

type PtNaturalBc

type PtNaturalBc struct {
	Key   string    // key such as fux, fpl, etc...
	Eq    int       // equation
	X     []float64 // location
	Fcn   fun.Func  // function
	Extra string    // extra information
}

PtNaturalBc holds information on point natural boundary conditions such as prescribed forces or fluxes) at nodes

type PtNaturalBcs

type PtNaturalBcs struct {
	Eq2idx map[int]int    // maps eq number to indices in Bcs
	Bcs    []*PtNaturalBc //active boundary conditions such as prescribed forces
}

PointLoads is a set of prescribed forces

func (PtNaturalBcs) AddToRhs

func (o PtNaturalBcs) AddToRhs(fb []float64, t float64)

AddToRhs adds the boundary conditions terms to the augmented fb vector

func (*PtNaturalBcs) List

func (o *PtNaturalBcs) List(t float64) (l string)

List returns a simple list logging bcs at time t

func (*PtNaturalBcs) Reset

func (o *PtNaturalBcs) Reset()

Reset initialises internal structures

func (*PtNaturalBcs) Set

func (o *PtNaturalBcs) Set(key string, nod *Node, fcn fun.Func, extra string) (setisok bool)

Set sets new point natural boundary condition data

type RichardsonExtrap

type RichardsonExtrap struct {

	// variables after big step
	Y_big []float64 // primary variables

	// time loop
	Δt    float64 // time step
	Δtcpy float64 // copy of Δt for divergence control
	// contains filtered or unexported fields
}

func (*RichardsonExtrap) Init

func (o *RichardsonExtrap) Init(d *Domain, Dt fun.Func)

func (*RichardsonExtrap) Run

func (o *RichardsonExtrap) Run(d *Domain, s *Summary, DtOut fun.Func, time *float64, tf, tout float64, tidx *int) (ok bool)

type Rjoint

type Rjoint struct {

	// basic data
	Edat *inp.ElemData // element data; stored in allocator to be used in Connect
	Cid  int           // cell/element id
	Ny   int           // total number of dofs == rod.Nu + sld.Nu

	// essential
	Rod *Rod            // rod element
	Sld *ElemU          // solid element
	Mdl msolid.RjointM1 // material model

	// shape functions evaluations and extrapolator matrices
	Nmat [][]float64 // [sldNn][rodNn] shape functions of solids @ [N]odes of rod element
	Pmat [][]float64 // [sldNn][rodNp] shape functions of solids @ integration [P]oints of rod element (for Coulomb model)
	Emat [][]float64 // [sldNn][sldNp] solid's extrapolation matrix (for Coulomb model)

	// variables for Coulomb model
	Coulomb bool // use Coulomb model

	// auxiliary variables
	ΔuC [][]float64 // [rodNn][ndim] relative displ. increment of solid @ nodes of rod; Eq (30)
	Δw  []float64   // [ndim] relative velocity; Eq (32)

	// temporary Jacobian matrices. see Eq. (57)
	Krr [][]float64 // [rodNu][rodNu] Eq. (58)
	Krs [][]float64 // [rodNu][sldNu] Eq. (59)
	Ksr [][]float64 // [sldNu][rodNu] Eq. (60)
	Kss [][]float64 // [sldNu][sldNu] Eq. (61)

	// internal values
	States    []*msolid.OnedState // [nip] internal states
	StatesBkp []*msolid.OnedState // [nip] backup internal states
	StatesAux []*msolid.OnedState // [nip] backup internal states
	// contains filtered or unexported fields
}

Rjoint implements the rod-joint (interface/link) element for reinforced solids.

The following convention is considered:
 n or N   -- means [N]odes
 p or P   -- means integratioin [P]oints
 nn or Nn -- number of nodes
 np or Np -- number of integration [P]points
 ndim     -- space dimension
 nsig     -- number of stress/strain components == 2 * ndim
 rod      -- means rod element
 rodH     -- rod shape structure
 rodNn    -- rod number of nodes
 rodNp    -- rod number of integration points
 rodS     -- rod shape functions
 sld      -- means solid element
 sldH     -- rod shape structure
 sldNn    -- solid number of nodes
 sldNp    -- solid number of integration points
 sldS     -- solid shape functions
 rodYn    -- rod's (real) coordinates of node
 rodYp    -- rod's (real) coordinates of integration point
 r or R   -- means natural coordinates in the solids' system
 z or Z   -- means natural coordinates in the rod's system
 s or S   -- parametric coordinate along rod
 rodRn    -- natural coordinates or rod's nodes w.r.t solid's system
 rodRp    -- natural coordinates of rod's integration point w.r.t to solid's system
 Nmat     -- solid shape functions evaluated at rod nodes
 Pmat     -- solid shape functions evaluated at rod integration points
References:
 [1] R Durand, MM Farias, DM Pedroso. Modelling the strengthening of solids with
     incompatible line finite elements, Computers and Structures (2014). Submitted.
 [2] R Durand, MM Farias, DM Pedroso, Computing intersections between non-compatible
     curves and finite elements, Computational Mechanics (2014). Submitted.
 [3] R Durand, MM Farias. A local extrapolation method for finite elements,
     Advances in Engineering Software 67 (2014) 1-9.
     http://dx.doi.org/10.1016/j.advengsoft.2013.07.002

func (*Rjoint) AddToKb

func (o *Rjoint) AddToKb(Kb *la.Triplet, sol *Solution, firstIt bool) (ok bool)

adds element K to global Jacobian matrix Kb

func (*Rjoint) AddToRhs

func (o *Rjoint) AddToRhs(fb []float64, sol *Solution) (ok bool)

adds -R to global residual vector fb

func (*Rjoint) BackupIvs

func (o *Rjoint) BackupIvs(aux bool) (ok bool)

BackupIvs create copy of internal variables

func (*Rjoint) Connect

func (o *Rjoint) Connect(cid2elem []Elem, c *inp.Cell) (nnzK int, ok bool)

Connect connects rod/solid elements in this Rjoint

func (Rjoint) Decode

func (o Rjoint) Decode(dec Decoder) (ok bool)

Decode decodes internal variables

func (Rjoint) Encode

func (o Rjoint) Encode(enc Encoder) (ok bool)

Encode encodes internal variables

func (Rjoint) Id

func (o Rjoint) Id() int

Id returns the cell Id

func (*Rjoint) InterpStarVars

func (o *Rjoint) InterpStarVars(sol *Solution) (ok bool)

InterpStarVars interpolates star variables to integration points

func (Rjoint) Ipoints

func (o Rjoint) Ipoints() (coords [][]float64)

Ipoints returns the real coordinates of integration points [nip][ndim]

func (Rjoint) OutIpsData

func (o Rjoint) OutIpsData() (data []*OutIpData)

OutIpsData returns data from all integration points for output

func (*Rjoint) RestoreIvs

func (o *Rjoint) RestoreIvs(aux bool) (ok bool)

RestoreIvs restore internal variables from copies

func (*Rjoint) SetEleConds

func (o *Rjoint) SetEleConds(key string, f fun.Func, extra string) (ok bool)

SetEleConds set element conditions

func (*Rjoint) SetEqs

func (o *Rjoint) SetEqs(eqs [][]int, mixedform_eqs []int) (ok bool)

SetEqs set equations

func (*Rjoint) SetIniIvs

func (o *Rjoint) SetIniIvs(sol *Solution, ivs map[string][]float64) (ok bool)

SetIniIvs sets initial ivs for given values in sol and ivs map

func (*Rjoint) Update

func (o *Rjoint) Update(sol *Solution) (ok bool)

Update perform (tangent) update

func (*Rjoint) Ureset

func (o *Rjoint) Ureset(sol *Solution) (ok bool)

Ureset fixes internal variables after u (displacements) have been zeroed

type Rod

type Rod struct {

	// basic data
	Cid int         // cell/element id
	X   [][]float64 // matrix of nodal coordinates [ndim][nnode]
	Shp *shp.Shape  // shape structure
	Nu  int         // total number of unknowns == 2 * nsn

	// parameters
	A float64 // cross-sectional area

	// variables for dynamics
	Rho  float64  // density of solids
	Gfcn fun.Func // gravity function

	// integration points
	IpsElem []*shp.Ipoint // integration points of element

	// vectors and matrices
	K   [][]float64 // global K matrix
	M   [][]float64 // global M matrices
	Rus []float64   // residual: Rus = fi - fx

	// problem variables
	Umap []int // assembly map (location array/element equations)

	// material model and internal variables
	Model     msolid.OnedSolid
	States    []*msolid.OnedState
	StatesBkp []*msolid.OnedState
	StatesAux []*msolid.OnedState
	// contains filtered or unexported fields
}

Rod represents a structural rod element (for only axial loads)

func (Rod) AddToKb

func (o Rod) AddToKb(Kb *la.Triplet, sol *Solution, firstIt bool) (ok bool)

adds element K to global Jacobian matrix Kb

func (Rod) AddToRhs

func (o Rod) AddToRhs(fb []float64, sol *Solution) (ok bool)

adds -R to global residual vector fb

func (*Rod) BackupIvs

func (o *Rod) BackupIvs(aux bool) (ok bool)

BackupIvs create copy of internal variables

func (Rod) Decode

func (o Rod) Decode(dec Decoder) (ok bool)

Decode decodes internal variables

func (Rod) Encode

func (o Rod) Encode(enc Encoder) (ok bool)

Encode encodes internal variables

func (Rod) Id

func (o Rod) Id() int

Id returns the cell Id

func (*Rod) InterpStarVars

func (o *Rod) InterpStarVars(sol *Solution) (ok bool)

InterpStarVars interpolates star variables to integration points

func (Rod) Ipoints

func (o Rod) Ipoints() (coords [][]float64)

Ipoints returns the real coordinates of integration points [nip][ndim]

func (Rod) OutIpsData

func (o Rod) OutIpsData() (data []*OutIpData)

OutIpsData returns data from all integration points for output

func (*Rod) RestoreIvs

func (o *Rod) RestoreIvs(aux bool) (ok bool)

RestoreIvs restore internal variables from copies

func (*Rod) SetEleConds

func (o *Rod) SetEleConds(key string, f fun.Func, extra string) (ok bool)

SetEleConds set element conditions

func (*Rod) SetEqs

func (o *Rod) SetEqs(eqs [][]int, mixedform_eqs []int) (ok bool)

SetEqs set equations

func (*Rod) SetIniIvs

func (o *Rod) SetIniIvs(sol *Solution, ivs map[string][]float64) (ok bool)

SetIniIvs sets initial ivs for given values in sol and ivs map

func (*Rod) SetIvs

func (o *Rod) SetIvs(zvars map[string][]float64) (ok bool)

SetIvs set secondary variables; e.g. during initialisation via files

func (*Rod) Update

func (o *Rod) Update(sol *Solution) (ok bool)

Update perform (tangent) update

func (*Rod) Ureset

func (o *Rod) Ureset(sol *Solution) (ok bool)

Ureset fixes internal variables after u (displacements) have been zeroed

type Solution

type Solution struct {

	// state
	T      float64   // current time
	Y      []float64 // DOFs (solution variables); e.g. y = {u, p}
	Dydt   []float64 // dy/dt
	D2ydt2 []float64 // d²y/dt²

	// auxiliary
	ΔY  []float64 // total increment (for nonlinear solver)
	Psi []float64 // t1 star vars; e.g. ψ* = β1.p + β2.dpdt
	Zet []float64 // t2 star vars; e.g. ζ* = α1.u + α2.v + α3.a
	Chi []float64 // t2 star vars; e.g. χ* = α4.u + α5.v + α6.a
	L   []float64 // Lagrange multipliers
}

Solution holds the solution data @ nodes.

      / u \         / u \
      |   | => y =  |   |
yb =  | p |         \ p / (ny x 1)
      |   |
      \ λ / (nyb x 1)

type Summary

type Summary struct {
	Nproc    int          // number of processors used in last last run; equal to 1 if not distributed
	OutTimes []float64    // [nOutTimes] output times
	Resids   utl.DblSlist // residuals (if Stat is on; includes all stages)
	Dirout   string       // directory where results are stored
	Fnkey    string       // filename key of simulation
}

Summary records summary of outputs

func ReadSum

func ReadSum(dir, fnkey string) (o *Summary)

ReadSum reads summary back

Note: returns nil on errors

func (Summary) Save

func (o Summary) Save() (ok bool)

SaveSums saves summary to disc

type T_iteration

type T_iteration struct {
	It     int     // iteration number
	ResRel float64 // relative residual
	Resid  float64 // absolute residual
}

T_iteration testing: iteration results

type T_results

type T_results struct {
	Status     string        // status message
	LoadFactor float64       // load factor
	Iterations []T_iteration // iterations data
	Kmats      [][][]float64 // [nele][nu][nu] all stiffness matrices
	Disp       [][]float64   // [nnod][ndim] displacements at nodes
	DispMult   float64       // displacements multiplier
	Note       string        // note about number of integration points
	Sigmas     [][][]float64 // [nele][nip][nsig] all stresses @ all ips 2D:{sx, sy, sxy, sz}
}

T_results testing: results

type T_results_set

type T_results_set []*T_results

T_results_set is a set of comparison results

Jump to

Keyboard shortcuts

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