proteus.Archiver module

Classes for archiving numerical solution data

Inheritance diagram of proteus.Archiver

proteus.Archiver.indentXML(elem, level=0)[source]
class proteus.Archiver.ArchiveFlags[source]

Bases: object

EVERY_MODEL_STEP = 0[source]
EVERY_USER_STEP = 1[source]
EVERY_SEQUENCE_STEP = 2[source]
UNDEFINED = -1[source]
class proteus.Archiver.AR_base(dataDir, filename, useTextArchive=False, gatherAtClose=True, useGlobalXMF=True, hotStart=False, readOnly=False, global_sync=True)[source]

Bases: object

gatherAndWriteTimes()[source]

Pull all the time steps into the global tree and write

clear_xml()[source]
close()[source]
allGather()[source]
allGatherIncremental()[source]
sync()[source]
create_dataset_async(name, data)[source]
create_dataset_sync(name, offsets, data)[source]
proteus.Archiver.XdmfArchive[source]

alias of proteus.Archiver.AR_base

class proteus.Archiver.XdmfWriter(shareSingleGrid=True, arGridCollection=None, arGrid=None, arTime=None)[source]

Bases: object

collect functionality for writing data to Xdmf format

Writer is supposed to keep track of grid collection (temporal collection)

as well as current grid under grid collection where data belong, since data are associated with a grid of specific type (e.g., P1 Lagrange, P2 Lagrange, elementQuadrature dictionary, …)

setGridCollectionAndGridElements(init, ar, arGrid, t, spaceSuffix)[source]

attempt at boiler plate code to grab current arGridCollection and grid for a given type and time level t returns gridName to use in writing mesh

writeMeshXdmf_elementQuadrature(ar, mesh, spaceDim, x, t=0.0, init=False, meshChanged=False, arGrid=None, tCount=0)[source]
writeMeshXdmf_elementBoundaryQuadrature(ar, mesh, spaceDim, x, t=0.0, init=False, meshChanged=False, arGrid=None, tCount=0)[source]
writeMeshXdmf_exteriorElementBoundaryQuadrature(ar, mesh, spaceDim, x, t=0.0, init=False, meshChanged=False, arGrid=None, tCount=0)[source]
writeScalarXdmf_elementQuadrature(ar, u, name, tCount=0, init=True)[source]
writeVectorXdmf_elementQuadrature(ar, u, name, tCount=0, init=True)[source]
writeTensorXdmf_elementQuadrature(ar, u, name, tCount=0, init=True)[source]
writeScalarXdmf_elementBoundaryQuadrature(ar, u, name, tCount=0, init=True)[source]
writeVectorXdmf_elementBoundaryQuadrature(ar, u, name, tCount=0, init=True)[source]
writeTensorXdmf_elementBoundaryQuadrature(ar, u, name, tCount=0, init=True)[source]
writeScalarXdmf_exteriorElementBoundaryQuadrature(ar, u, name, tCount=0, init=True)[source]
writeVectorXdmf_exteriorElementBoundaryQuadrature(ar, u, name, tCount=0, init=True)[source]
writeTensorXdmf_exteriorElementBoundaryQuadrature(ar, u, name, tCount=0, init=True)[source]
writeMeshXdmf_quadraturePoints(ar, mesh, spaceDim, x, t=0.0, quadratureType='q', init=False, meshChanged=False, arGrid=None, tCount=0)[source]

write out quadrature point mesh for quadrature points that are unique to either elements or elementBoundaries

quadrature type

q –> element ebq_global –> element boundary ebqe –> exterior element boundary

writeScalarXdmf_quadrature(ar, u, name, tCount=0, init=True)[source]
writeVectorXdmf_quadrature(ar, u, name, tCount=0, init=True)[source]
writeTensorXdmf_quadrature(ar, u, name, tCount=0, init=True)[source]

TODO make faster tmp creation

writeMeshXdmf_DGP1Lagrange(ar, name, mesh, spaceDim, dofMap, CGDOFMap, t=0.0, init=False, meshChanged=False, arGrid=None, tCount=0)[source]

TODO Not tested yet

writeMeshXdmf_DGP2Lagrange(ar, name, mesh, spaceDim, dofMap, CGDOFMap, t=0.0, init=False, meshChanged=False, arGrid=None, tCount=0)[source]
writeMeshXdmf_C0P2Lagrange(ar, name, mesh, spaceDim, dofMap, t=0.0, init=False, meshChanged=False, arGrid=None, tCount=0)[source]

TODO: test new lagrangeNodes convention for 2d,3d

writeMeshXdmf_C0Q2Lagrange(ar, name, mesh, spaceDim, dofMap, t=0.0, init=False, meshChanged=False, arGrid=None, tCount=0)[source]

TODO: test new lagrangeNodes convention for 2d,3d

writeMeshXdmf_CrouzeixRaviartP1(ar, mesh, spaceDim, dofMap, t=0.0, init=False, meshChanged=False, arGrid=None, tCount=0)[source]

Write out nonconforming P1 approximation Write out as a (discontinuous) Lagrange P1 function to make visualization easier and dof’s as face centered data on original grid

writeFunctionXdmf_DGP1Lagrange(ar, u, tCount=0, init=True, dofMap=None)[source]
writeFunctionXdmf_DGP2Lagrange(ar, u, tCount=0, init=True, dofMap=None)[source]
writeFunctionXdmf_CrouzeixRaviartP1(ar, u, tCount=0, init=True, dofMap=None)[source]
writeVectorFunctionXdmf_nodal(ar, uList, components, vectorName, spaceSuffix, tCount=0, init=True)[source]
writeVectorFunctionXdmf_CrouzeixRaviartP1(ar, uList, components, spaceSuffix, tCount=0, init=True)[source]
writeMeshXdmf_MonomialDGPK(ar, mesh, spaceDim, interpolationPoints, t=0.0, init=False, meshChanged=False, arGrid=None, tCount=0)[source]

as a first cut, archive DG monomial spaces using same approach as for element quadrature arrays using x = interpolation points (which are just Gaussian quadrature points) as values

writeFunctionXdmf_MonomialDGPK(ar, interpolationValues, name, tCount=0, init=True, mesh=None)[source]

Different than usual FemFunction Write routines since saves values at interpolation points need to check on way to save dofs as well

writeVectorFunctionXdmf_MonomialDGPK(ar, interpolationValues, name, tCount=0, init=True)[source]

Different than usual FemFunction Write routines since saves values at interpolation points need to check on way to save dofs as well

writeMeshXdmf_DGP0(ar, mesh, spaceDim, t=0.0, init=False, meshChanged=False, arGrid=None, tCount=0)[source]

as a first cut, archive piecewise constant space

writeFunctionXdmf_DGP0(ar, u, tCount=0, init=True)[source]
writeVectorFunctionXdmf_DGP0(ar, uList, components, vectorName, tCount=0, init=True)[source]
writeMeshXdmf_P1Bubble(ar, mesh, spaceDim, dofMap, t=0.0, init=False, meshChanged=False, arGrid=None, tCount=0)[source]

represent P1 bubble space using just vertices for now

writeFunctionXdmf_P1Bubble(ar, u, tCount=0, init=True)[source]
writeFunctionXdmf_C0P2Lagrange(ar, u, tCount=0, init=True)[source]
writeVectorFunctionXdmf_P1Bubble(ar, uList, components, vectorName, spaceSuffix, tCount=0, init=True)[source]
writeMeshXdmf_particles(ar, mesh, spaceDim, x, t=0.0, init=False, meshChanged=False, arGrid=None, tCount=0, spaceSuffix='_particles')[source]

write out arbitrary set of points on a mesh

writeScalarXdmf_particles(ar, u, name, tCount=0, init=True)[source]
writeVectorXdmf_particles(ar, u, name, tCount=0, init=True)[source]
writeMeshXdmf_LowestOrderMixed(ar, mesh, spaceDim, t=0.0, init=False, meshChanged=False, arGrid=None, tCount=0, spaceSuffix='_RT0')[source]
writeVectorFunctionXdmf_LowestOrderMixed(ar, u, tCount=0, init=True, spaceSuffix='_RT0', name='velocity')[source]