just add a place to put things I’m testing out before they are ready for including in proteus
proteus.testStuff.
ExplicitLevelSetSolver
(nDOF_global, RKorder=2, solnComponent=0, redistance=False, enforceWeakDir=False, redEpsFact=2.0, redCFL=0.1)[source]¶Implement explicit, stabilized P^1 C^0 HJ level set algorithm from Barth and Sethian 98 (5.2)
RKorder — order of explicit RK time integration (1 or 2) solnComponent — solution component in VectorTransport to apply alg to.
proteus.testStuff.
ExplicitLevelSetIntegrator
(mlvtran, mlnl, dtMeth, nOptions, stepExact=True)[source]¶Bases: proteus.TimeIntegration.ForwardIntegrator
put in manual integration to play with level-set redistancing
proteus.testStuff.
projectToFinestLevel
(mlTransport, level, tsim=0.0)[source]¶use multilevel transport prolongation to get fine grid information starting at level.
returns quadrature dictionary of projected values on fine grid
proteus.testStuff.
generateParentInfo
(mlMesh)[source]¶proteus.testStuff.
getIntegrationPointsOnCoarseGrid
(xf, lf, P, lc)[source]¶given array of points N^f_e x n_q x 3 on level lf generate dictionary on coarse grid that’s N^c_e x n_q^c(e_c) x 3 and holds the integration points assigned to the correct coarse grid element. If using uniform refinement should have the same number of integration points per coarse grid element but the number depends on the level of refinement eg n_q^4(lf-lc). In general the number won’t be the same for nonuniform refinement
proteus.testStuff.
getCoarseGridBasisValuesOnFinePointsUniform
(uc, xc, invJc, nEf, nq)[source]¶assuming have collection of points in physical space on mesh xc with same number of points per element, map these back to reference element, then calculate shape function values there and return in a fine grid array
proteus.testStuff.
getCoarseGridValuesOnFineUniform
(uc, vcArray, xc, nEf, nq)[source]¶given basis representation for coarse grid at fine grid points compute fem function values and return in fine grid array
proteus.testStuff.
projectToFinestLevelNC
(mlTransport, level, ci=0, tsim=0.0)[source]¶use brute force evaluation to get coarse grid quantities on fine grid starting at level.
returns quadrature dictionary of projected values on fine grid
proteus.testStuff.
projectVelocityToFinestLevelNC
(mlTransport, level, ci=0, tsim=0.0, verbose=0)[source]¶use brute force evaluation to get coarse grid quantities on fine grid starting at level.
returns quadrature dictionary of projected values on fine grid
proteus.testStuff.
MultilevelProjectionOperatorsNC
(multiLevelMesh, femSpaceDictList, offsetListList, strideListList, dofBoundaryConditionsDictList)[source]¶A class that takes a hierarchical (multiLevel) mesh and generates the interpolation and restriction operators.
restrictList/prolongList – projection and restriction at only the free nodes restrict_bcList/prolong_bcList – includes dirichlet boundaries as well
By default this is set up for conforming spaces. Since the spaces are conforming the coarse basis functions are in the fine space so we need only find the coefficients of the fine space basis functions that yield the coarse space basis functions. This is the matrix of the trivial injection from coarse to fine and it is used as the projection operator. Restriction is taken as the matrix of the adjoint of the injection, which is simply the transpose of the projection matrix. These operators fall out if you try to solve for the error on the coarse grid: Starting with u_f we have a(u_f+e_f,w_f) = <f,w_f>, and we want to solve instead a(e_c,w_c) = <f - a(u_f,w_f),w_c> on the coarse grid Using the injection i we can express this in the fine space as a(i e_c, i w_c) = <f - a(u_f,w_f),i w_c> writing this in matrix form yields p^t A_f p E = p^t R_f
— P1 nonconforming space —- Try to set up now for nonconforming P1 approximation following Chen_96b. Setup prolongation by evaluating coarse grid basis functions at fine grid interpolation condition points (face barycenters).
Then, just need to know if fine grid interpolationCondition point falls on interface of coarse grid elements or not. If so, use average value of coarse grid quantity on fine grid. Otherwise just evaluate it
Use this simple interpolation from coarse to fine as the projection operator. Restriction is taken as the matrix of the adjoint of the injection, which is simply the transpose of the projection matrix.
I don’t think these fall out as nicely since they’re nonconforming.
proteus.testStuff.
AdaptiveForwardIntegrator
(mlvtran, mlnl, dtMeth, nOptions, stepExact=True, stepAdapt=True, resetAfterNLfail=True)[source]¶class that is responsible for basic process of integrating a problem forward in time given a VectorTranport Problem, Nonlinear Solver, and a Time Integration method
mlvTran — multilevel vector transport object for system being integrated mlNL — multilevel nonlinear solver to solve discrete system dtMet — time integration method to use nOptions — configuration options
proteus.testStuff.
AdaptiveBackwardEuler
(vectorTransport, runCFL=0.9, atol=0.001, rtol=0.001, errorType='LI_global', dtRatioMax=2, dtRatioMin=0.1)[source]¶proteus.testStuff.
RusanovNumericalFlux_Diagonal_Diffusion_LDG
(vt, getPointwiseBoundaryConditions, getAdvectiveFluxBoundaryConditions, getDiffusiveFluxBoundaryConditions)[source]¶Bases: proteus.NumericalFlux.Advection_DiagonalUpwind_Diffusion_LDG
apply numerical flus \(f_{num}(a,b) = 1/2(f(a)+f(b)-ar{\lambda}(b-a)\) where \(\lambda >= max |f^{\prime}|\) for \(a<= u <= b\) this one applies flux to each component of flux separately
proteus.testStuff.
SSPRKNewton
(linearSolver, F, J=None, du=None, par_du=None, rtol_r=0.0001, atol_r=1e-16, rtol_du=0.0001, atol_du=1e-16, maxIts=100, norm=<function l2Norm>, convergenceTest='r', computeRates=True, printInfo=True, fullNewton=True, directSolver=False, EWtol=True, maxLSits=100)[source]¶Bases: proteus.NonlinearSolvers.Newton
A simple iterative solver that is Newton’s method if you give it the right Jacobian