PyNucleus_multilevelSolver package

PyNucleus_multilevelSolver.coarseSolvers module

class PyNucleus_multilevelSolver.coarseSolvers.ComplexcoarseSolver(hierarchyManager, FakePLogger PLogger, solverName, **kwargs)

Bases: complex_iterative_solver

This coarse solver gathers the ride-hand side from all nodes, then solves the problem on a subcommunicator using a distributed solver and scatters the solution.

Ainv

Ainv: PyNucleus_base.solvers.complex_solver

__init__(*args, **kwargs)
asynchronous

asynchronous: β€˜BOOL_t’

canWriteRHS(self) BOOL_t
getSolution(self, double complex[::1] x) BOOL_t
inCG

inCG: β€˜BOOL_t’

inSubdomain

inSubdomain: β€˜BOOL_t’

intraLevelCoarse

intraLevelCoarse: PyNucleus_fem.algebraicOverlaps.algebraicOverlapManager

intraLevelFine

intraLevelFine: PyNucleus_fem.algebraicOverlaps.algebraicOverlapManager

overlapsCoarse

overlapsCoarse: PyNucleus_fem.algebraicOverlaps.algebraicOverlapManager

overlapsFine

overlapsFine: PyNucleus_fem.algebraicOverlaps.algebraicOverlapManager

rhs

rhs: β€˜double complex[::1]’

sendRHS(self, double complex[::1] b) void
setAinv(self)
setup(self, ComplexLinearOperator A=None) void
x

x: β€˜double complex[::1]’

class PyNucleus_multilevelSolver.coarseSolvers.coarseSolver(hierarchyManager, FakePLogger PLogger, solverName, **kwargs)

Bases: iterative_solver

This coarse solver gathers the ride-hand side from all nodes, then solves the problem on a subcommunicator using a distributed solver and scatters the solution.

Ainv

Ainv: PyNucleus_base.solvers.solver

__init__(*args, **kwargs)
asynchronous

asynchronous: β€˜BOOL_t’

canWriteRHS(self) BOOL_t
getSolution(self, REAL_t[::1] x) BOOL_t
inCG

inCG: β€˜BOOL_t’

inSubdomain

inSubdomain: β€˜BOOL_t’

intraLevelCoarse

intraLevelCoarse: PyNucleus_fem.algebraicOverlaps.algebraicOverlapManager

intraLevelFine

intraLevelFine: PyNucleus_fem.algebraicOverlaps.algebraicOverlapManager

overlapsCoarse

overlapsCoarse: PyNucleus_fem.algebraicOverlaps.algebraicOverlapManager

overlapsFine

overlapsFine: PyNucleus_fem.algebraicOverlaps.algebraicOverlapManager

rhs

rhs: β€˜REAL_t[::1]’

sendRHS(self, REAL_t[::1] b) void
setAinv(self)
setup(self, LinearOperator A=None) void
x

x: β€˜REAL_t[::1]’

PyNucleus_multilevelSolver.connectors module

class PyNucleus_multilevelSolver.connectors.hierarchyConnector(global_comm, comm1, comm2, hierarchy1)[source]

Bases: object

__init__(global_comm, comm1, comm2, hierarchy1)[source]
getNewHierarchy()[source]
getLevelList()[source]
build()[source]
comm1SubdomainGlobalRank(subdomainNo)[source]
comm2SubdomainGlobalRank(subdomainNo)[source]
comm1RankSubdomainNo(rank)[source]
comm2RankSubdomainNo(rank)[source]
class PyNucleus_multilevelSolver.connectors.inputConnector(global_comm, comm1, comm2, hierarchy1, domain, algebraicLevelType=<class 'PyNucleus_multilevelSolver.levels.algebraicLevel'>, meshParams={})[source]

Bases: hierarchyConnector

__init__(global_comm, comm1, comm2, hierarchy1, domain, algebraicLevelType=<class 'PyNucleus_multilevelSolver.levels.algebraicLevel'>, meshParams={})[source]
getNewHierarchy(params)[source]
class PyNucleus_multilevelSolver.connectors.repartitionConnector(global_comm, comm1, comm2, hierarchy1, partitionerType, partitionerParams, debugOverlaps=False, commType='standard', algebraicLevelType=<class 'PyNucleus_multilevelSolver.levels.algebraicLevel'>)[source]

Bases: hierarchyConnector

__init__(global_comm, comm1, comm2, hierarchy1, partitionerType, partitionerParams, debugOverlaps=False, commType='standard', algebraicLevelType=<class 'PyNucleus_multilevelSolver.levels.algebraicLevel'>)[source]
getNewHierarchy(params)[source]
getLocalOverlap()[source]
build()[source]
class PyNucleus_multilevelSolver.connectors.pCoarsenConnector(global_comm, comm1, comm2, hierarchy1, algebraicLevelType=<class 'PyNucleus_multilevelSolver.levels.algebraicLevel'>)[source]

Bases: hierarchyConnector

__init__(global_comm, comm1, comm2, hierarchy1, algebraicLevelType=<class 'PyNucleus_multilevelSolver.levels.algebraicLevel'>)[source]
getNewHierarchy(params)[source]

PyNucleus_multilevelSolver.geometricMG module

PyNucleus_multilevelSolver.geometricMG.paramsForSerialMG(noRef, global_params)[source]
PyNucleus_multilevelSolver.geometricMG.paramsForMG(noRef, onRanks, global_params, manifold_dim, element, repartitionFactor=0.05, max_coarse_grid_size=4500)[source]
PyNucleus_multilevelSolver.geometricMG.writeToHDF(filename, levels, mesh)[source]
PyNucleus_multilevelSolver.geometricMG.readFromHDF(filename)[source]

PyNucleus_multilevelSolver.hierarchies module

class PyNucleus_multilevelSolver.hierarchies.EmptyHierarchy(params, label='')[source]

Bases: object

__init__(params, label='')[source]
isSetUp()[source]
updateParamsFromDefaults()[source]
class PyNucleus_multilevelSolver.hierarchies.hierarchy(meshLevel, params, comm=None, label='')[source]

Bases: object

__init__(meshLevel, params, comm=None, label='')[source]
static updateParamsFromDefaults(params)[source]
refine(isLastLevel=False)[source]
build()[source]
isSetUp()[source]
getLevelList(recurse=True)[source]
static fromLevelList(levels, params={}, comm=None, label='')[source]
buildCollapsedRestrictionProlongation()[source]
gatherInformation(root=0)[source]
getSubHierarchy(numLevels)[source]
class PyNucleus_multilevelSolver.hierarchies.pCoarsenHierarchy(meshLevel, params, comm=None, label='')[source]

Bases: hierarchy

__init__(meshLevel, params, comm=None, label='')[source]
refine(isLastLevel=False)[source]
class PyNucleus_multilevelSolver.hierarchies.hierarchyManager(hierarchyDefs, connectorDefs, params, comm=None, doDeepCopy=True)[source]

Bases: object

__init__(hierarchyDefs, connectorDefs, params, comm=None, doDeepCopy=True)[source]
getPrintRank()[source]
setCommunicators()[source]
buildHierarchies()[source]
setup()[source]
display(info=False)[source]
getLevelList()[source]
static fromLevelList(levels, params={}, comm=None)[source]
getComm()[source]
hierarchyIsSetUp(label)[source]
getHierarchy(label)[source]
getSubManager(label=None)[source]
collectInformation(hierarchies, root=-1)[source]
getSubHierarchy(numFineLevels)[source]

PyNucleus_multilevelSolver.levels module

class PyNucleus_multilevelSolver.levels.level(params, previousLevel=None, comm=None, label='', startLevelNo=0, isLastLevel=False)[source]

Bases: object

__init__(params, previousLevel=None, comm=None, label='', startLevelNo=0, isLastLevel=False)[source]
getLevelNo()[source]
property levelNo
getLevelID()[source]
property levelID
class PyNucleus_multilevelSolver.levels.meshLevel(mesh, params, previousLevel=None, interfaces=None, meshOverlaps=None, interiorBL=None, comm=None, label='', meshInformationPolicy=1, startLevelNo=0, isLastLevel=False)[source]

Bases: level

__init__(mesh, params, previousLevel=None, interfaces=None, meshOverlaps=None, interiorBL=None, comm=None, label='', meshInformationPolicy=1, startLevelNo=0, isLastLevel=False)[source]
setAlgebraicLevelType(algLevelType)[source]
refine(meshInformationPolicy)[source]
copy()[source]
getIsDistributed()[source]
property isDistributed
getAlgebraicLevel(buildType)[source]
clean()[source]
getLevelDict()[source]
static fromLevelDict(lvl, params={}, previousLevel=None, comm=None, startLevelNo=0, label='')[source]
getH()[source]
property h
class PyNucleus_multilevelSolver.levels.algebraicLevelBase(meshLevel, buildType)[source]

Bases: level

__init__(meshLevel, buildType)[source]
build(buildType)[source]
buildCoarserMatrices()[source]

Recursively build matrices on coarser levels

clean()[source]
classmethod getKeys()[source]
getLevelDict()[source]
classmethod fromLevelDict(meshLevel, lvl)[source]
property accumulateOperator
class PyNucleus_multilevelSolver.levels.algebraicLevel(meshLevel, buildType)[source]

Bases: algebraicLevelBase

__init__(meshLevel, buildType)[source]
build(buildType)[source]
buildCoarserMatrices()[source]

Recursively build matrices on coarser levels

classmethod getKeys()[source]
getLevelDict()[source]
getGlobalA(doDistribute=False, keepDistributedResult=False)[source]

PyNucleus_multilevelSolver.multigrid module

class PyNucleus_multilevelSolver.multigrid.ComplexlevelMemory(INDEX_t size, BOOL_t coarsest, BOOL_t finest)

Bases: object

A

A: PyNucleus_base.linear_operators.ComplexLinearOperator

D

D: β€˜double complex[::1]’

P

P: PyNucleus_base.linear_operators.ComplexLinearOperator

R

R: PyNucleus_base.linear_operators.ComplexLinearOperator

__init__(*args, **kwargs)
rhs

rhs: β€˜double complex[::1]’

smoother

smoother: PyNucleus_multilevelSolver.smoothers.Complexsmoother

smootherType

smootherType: tuple

sol

sol: β€˜double complex[::1]’

temp

temp: β€˜double complex[::1]’

class PyNucleus_multilevelSolver.multigrid.Complexmultigrid(myHierarchyManager, smoother=('jacobi', {'omega': 2.0 / 3.0}), BOOL_t logging=False, **kwargs)

Bases: complex_iterative_solver

__init__(*args, **kwargs)
asPreconditioner(self, INDEX_t maxIter=1, CycleType cycle=V)
coarse_solver

coarse_solver: PyNucleus_base.solvers.complex_solver

comm

comm: mpi4py.MPI.Comm

cycle

cycle: β€˜CycleType’

iterationMatrix(self)
levels

levels: list

operatorComplexity(self)
overlap

overlap: PyNucleus_fem.algebraicOverlaps.multilevelAlgebraicOverlapManager

setup(self, ComplexLinearOperator A=None) void
solveFMG(self, double complex[::1] b, double complex[::1] x) int
class PyNucleus_multilevelSolver.multigrid.ComplexmultigridPreconditioner(Complexmultigrid ml, CycleType cycle, INDEX_t maxIter=1)

Bases: complex_preconditioner

__init__(*args, **kwargs)
class PyNucleus_multilevelSolver.multigrid.CycleType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: IntFlag

V = 1
W = 2
FMG_V = 666
FMG_W = 667
class PyNucleus_multilevelSolver.multigrid.levelMemory(INDEX_t size, BOOL_t coarsest, BOOL_t finest)

Bases: object

A

A: PyNucleus_base.linear_operators.LinearOperator

D

D: β€˜REAL_t[::1]’

P

P: PyNucleus_base.linear_operators.LinearOperator

R

R: PyNucleus_base.linear_operators.LinearOperator

__init__(*args, **kwargs)
rhs

rhs: β€˜REAL_t[::1]’

smoother

smoother: PyNucleus_multilevelSolver.smoothers.smoother

smootherType

smootherType: tuple

sol

sol: β€˜REAL_t[::1]’

temp

temp: β€˜REAL_t[::1]’

class PyNucleus_multilevelSolver.multigrid.multigrid(myHierarchyManager, smoother=('jacobi', {'omega': 2.0 / 3.0}), BOOL_t logging=False, **kwargs)

Bases: iterative_solver

__init__(*args, **kwargs)
asPreconditioner(self, INDEX_t maxIter=1, CycleType cycle=V)
coarse_solver

coarse_solver: PyNucleus_base.solvers.solver

comm

comm: mpi4py.MPI.Comm

cycle

cycle: β€˜CycleType’

iterationMatrix(self)
levels

levels: list

operatorComplexity(self)
overlap

overlap: PyNucleus_fem.algebraicOverlaps.multilevelAlgebraicOverlapManager

setup(self, LinearOperator A=None) void
solveFMG(self, REAL_t[::1] b, REAL_t[::1] x) int
class PyNucleus_multilevelSolver.multigrid.multigridPreconditioner(multigrid ml, CycleType cycle, INDEX_t maxIter=1)

Bases: preconditioner

__init__(*args, **kwargs)

PyNucleus_multilevelSolver.restrictionProlongation module

PyNucleus_multilevelSolver.restrictionProlongation.buildRestrictionProlongation(DoFMap coarse_DoFMap, DoFMap fine_DoFMap)

PyNucleus_multilevelSolver.smoothers module

class PyNucleus_multilevelSolver.smoothers.ComplexblockJacobiPreconditioner(ComplexLinearOperator A, sparseGraph blocks, double complex omega)

Bases: Complexpreconditioner

__init__(*args, **kwargs)
omega

omega: β€˜double complex’

setD(self, ComplexLinearOperator A, sparseGraph blocks)
class PyNucleus_multilevelSolver.smoothers.ComplexblockJacobiSmoother(ComplexLinearOperator A, dict params, ndarray temporaryMemory=None, overlap=None)

Bases: ComplexseparableSmoother

__init__(*args, **kwargs)
class PyNucleus_multilevelSolver.smoothers.ComplexgmresSmoother(ComplexLinearOperator A, double complex[::1] D, dict params, algebraicOverlapManager overlap=None)

Bases: Complexsmoother

A
__init__(*args, **kwargs)
solver

solver: PyNucleus_base.solvers.complex_solver

temporaryMemory

temporaryMemory: β€˜double complex[::1]’

temporaryMemory2

temporaryMemory2: β€˜double complex[::1]’

class PyNucleus_multilevelSolver.smoothers.ComplexjacobiPreconditioner(double complex[::1] D, double complex omega)

Bases: Complexpreconditioner

__init__(*args, **kwargs)
omega

omega: β€˜double complex’

setD(self, double complex[::1] D)
class PyNucleus_multilevelSolver.smoothers.ComplexjacobiSmoother(ComplexLinearOperator A, double complex[::1] D, dict params, ndarray temporaryMemory=None, overlap=None)

Bases: ComplexseparableSmoother

__init__(*args, **kwargs)
class PyNucleus_multilevelSolver.smoothers.Complexpreconditioner(INDEX_t numRows, INDEX_t numColumns)

Bases: ComplexLinearOperator

__init__(*args, **kwargs)
class PyNucleus_multilevelSolver.smoothers.ComplexseparableSmoother(ComplexLinearOperator A, Complexpreconditioner P, dict params, ndarray temporaryMemory=None, algebraicOverlapManager overlap=None)

Bases: Complexsmoother

A
__init__(*args, **kwargs)
prec

prec: PyNucleus_multilevelSolver.smoothers.Complexpreconditioner

setD(self, double complex[::1] D)
temporaryMemory

temporaryMemory: β€˜double complex[::1]’

temporaryMemory2

temporaryMemory2: β€˜double complex[::1]’

class PyNucleus_multilevelSolver.smoothers.Complexsmoother(ComplexLinearOperator A)

Bases: object

A
__call__(*args, **kwargs)

Call self as a function.

__init__(*args, **kwargs)
overlap

overlap: PyNucleus_fem.algebraicOverlaps.algebraicOverlapManager

class PyNucleus_multilevelSolver.smoothers.blockJacobiPreconditioner(LinearOperator A, sparseGraph blocks, REAL_t omega)

Bases: preconditioner

__init__(*args, **kwargs)
omega

omega: β€˜REAL_t’

setD(self, LinearOperator A, sparseGraph blocks)
class PyNucleus_multilevelSolver.smoothers.blockJacobiSmoother(LinearOperator A, dict params, ndarray temporaryMemory=None, overlap=None)

Bases: separableSmoother

__init__(*args, **kwargs)
class PyNucleus_multilevelSolver.smoothers.chebyshevPreconditioner(INDEX_t degree, LinearOperator A, REAL_t rhoA=0., REAL_t lowerBound=1.0 / 30.0, REAL_t upperBound=1.1, algebraicOverlapManager overlap=None, REAL_t eps=0.01, INDEX_t kMax=10)

Bases: preconditioner

__init__(*args, **kwargs)
coeffs

coeffs: β€˜REAL_t[::1]’

class PyNucleus_multilevelSolver.smoothers.chebyshevSmoother(LinearOperator A, REAL_t[::1] D, dict params, ndarray temporaryMemory=None, overlap=None)

Bases: separableSmoother

__init__(*args, **kwargs)
class PyNucleus_multilevelSolver.smoothers.flexibleSmoother(LinearOperator A, dict params, overlap=None)

Bases: separableSmoother

__init__(*args, **kwargs)
class PyNucleus_multilevelSolver.smoothers.gaussSeidelSmoother(A, REAL_t[::1] D, dict params, temporaryMemory=None, temporaryMemory2=None, overlap=None)

Bases: smoother

D

D: β€˜REAL_t[::1]’

__init__(*args, **kwargs)
setD(self, REAL_t[::1] D)
class PyNucleus_multilevelSolver.smoothers.gmresSmoother(LinearOperator A, REAL_t[::1] D, dict params, algebraicOverlapManager overlap=None)

Bases: smoother

A
__init__(*args, **kwargs)
solver

solver: PyNucleus_base.solvers.solver

temporaryMemory

temporaryMemory: β€˜REAL_t[::1]’

temporaryMemory2

temporaryMemory2: β€˜REAL_t[::1]’

class PyNucleus_multilevelSolver.smoothers.iluPreconditioner(LinearOperator A, **kwargs)

Bases: preconditioner

__init__(*args, **kwargs)
class PyNucleus_multilevelSolver.smoothers.iluSmoother(LinearOperator A, dict params, ndarray temporaryMemory=None, overlap=None)

Bases: separableSmoother

__init__(*args, **kwargs)
class PyNucleus_multilevelSolver.smoothers.jacobiPreconditioner(REAL_t[::1] D, REAL_t omega)

Bases: preconditioner

__init__(*args, **kwargs)
omega

omega: β€˜REAL_t’

setD(self, REAL_t[::1] D)
class PyNucleus_multilevelSolver.smoothers.jacobiSmoother(LinearOperator A, REAL_t[::1] D, dict params, ndarray temporaryMemory=None, overlap=None)

Bases: separableSmoother

__init__(*args, **kwargs)
class PyNucleus_multilevelSolver.smoothers.preconditioner(INDEX_t numRows, INDEX_t numColumns)

Bases: LinearOperator

__init__(*args, **kwargs)
class PyNucleus_multilevelSolver.smoothers.separableSmoother(LinearOperator A, preconditioner P, dict params, ndarray temporaryMemory=None, algebraicOverlapManager overlap=None)

Bases: smoother

A
__init__(*args, **kwargs)
prec

prec: PyNucleus_multilevelSolver.smoothers.preconditioner

setD(self, REAL_t[::1] D)
temporaryMemory

temporaryMemory: β€˜REAL_t[::1]’

temporaryMemory2

temporaryMemory2: β€˜REAL_t[::1]’

class PyNucleus_multilevelSolver.smoothers.smoother(LinearOperator A)

Bases: object

A
__call__(*args, **kwargs)

Call self as a function.

__init__(*args, **kwargs)
overlap

overlap: PyNucleus_fem.algebraicOverlaps.algebraicOverlapManager

class PyNucleus_multilevelSolver.smoothers.sorPreconditioner(LinearOperator A, REAL_t[::1] D, REAL_t omega, BOOL_t presmoother_forwardSweep, BOOL_t postsmoother_forwardSweep)

Bases: preconditioner

A

A: PyNucleus_base.linear_operators.LinearOperator

D

D: β€˜REAL_t[::1]’

__init__(*args, **kwargs)
forwardSweep

forwardSweep: β€˜BOOL_t’

postsmoother_forwardSweep

postsmoother_forwardSweep: β€˜BOOL_t’

presmoother_forwardSweep

presmoother_forwardSweep: β€˜BOOL_t’

class PyNucleus_multilevelSolver.smoothers.sorSmoother(A, D, dict params, temporaryMemory=None, temporaryMemory2=None, overlap=None)

Bases: separableSmoother

__init__(*args, **kwargs)
class PyNucleus_multilevelSolver.smoothers.ssorPreconditioner(LinearOperator A, REAL_t[::1] D, REAL_t omega)

Bases: preconditioner

__init__(*args, **kwargs)
class PyNucleus_multilevelSolver.smoothers.ssorSmoother(A, D, dict params, temporaryMemory=None, overlap=None)

Bases: separableSmoother

__init__(*args, **kwargs)