Documentation ¶
Index ¶
- Constants
- Variables
- type ChartState
- type ContinuityLevel
- type EdgeKeySlice
- type EdgeKeySliceSortLeft
- type EdgeValueStorage
- type Euler
- func (c *Euler) AvgFlux(kL, kR, KmaxL, KmaxR, shiftL, shiftR int, Q_FaceL, Q_FaceR [4]utils.Matrix, ...)
- func (c *Euler) CalculateEdgeFlux(Time float64, CalculateDT bool, Jdet, DT []utils.Matrix, ...) (waveSpeedMax float64)
- func (c *Euler) CalculateFlux(QQ [4]utils.Matrix, ind int) (Fx, Fy [4]float64)
- func (c *Euler) CalculateFluxTransformed(k, Kmax, i int, Jdet, Jinv utils.Matrix, Q [4]utils.Matrix) (Fr, Fs [4]float64)
- func (c *Euler) CalculateLocalDT(DT utils.Matrix)
- func (c *Euler) CheckIfFinished(Time, FinalTime float64, steps int) (finished bool)
- func (c *Euler) FarBC(FS *FreeStream, k, Kmax, ishift int, Q_Face [4]utils.Matrix, normal [2]float64)
- func (c *Euler) FluxCalcBase(rho, rhoU, rhoV, E float64) (Fx, Fy [4]float64)
- func (c *Euler) FluxJacobianCalc(rho, rhoU, rhoV, E float64) (Fx, Gy [16]float64)
- func (c *Euler) FluxJacobianTransformed(k, Kmax, i int, Jdet, Jinv utils.Matrix, Q [4]utils.Matrix) (Fr, Gs [16]float64)
- func (c *Euler) GetFaceNormal(kGlobal, edgeNumber int) (normal [2]float64)
- func (c *Euler) GetPlotField(Q [4]utils.Matrix, plotField FlowFunction) (field utils.Matrix)
- func (c *Euler) GetSolutionGradient(myThread, varNum int, Q [4]utils.Matrix, GradX, GradY, DR, DS utils.Matrix)
- func (c *Euler) GetSolutionGradientUsingRTElement(myThread, varNum int, Q [4]utils.Matrix, GradX, GradY, DOFX, DOFY utils.Matrix)
- func (c *Euler) IVortexBC(Time float64, k, Kmax, ishift int, Q_Face [4]utils.Matrix, normal [2]float64)
- func (c *Euler) InitializeFS(Kmax int) (Q [4]utils.Matrix)
- func (c *Euler) InitializeIVortex(X, Y utils.Matrix) (iv *isentropic_vortex.IVortex, Q [4]utils.Matrix)
- func (c *Euler) InitializeSolution(verbose bool)
- func (c *Euler) InterpolateSolutionToEdges(Q, Q_Face [4]utils.Matrix, Flux, Flux_Face [2][4]utils.Matrix)
- func (c *Euler) LaxFlux(kL, kR, KmaxL, KmaxR, shiftL, shiftR int, Q_FaceL, Q_FaceR [4]utils.Matrix, ...)
- func (c *Euler) LaxFlux2(kL, kR, KmaxL, KmaxR, shiftL, shiftR int, Q_FaceL, Q_FaceR [4]utils.Matrix, ...)
- func (c *Euler) NewEdgeStorage() (nf *EdgeValueStorage)
- func (c *Euler) NewRungeKuttaSSP() (rk *RungeKutta4SSP)
- func (c *Euler) PartitionEdges()
- func (c *Euler) PartitionEdgesByK()
- func (c *Euler) PlotFS(width, height int, fminP, fmaxP *float64, fmin, fmax float64, scale float64, ...)
- func (c *Euler) PlotQ(pm *PlotMeta, width, height int)
- func (c *Euler) PrintFinal(elapsed time.Duration, steps int)
- func (c *Euler) PrintInitialization(FinalTime float64)
- func (c *Euler) PrintUpdate(Time, dt float64, steps int, Q, Residual [][4]utils.Matrix, plotQ bool, ...)
- func (c *Euler) RHSInternalPoints(Kmax int, Jdet utils.Matrix, F_RT_DOF, RHSQ [4]utils.Matrix)
- func (c *Euler) RecombineShardsK(pA []utils.Matrix) (A utils.Matrix)
- func (c *Euler) RecombineShardsKBy4(pA [][4]utils.Matrix) (A [4]utils.Matrix)
- func (c *Euler) RiemannBC(FS *FreeStream, k, Kmax, i int, QQ [4][]float64, QInf [4]float64, ...) (Q [4]float64)
- func (c *Euler) RoeERFlux(kL, kR, KmaxL, KmaxR, shiftL, shiftR int, Q_FaceL, Q_FaceR [4]utils.Matrix, ...)
- func (c *Euler) RoeFlux(kL, kR, KmaxL, KmaxR, shiftL, shiftR int, Q_FaceL, Q_FaceR [4]utils.Matrix, ...)
- func (c *Euler) RoeFlux2(kL, kR, KmaxL, KmaxR, shiftL, shiftR int, Q_FaceL, Q_FaceR [4]utils.Matrix, ...)
- func (c *Euler) SetParallelDegree(ProcLimit, Kmax int)
- func (c *Euler) SetRTFluxInternal(Kmax int, Jdet, Jinv utils.Matrix, F_RT_DOF, Q [4]utils.Matrix)
- func (c *Euler) SetRTFluxOnEdges(myThread, Kmax int, F_RT_DOF [4]utils.Matrix)
- func (c *Euler) ShardByK(A utils.Matrix) (pA []utils.Matrix)
- func (c *Euler) ShardByKTranspose(A utils.Matrix) (pA []utils.Matrix)
- func (c *Euler) Solve(pm *PlotMeta)
- func (c *Euler) StoreGradientEdgeFlux(edgeKeys EdgeKeySlice, EdgeQ1 [][4]float64)
- func (c *Euler) WallBC(k, Kmax int, Q_Face [4]utils.Matrix, ishift int, normal [2]float64, ...)
- type ExactState
- type FlowFunction
- type FluxType
- type FreeStream
- func (fs *FreeStream) GetFlowFunction(Q [4]utils.Matrix, ind int, pf FlowFunction) (f float64)
- func (fs *FreeStream) GetFlowFunctionBase(rho, rhoU, rhoV, E float64, pf FlowFunction) (f float64)
- func (fs *FreeStream) GetFlowFunctionQQ(Q [4]float64, pf FlowFunction) (f float64)
- func (fs *FreeStream) Print() string
- type InitType
- type InputParameters
- type LimiterType
- type ModeAliasShockFinder
- type PartitionMap
- func (pm *PartitionMap) GetBucket(kDim int) (bucketNum, min, max int)
- func (pm *PartitionMap) GetBucketDimension(bn int) (kMax int)
- func (pm *PartitionMap) GetBucketRange(bucketNum int) (kMin, kMax int)
- func (pm *PartitionMap) GetGlobalK(kLocal, bn int) (kGlobal int)
- func (pm *PartitionMap) GetLocalK(baseK int) (k, Kmax, bn int)
- func (pm *PartitionMap) Split1D(threadNum int) (bucket [2]int)
- type PlotMeta
- type RungeKutta4SSP
- type ScalarDissipation
- func (sd *ScalarDissipation) AddDissipation(c *Euler, cont ContinuityLevel, myThread int, Jinv, Jdet utils.Matrix, ...)
- func (sd *ScalarDissipation) CalculateElementViscosity(myThread int, Qall [][4]utils.Matrix)
- func (sd *ScalarDissipation) CalculateEpsilonGradient(c *Euler, cont ContinuityLevel, myThread int, Q [4]utils.Matrix)
- func (sd *ScalarDissipation) GetC0EpsilonPlotField(c *Euler) (fld utils.Matrix)
- func (sd *ScalarDissipation) GetScalarEpsilonPlotField(c *Euler) (fld utils.Matrix)
- type SolutionLimiter
- type ValueType
- type VertexToElement
Constants ¶
View Source
const ( Density FlowFunction = iota XMomentum YMomentum Energy Mach // 4 StaticPressure // 5 DynamicPressure // 6 PressureCoefficient // 7 SoundSpeed // 8 Velocity // 9 XVelocity // 10 YVelocity // 11 Enthalpy // 12 Entropy //13 ShockFunction = 100 EpsilonDissipation = 101 EpsilonDissipationC0 = 102 XGradientDensity = 200 XGradientXMomentum = 201 XGradientYMomentum = 202 XGradientEnergy = 203 YGradientDensity = 300 YGradientXMomentum = 301 YGradientYMomentum = 302 YGradientEnergy = 303 )
Variables ¶
View Source
var ( LimiterNames = map[string]LimiterType{ "barthjesperson": BarthJesperson, "barth jesperson": BarthJesperson, "perssonC0": PerssonC0, "persson C0": PerssonC0, } LimiterNamesRev = map[LimiterType]string{ BarthJesperson: "BarthJesperson", PerssonC0: "Persson, C0 viscosity", } )
View Source
var ( FluxNames = map[string]FluxType{ "average": FLUX_Average, "lax": FLUX_LaxFriedrichs, "roe": FLUX_Roe, "roe-er": FLUX_RoeER, } FluxPrintNames = []string{"Average", "Lax Friedrichs", "Roe", "Roe-ER"} )
View Source
var ( InitNames = map[string]InitType{ "freestream": FREESTREAM, "ivortex": IVORTEX, "shocktube": SHOCKTUBE, } InitPrintNames = []string{"Freestream", "Inviscid Vortex Analytic Solution", "Shock Tube"} )
Functions ¶
This section is empty.
Types ¶
type ChartState ¶
type ChartState struct {
// contains filtered or unexported fields
}
type EdgeKeySlice ¶
func (EdgeKeySlice) Len ¶
func (p EdgeKeySlice) Len() int
func (EdgeKeySlice) Less ¶
func (p EdgeKeySlice) Less(i, j int) bool
func (EdgeKeySlice) Swap ¶
func (p EdgeKeySlice) Swap(i, j int)
type EdgeKeySliceSortLeft ¶
type EdgeKeySliceSortLeft EdgeKeySlice
func (EdgeKeySliceSortLeft) Len ¶
func (p EdgeKeySliceSortLeft) Len() int
func (EdgeKeySliceSortLeft) Less ¶
func (p EdgeKeySliceSortLeft) Less(i, j int) bool
func (EdgeKeySliceSortLeft) Sort ¶
func (p EdgeKeySliceSortLeft) Sort()
func (EdgeKeySliceSortLeft) Swap ¶
func (p EdgeKeySliceSortLeft) Swap(i, j int)
type EdgeValueStorage ¶
type EdgeValueStorage struct { Fluxes [][4]utils.Matrix StorageIndex map[types.EdgeKey]int // Index into normal flux storage using edge key PMap *PartitionMap Nedge int }
func (*EdgeValueStorage) GetEdgeValues ¶
func (*EdgeValueStorage) PutEdgeValues ¶
func (nf *EdgeValueStorage) PutEdgeValues(en types.EdgeKey, valType ValueType, EdgeValues [][4]float64)
type Euler ¶
type Euler struct { // Input parameters MeshFile string CFL, FinalTime float64 FSFar, FSIn, FSOut *FreeStream FluxCalcAlgo FluxType Case InitType AnalyticSolution ExactState FluxCalcMock func(rho, rhoU, rhoV, E float64) (Fx, Fy [4]float64) // For testing SortedEdgeKeys []EdgeKeySlice // Buckets, one for each parallel partition Partitions *PartitionMap // mapping of elements into bins for parallelism LocalTimeStepping bool MaxIterations int // Below are partitioned by K (elements) in the first slice Q [][4]utils.Matrix // Sharded solution variables, stored at solution point locations, Np_solution x K SolutionX, SolutionY []utils.Matrix ShockFinder *ModeAliasShockFinder Limiter *SolutionLimiter Dissipation *ScalarDissipation // Edge number mapped quantities, i.e. Face Normal Flux EdgeStore *EdgeValueStorage ShockTube *sod_shock_tube.SODShockTube // contains filtered or unexported fields }
In the DFR scheme, we have two sets of points:
- Solution points (inside element)
- Flux Points (on element faces)
The flux element operates on both sets of points, the solution element only operates on the internal solution points
func NewEuler ¶
func NewEuler(ip *InputParameters, meshFile string, ProcLimit int, plotMesh, verbose, profile bool) (c *Euler)
func (*Euler) CalculateEdgeFlux ¶
func (*Euler) CalculateFlux ¶
func (*Euler) CalculateFluxTransformed ¶
func (*Euler) CalculateLocalDT ¶
func (*Euler) CheckIfFinished ¶
func (*Euler) FluxCalcBase ¶
func (*Euler) FluxJacobianCalc ¶
func (*Euler) FluxJacobianTransformed ¶
func (*Euler) GetFaceNormal ¶
func (*Euler) GetPlotField ¶
func (*Euler) GetSolutionGradient ¶
func (*Euler) GetSolutionGradientUsingRTElement ¶
func (*Euler) InitializeIVortex ¶
func (*Euler) InitializeSolution ¶
func (*Euler) InterpolateSolutionToEdges ¶
func (*Euler) NewEdgeStorage ¶
func (c *Euler) NewEdgeStorage() (nf *EdgeValueStorage)
func (*Euler) NewRungeKuttaSSP ¶
func (c *Euler) NewRungeKuttaSSP() (rk *RungeKutta4SSP)
func (*Euler) PartitionEdges ¶
func (c *Euler) PartitionEdges()
func (*Euler) PartitionEdgesByK ¶
func (c *Euler) PartitionEdgesByK()
func (*Euler) PrintInitialization ¶
func (*Euler) PrintUpdate ¶
func (*Euler) RHSInternalPoints ¶
func (*Euler) RecombineShardsK ¶
func (*Euler) RecombineShardsKBy4 ¶
func (*Euler) SetParallelDegree ¶
func (*Euler) SetRTFluxInternal ¶
func (*Euler) SetRTFluxOnEdges ¶
func (*Euler) ShardByKTranspose ¶
func (*Euler) StoreGradientEdgeFlux ¶
func (c *Euler) StoreGradientEdgeFlux(edgeKeys EdgeKeySlice, EdgeQ1 [][4]float64)
type ExactState ¶
type FlowFunction ¶
type FlowFunction uint16
func (FlowFunction) String ¶
func (pm FlowFunction) String() string
type FreeStream ¶
type FreeStream struct { Gamma float64 Qinf [4]float64 Pinf, QQinf, Cinf float64 Alpha float64 Minf float64 }
func NewFreeStream ¶
func NewFreeStream(Minf, Gamma, Alpha float64) (fs *FreeStream)
func NewFreestreamFromQinf ¶
func NewFreestreamFromQinf(gamma float64, qq [4]float64) (fs *FreeStream)
func (*FreeStream) GetFlowFunction ¶
func (fs *FreeStream) GetFlowFunction(Q [4]utils.Matrix, ind int, pf FlowFunction) (f float64)
func (*FreeStream) GetFlowFunctionBase ¶
func (fs *FreeStream) GetFlowFunctionBase(rho, rhoU, rhoV, E float64, pf FlowFunction) (f float64)
func (*FreeStream) GetFlowFunctionQQ ¶
func (fs *FreeStream) GetFlowFunctionQQ(Q [4]float64, pf FlowFunction) (f float64)
func (*FreeStream) Print ¶
func (fs *FreeStream) Print() string
type InputParameters ¶
type InputParameters struct { Title string `yaml:"Title"` CFL float64 `yaml:"CFL"` FluxType string `yaml:"FluxType"` InitType string `yaml:"InitType"` PolynomialOrder int `yaml:"PolynomialOrder"` FinalTime float64 `yaml:"FinalTime"` Minf float64 `yaml:"Minf"` Gamma float64 `yaml:"Gamma"` Alpha float64 `yaml:"Alpha"` BCs map[string]map[int]map[string]float64 `yaml:"BCs"` // First key is BC name/type, second is parameter name LocalTimeStepping bool `yaml:"LocalTimeStep"` MaxIterations int `yaml:"MaxIterations"` ImplicitSolver bool `yaml:"ImplicitSolver"` Limiter string `yaml:"Limiter"` Kappa float64 `yaml:"Kappa"` }
Parameters obtained from the YAML input file
func (*InputParameters) Parse ¶
func (ip *InputParameters) Parse(data []byte) error
func (*InputParameters) Print ¶
func (ip *InputParameters) Print()
type LimiterType ¶
type LimiterType uint8
const ( None LimiterType = iota BarthJesperson PerssonC0 )
func NewLimiterType ¶
func NewLimiterType(label string) (lt LimiterType)
func (LimiterType) Print ¶
func (lt LimiterType) Print() (txt string)
type ModeAliasShockFinder ¶
type ModeAliasShockFinder struct { Element *DG2D.LagrangeElement2D Clipper utils.Matrix // Matrix used to clip the topmost mode from the solution polynomial, used in shockfinder Np int Kappa float64 // contains filtered or unexported fields }
func NewAliasShockFinder ¶
func NewAliasShockFinder(element *DG2D.LagrangeElement2D, Kappa float64) (sf *ModeAliasShockFinder)
func (*ModeAliasShockFinder) ElementHasShock ¶
func (sf *ModeAliasShockFinder) ElementHasShock(q []float64) (i bool)
func (*ModeAliasShockFinder) ShockIndicator ¶
func (sf *ModeAliasShockFinder) ShockIndicator(q []float64) (sigma float64)
type PartitionMap ¶
type PartitionMap struct { MaxIndex int // MaxIndex is partitioned into ParallelDegree partitions ParallelDegree int Partitions [][2]int // Beginning and end index of partitions }
func NewPartitionMap ¶
func NewPartitionMap(ParallelDegree, maxIndex int) (pm *PartitionMap)
func (*PartitionMap) GetBucket ¶
func (pm *PartitionMap) GetBucket(kDim int) (bucketNum, min, max int)
func (*PartitionMap) GetBucketDimension ¶
func (pm *PartitionMap) GetBucketDimension(bn int) (kMax int)
func (*PartitionMap) GetBucketRange ¶
func (pm *PartitionMap) GetBucketRange(bucketNum int) (kMin, kMax int)
func (*PartitionMap) GetGlobalK ¶
func (pm *PartitionMap) GetGlobalK(kLocal, bn int) (kGlobal int)
func (*PartitionMap) GetLocalK ¶
func (pm *PartitionMap) GetLocalK(baseK int) (k, Kmax, bn int)
func (*PartitionMap) Split1D ¶
func (pm *PartitionMap) Split1D(threadNum int) (bucket [2]int)
type RungeKutta4SSP ¶
type RungeKutta4SSP struct {
Jdet, Jinv []utils.Matrix // Sharded mesh Jacobian and inverse transform
RHSQ, Q_Face [][4]utils.Matrix // State used for matrix multiplies within the time step algorithm
Flux_Face [][2][4]utils.Matrix // Flux interpolated to edges from interior
Q1, Q2, Q3, Q4 [][4]utils.Matrix // Intermediate solution state
Flux [][2][4]utils.Matrix // Flux at solution points, used for interpolation to edges
Residual [][4]utils.Matrix // Used for reporting, aliased to Q1
F_RT_DOF [][4]utils.Matrix // Normal flux used for divergence
DT []utils.Matrix // Local time step storage
MaxWaveSpeed []float64 // Shard max wavespeed
GlobalDT, Time float64
StepCount int
Kmax []int // Local element count (dimension: Kmax[ParallelDegree])
NpInt, Nedge, NpFlux int // Number of points in solution, edge and flux total
EdgeQ1, EdgeQ2 [][][4]float64 // Sharded local working memory, dimensions Nedge
LimitedPoints []int // Sharded number of limited points
}
func (*RungeKutta4SSP) Step ¶
func (rk *RungeKutta4SSP) Step(c *Euler)
func (*RungeKutta4SSP) StepWorker ¶
type ScalarDissipation ¶
type ScalarDissipation struct { VtoE []VertexToElement // Sharded vertex to element map, [2] is [vertID, ElementID_Sharded] EtoV []utils.Matrix // Sharded Element to Vertex map, Kx3 Epsilon []utils.Matrix // Sharded Np x Kmax, Interpolated from element vertices EpsilonScalar [][]float64 // Sharded scalar value of dissipation, one per element DissDOF, DissDOF2, DissDiv []utils.Matrix // Sharded NpFlux x Kmax, DOF for Gradient calculation using RT DissX, DissY [][4]utils.Matrix // Sharded NpFlux x Kmax, X and Y derivative of dissipation field EpsVertex []float64 // NVerts x 1, Aggregated (Max) of epsilon surrounding each vertex, Not sharded PMap *PartitionMap // Partition map for the solution shards in K U, UClipped []utils.Matrix // Sharded scratch areas for assembly and testing of solution values Clipper utils.Matrix // Matrix used to clip the topmost mode from the solution polynomial, used in shockfinder S0, Kappa float64 BaryCentricCoords utils.Matrix // A thruple(lam0,lam1,lam2) for interpolation for each interior point, Npx3 VertexEpsilonValues []utils.Matrix // contains filtered or unexported fields }
func NewScalarDissipation ¶
func NewScalarDissipation(kappa float64, dfr *DG2D.DFR2D, pm *PartitionMap) (sd *ScalarDissipation)
func (*ScalarDissipation) AddDissipation ¶
func (sd *ScalarDissipation) AddDissipation(c *Euler, cont ContinuityLevel, myThread int, Jinv, Jdet utils.Matrix, Q, RHSQ [4]utils.Matrix)
func (*ScalarDissipation) CalculateElementViscosity ¶
func (sd *ScalarDissipation) CalculateElementViscosity(myThread int, Qall [][4]utils.Matrix)
func (*ScalarDissipation) CalculateEpsilonGradient ¶
func (sd *ScalarDissipation) CalculateEpsilonGradient(c *Euler, cont ContinuityLevel, myThread int, Q [4]utils.Matrix)
func (*ScalarDissipation) GetC0EpsilonPlotField ¶
func (sd *ScalarDissipation) GetC0EpsilonPlotField(c *Euler) (fld utils.Matrix)
func (*ScalarDissipation) GetScalarEpsilonPlotField ¶
func (sd *ScalarDissipation) GetScalarEpsilonPlotField(c *Euler) (fld utils.Matrix)
type SolutionLimiter ¶
type SolutionLimiter struct { Element *DG2D.LagrangeElement2D Tris *DG2D.Triangulation Partitions *PartitionMap ShockFinder []*ModeAliasShockFinder // Sharded UElement []utils.Matrix // Sharded scratch areas for assembly and testing of solution values FS *FreeStream // contains filtered or unexported fields }
func NewSolutionLimiter ¶
func NewSolutionLimiter(t LimiterType, kappa float64, dfr *DG2D.DFR2D, pm *PartitionMap, fs *FreeStream) (bjl *SolutionLimiter)
func (*SolutionLimiter) LimitSolution ¶
func (bjl *SolutionLimiter) LimitSolution(myThread int, Qall, Residual [][4]utils.Matrix) (points int)
type VertexToElement ¶
type VertexToElement [][3]int32 // Vertex id is the first int32, element ID is the next, threadID third
func NewVertexToElement ¶
func NewVertexToElement(EtoV utils.Matrix) (VtoE VertexToElement)
func (VertexToElement) Len ¶
func (ve VertexToElement) Len() int
func (VertexToElement) Less ¶
func (ve VertexToElement) Less(i, j int) bool
func (VertexToElement) Shard ¶
func (ve VertexToElement) Shard(pm *PartitionMap) (veSharded []VertexToElement)
func (VertexToElement) Sort ¶
func (ve VertexToElement) Sort()
func (VertexToElement) Swap ¶
func (ve VertexToElement) Swap(i, j int)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.