proteus.SubgridError module

A class hierarchy for subgrid error estimation methods (multiscale methods)

Inheritance diagram of proteus.SubgridError

class proteus.SubgridError.SGE_base(coefficients, nd, lag=False, trackSubScales=False)[source]

Bases: object

initializeElementQuadrature(mesh, t, cq)[source]
initializeTimeIntegration(timeIntegration)[source]

allow for connection with time integration method if tracking subscales

calculateSubgridError(q)[source]
updateSubgridErrorHistory(initializationPhase=False)[source]
accumulateSubgridMassHistory(q)[source]

incorporate subgrid scale mass accumulation delta m^{n}/delta t^{n+1}

class proteus.SubgridError.Advection_ASGS(coefficients, nd, stabFlag='1', lag=False)[source]

Bases: proteus.SubgridError.SGE_base

initializeElementQuadrature(mesh, t, cq)[source]
updateSubgridErrorHistory(initializationPhase=False)[source]
calculateSubgridError(q)[source]
class proteus.SubgridError.AdvectionLag_ASGS(coefficients, nd, stabFlag='1', lag=False)[source]

Bases: proteus.SubgridError.SGE_base

initializeElementQuadrature(mesh, t, cq)[source]
updateSubgridErrorHistory(initializationPhase=False)[source]
calculateSubgridError(q)[source]
class proteus.SubgridError.AdvectionDiffusionReaction_ASGS(coefficients, nd, stabFlag='1', lag=False)[source]

Bases: proteus.SubgridError.SGE_base

initializeElementQuadrature(mesh, t, cq)[source]
updateSubgridErrorHistory(initializationPhase=False)[source]
calculateSubgridError(q)[source]
class proteus.SubgridError.FFDarcyFC_ASGS(coefficients, nd, stabFlag='1', lag=False)[source]

Bases: proteus.SubgridError.SGE_base

basic stablization for TwophaseDarcy_fc_ff, only ‘mixture’ equation has advection term ‘w’ phase equation has nonlinear diffusion wrt mixture potential, ‘mixture’ equation has two nonlinear diffusion terms

initializeElementQuadrature(mesh, t, cq)[source]
updateSubgridErrorHistory(initializationPhase=False)[source]
calculateSubgridError(q)[source]
class proteus.SubgridError.DarcyFC_ASGS(coefficients, nd, stabFlag='1', lag=False)[source]

Bases: proteus.SubgridError.SGE_base

basic stablization for TwophaseDarcy_fc, no advection term ‘w’ phase and ‘n’ phase have nonlinear diffusion wrt to their own potential phi_w = psi_w, phi_n = psi_w + psi_c

initializeElementQuadrature(mesh, t, cq)[source]
updateSubgridErrorHistory(initializationPhase=False)[source]
calculateSubgridError(q)[source]
class proteus.SubgridError.HamiltonJacobi_ASGS(coefficients, nd, stabFlag='1', lag=False)[source]

Bases: proteus.SubgridError.SGE_base

initializeElementQuadrature(mesh, t, cq)[source]
calculateSubgridError(q)[source]
updateSubgridErrorHistory(initializationPhase=False)[source]
class proteus.SubgridError.HamiltonJacobiDiffusionReaction_ASGS(coefficients, nd, stabFlag='1', lag=False)[source]

Bases: proteus.SubgridError.SGE_base

initializeElementQuadrature(mesh, t, cq)[source]
updateSubgridErrorHistory(initializationPhase=False)[source]
calculateSubgridError(q)[source]
class proteus.SubgridError.HamiltonJacobi_ASGS_opt(coefficients, nd, stabFlag='1', lag=False)[source]

Bases: proteus.SubgridError.SGE_base

initializeElementQuadrature(mesh, t, cq)[source]
calculateSubgridError(q)[source]
updateSubgridErrorHistory(initializationPhase=False)[source]
class proteus.SubgridError.StokesStabilization_1(coefficients, nd, stabFlag='1', lag=False)[source]

Bases: proteus.SubgridError.SGE_base

calculateSubgridError(q)[source]
updateSubgridErrorHistory(initializationPhase=False)[source]
class proteus.SubgridError.StokesASGS_velocity(coefficients, nd)[source]

Bases: proteus.SubgridError.SGE_base

calculateSubgridError(q)[source]
updateSubgridErrorHistory(initializationPhase=False)[source]
class proteus.SubgridError.NavierStokesASGS_velocity_pressure(coefficients, nd, stabFlag='1', lag=False, delayLagSteps=5, hFactor=1.0, noPressureStabilization=False)[source]

Bases: proteus.SubgridError.SGE_base

initializeElementQuadrature(mesh, t, cq)[source]
updateSubgridErrorHistory(initializationPhase=False)[source]
calculateSubgridError(q)[source]
class proteus.SubgridError.NavierStokesASGS_velocity_pressure_opt(coefficients, nd, stabFlag='1', lag=False, delayLagSteps=5, hFactor=1.0, noPressureStabilization=False)[source]

Bases: proteus.SubgridError.SGE_base

initializeElementQuadrature(mesh, t, cq)[source]
updateSubgridErrorHistory(initializationPhase=False)[source]
calculateSubgridError(q)[source]
class proteus.SubgridError.NavierStokesASGS_velocity_pressure_optV2(coefficients, nd, stabFlag='1', lag=False, delayLagSteps=0, hFactor=1.0, noPressureStabilization=False)[source]

Bases: proteus.SubgridError.SGE_base

initializeElementQuadrature(mesh, t, cq)[source]
updateSubgridErrorHistory(initializationPhase=False)[source]
calculateSubgridError(q)[source]
class proteus.SubgridError.NavierStokesWithBodyForceASGS_velocity_pressure(coefficients, nd, stabFlag='1', lag=False, delayLagSteps=5, hFactor=1.0, noPressureStabilization=False)[source]

Bases: proteus.SubgridError.NavierStokesASGS_velocity_pressure

initializeElementQuadrature(mesh, t, cq)[source]
calculateSubgridError(q)[source]
class proteus.SubgridError.StokesASGS_velocity_pressure(coefficients, nd)[source]

Bases: proteus.SubgridError.SGE_base

calculateSubgridError(q)[source]
class proteus.SubgridError.TwophaseStokes_LS_FC_ASGS(coefficients, nd, stabFlag='1', lag=False)[source]

Bases: proteus.SubgridError.SGE_base

initializeElementQuadrature(mesh, t, cq)[source]
calculateSubgridError(q)[source]
updateSubgridErrorHistory(initializationPhase=False)[source]
class proteus.SubgridError.ShallowWater_CFL(coefficients, nd, g)[source]

Bases: proteus.SubgridError.SGE_base

calculateSubgridError(q)[source]
class proteus.SubgridError.SkewStabilization_1(mesh, nc, nd)[source]

Bases: object

calculateSubgridError(q)[source]
class proteus.SubgridError.AdvectionDiffusionReactionTransientSubscales_ASGS(coefficients, nd, stabFlag='1', lag=False, trackSubScales=False, useHarariDirectly=False, limit_tau_t=False, tau_t_limit_min=0.0, tau_t_limit_max=1.0)[source]

Bases: proteus.SubgridError.AdvectionDiffusionReaction_ASGS

track subgrid scales in time with Backward Euler

delta u^{n+1} = - au_t ilde{R}_h

ilde{R}_h = R_h - m^{prime,k}

rac{delta u^{n}}{Delta t^{n+1}}

au_t =

rac{Delta t^{n+1} au_s}{m^{prime,n+1} au_s + Delta t^{n+1}}

au_s = normal spatial tau, supposed to have au_s pprox mathcal{L}^{-1}_{s}

for now m^{prime} evaluated at k=n for subgrid error but not sure if this is right or not

TODO:
Check Peclet number calculation in generic tau and cfl calculation, what’s returned in cfl array

(advective or max of advective,diffusive stab. constraint)

FLCBDF seems less happy with tracking subgrid scales than without tracking

initializeElementQuadrature(mesh, t, cq)[source]
initializeTimeIntegration(timeIntegration)[source]

allow for connection with time integration method if tracking subscales

updateSubgridErrorHistory(initializationPhase=False)[source]
calculateSubgridError(q)[source]
accumulateSubgridMassHistory(q)[source]

incorporate subgrid scale mass accumulation delta m^{n}/delta t^{n+1}

class proteus.SubgridError.AdvectionDiffusionReactionHaukeSangalliInterpolant_ASGS(coefficients, nd, stabFlag='1', lag=False, interpolationFemSpaceType=None, tau_00_force=None, tau_11_force=None)[source]

Bases: proteus.SubgridError.SGE_base

Should be basic Hauke Sangalli approach but computes terms at interpolation points and then uses this to compute the gradient for Sangalli type approach Adjoint gradient is computed manually

initializeElementQuadrature(mesh, t, cq, cip=None)[source]
initializeTimeIntegration(timeIntegration)[source]

allow for connection with time integration method if tracking subscales

calculateSubgridErrorInterpolants(ci)[source]

should interpolate strong residual. One problem is that strong residual is discontinuous when grad(u) terms are nonzero so standard C0 projection won’t necessarily be what we expect locally on each element for C0, P1 and linear problem with constant coefficients computing gradient locally should be just the same as ignoring gradient terms altogether

calculateSubgridError(q)[source]
updateSubgridErrorHistory(initializationPhase=False)[source]
class proteus.SubgridError.AdvectionDiffusionReactionHaukeSangalliInterpolantWithTransientSubScales_ASGS(coefficients, nd, stabFlag='1', lag=False, interpolationFemSpaceType=None, trackSubScales=False, tau_00_force=None, tau_11_force=None, includeSubgridScalesInGradientStabilization=True)[source]

Bases: proteus.SubgridError.AdvectionDiffusionReactionHaukeSangalliInterpolant_ASGS

Should be basic Hauke Sangalli approach but computes terms at interpolation points and then uses this to compute the gradient for Sangalli type approach Adjoint gradient is computed manually And SubScales are tracked in time

initializeElementQuadrature(mesh, t, cq, cip=None)[source]
calculateSubgridErrorInterpolants(ci)[source]

should interpolate strong residual. One problem is that strong residual is discontinuous when grad(u) terms are nonzero so standard C0 projection won’t necessarily be what we expect locally on each element for C0, P1 and linear problem with constant coefficients computing gradient locally should be just the same as ignoring gradient terms altogether

calculateSubgridError(q)[source]
updateSubgridErrorHistory(initializationPhase=False)[source]
accumulateSubgridMassHistory(q)[source]

incorporate subgrid scale mass accumulation delta m^{n}/delta t^{n+1}

class proteus.SubgridError.NavierStokesTransientSubScalesASGS_velocity_pressure(coefficients, nd, stabFlag='1', lag=False, delayLagSteps=5, hFactor=1, noPressureStabilization=False, trackSubScales=False, limit_tau_t=False, tau_t_limit_min=0.0, tau_t_limit_max=1.0)[source]

Bases: proteus.SubgridError.NavierStokesASGS_velocity_pressure

initializeElementQuadrature(mesh, t, cq)[source]
initializeTimeIntegration(timeIntegration)[source]

allow for connection with time integration method if tracking subscales

updateSubgridErrorHistory(initializationPhase=False)[source]
accumulateSubgridMassHistory(q)[source]

incorporate subgrid scale mass accumulation delta m^{n}/delta t^{n+1}

calculateSubgridError(q)[source]