Mesh data

Data can be attached to any type implementing the Domain trait. In particular, it is common to attach data to geometries of a mesh.

Meshes.MeshDataType
MeshData(domain, values)

A domain together with a dictionary of data values. For each rank r (or parametric dimension) there can exist a corresponding Tables.jl table values[r]. The helper function meshdata is recommended instead of the raw constructor of the type.

Meshes.meshdataFunction
meshdata(domain, values)

Create spatial data from a domain implementing the the Domain trait and a dictionary of data values where values[r] holds a Tables.jl table for the rank r.

Examples

# attach temperature and pressure to grid elements
meshdata(CartesianGrid(10,10),
  Dict(2 => (temperature=rand(100), pressure=rand(100)))
)
meshdata(vertices, elements, values)

Create spatial data from a SimpleMesh with vertices and elements, and a dictionary of data values.

Examples

# vertices and elements
vertices = Point2[(0,0),(1,0),(1,1),(0,1)]
elements = connect.([(1,2,3),(3,4,1)])

# attach data to ranks 0 and 2
meshdata(vertices, elements,
  Dict(
    0 => (temperature=[1.0,2.0,3.0,4.0], pressure=[4.0,3.0,2.0,1.0]),
    2 => (quality=["A","B"], state=[true,false])
  )
)
meshdata(domain; vtable, etable)

Create spatial data from a domain, a table vtable with data for the vertices, and a table etable with data for the elements.

Examples

meshdata(CartesianGrid(10,10),
  etable = (temperature=rand(100), pressure=rand(100))
)
meshdata(vertices, elements; vtable, etable)

Create spatial data from a SimpleMesh with vertices and elements, a table vtable with data for the vertices, and a table etable with data for the elements.

Examples

# vertices and elements
vertices = Point2[(0,0),(1,0),(1,1),(0,1)]
elements = connect.([(1,2,3),(3,4,1)])

# attach data to mesh
meshdata(vertices, elements,
  vtable = (temperature=[1.0,2.0,3.0,4.0], pressure=[4.0,3.0,2.0,1.0]),
  etable = (quality=["A","B"], state=[true,false])
)