proteus.Domain module

A class hierarchy and tools for building domains of PDE’s.

Inheritance diagram of proteus.Domain

class proteus.Domain.D_base(nd, name='defaultDomain', units='m')[source]

Bases: object

The base class for domains

Set dimensions (nd), name string, and units string

isOnLine(pointA, pointB, testPoint)[source]
getMesh2ModelClassification(mesh)[source]
writeAsymptote(fileprefix)[source]

Write a representation of the domain to file using the Asymptote vector graphics language.

writeXdmf(ar)[source]

Store the domain in an Xdmf file.

getBoundingBox()[source]

Get the bounding box of a set of vertices.

writeGeo(fileprefix, group_names=False, he_max=None)[source]

Writes a Gmsh .geo file based on the geometrical information of the Domain.

Parameters
  • fileprefix (str) – Name of the file to save (prefix without .geo)

  • group_names (Optional[bool]) – True to write name of physical groups in .geo (default: False)

  • he_max (Optional[double]) – Size of the maximum characteristic element size. Should be set for meshes using a uniform refinement.

gmsh2proteus(geofile, BC_class)[source]

Populates the boundaryTags and BC dictionaries of the domain by importing tag and flags from .geo file.

Parameters
class proteus.Domain.RectangularDomain(L=[1.0, 1.0, 1.0], x=[0.0, 0.0, 0.0], name='DefaultRectangularDomain', units='m')[source]

Bases: proteus.Domain.D_base

Rectangular domains in 1,2, or 3D specified by the lower left hand corner and dimensions.

Set dimensions (nd), name string, and units string

writePoly(fileprefix)[source]

Write the RectangularDomain using the poly format.

writeAsymptote(fileprefix)[source]

Write the rectangular domain as a box displaying the dimesions and coloring the boundaries according to the boundary flags.

writeXdmf(ar)[source]

Store the domain in an Xdmf file.

proteus.Domain.unitSimplex(nd=2)[source]

Builds a 2 or 3 dimension reference element.

Parameters

nd (int) – The elements dimension (must be 2 or 3)

Return type

reference_element

class proteus.Domain.GMSH_3D_Domain(geofile, he, name='GMSH_Domain', units='m', length_scale=1.0, permute_dims=[0, 1, 2])[source]

Bases: proteus.Domain.D_base

A domain described by a gmsh .geo file

Parameters
  • geofile (str) – The base filename of the main .geo file

  • he (float) – The maximum element diameter (this should go way)

  • name (str) – A name for the domain

  • units (str) – The units of length

Set dimensions (nd), name string, and units string

class proteus.Domain.PlanarStraightLineGraphDomain(fileprefix=None, vertices=None, segments=None, facets=None, holes=None, regions=None, vertexFlags=None, segmentFlags=None, regionFlags=None, regionConstraints=None, bc=None, name='DefaultPSLGDomain', units='m')[source]

Bases: proteus.Domain.D_base

2D domains described by planar straight line graphs.

Construct the PSLG from lists of vertices, segments, etc. If no vertex or segment flags are given, then they are assigned as zero.

update()[source]
getSegmentPartition()[source]
readPoly(fileprefix)[source]

Read in the PSLG using the poly format.

writePoly(fileprefix)[source]

Write the PSLG using the poly format.

writeAsymptote(fileprefix)[source]

Write a representation of the PSLG in the Asymptote vector graphics language

writePLY(fileprefix)[source]

Write the PLC domain in the Stanford PLY format.

writeXdmf(ar)[source]

Store the PSLG domain in an XDMF file. For now we store the information on holes in and Information element.

class proteus.Domain.InterpolatedBathymetryDomain(fileprefix=None, vertices=None, segments=None, holes=None, regions=None, vertexFlags=None, segmentFlags=None, regionFlags=None, name='DefaultInterpolatedBathymetry', units='m', bathy=None, bathyGridDim=None)[source]

Bases: proteus.Domain.PlanarStraightLineGraphDomain

2D domains with an attached bathymetry data set. Meshes are generated by locally refining the PSLG until the interpolation error for a bathymetry point cloud meets a prescribed tolerance.

Intial support measures interpolation error in the \(L_{\infty}\) norm.

Construct the PSLG from lists of vertices, segments, etc. If no vertex or segment flags are given, then they are assigned as zero.

class proteus.Domain.TriangulatedSurfaceDomain(vertices, triangles, name='DefaultTriangulatedSurfaceDomain', units='m')[source]

Bases: proteus.Domain.D_base

3D domains described by closed surfaces made up of triangular facets.

Set dimensions (nd), name string, and units string

readSTL(fileprefix)[source]

Read the triangulated surface from a file in stereo lithography format.

writePoly(fileprefix)[source]

Write the triangulated surface in the poly format

writeAsymptote(fileprefix)[source]

Write the triangulated surface in the Asymptote language.

class proteus.Domain.Mesh2DMDomain(fileprefix)[source]

Bases: proteus.Domain.D_base

2D domains from ADH mesh files

Set dimensions (nd), name string, and units string

class proteus.Domain.Mesh3DMDomain(fileprefix)[source]

Bases: proteus.Domain.D_base

3D domains from ADH mesh files

Set dimensions (nd), name string, and units string

class proteus.Domain.MeshHexDomain(fileprefix)[source]

Bases: proteus.Domain.D_base

3D domains from Hex mesh files

Set dimensions (nd), name string, and units string

class proteus.Domain.MeshTetgenDomain(fileprefix)[source]

Bases: proteus.Domain.D_base

3D domains from tetgen mesh files

Set dimensions (nd), name string, and units string

class proteus.Domain.PUMIDomain(name='PUMIDomain', dim=3, manager=<MeshAdaptPUMI.MeshAdapt.AdaptManager object>)[source]

Bases: proteus.Domain.D_base

3d domains from PUMI mesh files

faceList – defines face classification in simmetrix mesh PUMIMesh – the MeshAdapt object

Set dimensions (nd), name string, and units string

writePoly(name=None)[source]
class proteus.Domain.PiecewiseLinearComplexDomain(fileprefix=None, vertices=None, facets=None, facetHoles=None, holes=None, regions=None, vertexFlags=None, facetFlags=None, regionFlags=None, regionConstraints=None, bc=None, name='PLCDomain', units='m')[source]

Bases: proteus.Domain.D_base

3D domains desribed by closed surfaces made up of general polygonal facets.

Read the PLC domain from lists. If no flags are given, then default flags of 0 are assigned.

update()[source]

Function to call when new vertices are added to the domain

readPoly(fileprefix)[source]

Read in the PLC domain from a file in poly format.

writePoly(fileprefix)[source]

Write the PLC domain in the poly format.

writePLY(fileprefix)[source]

Write the PLC domain in the Stanford PLY format.

writeAsymptote(fileprefix)[source]

Write a representation of the domain in the Asymptote vector graphics language.

writeXdmf(fileprefix)[source]

Store the domain in an Xdmf file.

proteus.Domain.getGmshPhysicalGroups(geofile)[source]