CartesianMesh

class pysit.core.mesh.CartesianMesh(domain, *args)[source]

Bases: pysit.core.mesh.StructuredMesh

Specification of Cartesian meshses in PySIT.

Attributes Summary

deltas Tuple of grid deltas
type

Methods Summary

dof([include_bc]) Return the number of degrees of freedom.
get_deltas() Returns the mesh deltas as a dim-tuple.
inner_product(arg1, arg2) Compute the correct scaled inner product on the mesh.
mesh_coords([sparse, include_bc]) A stand-in for meshgrid.
nodes([include_bc]) An NxD array of node locations, optionally include nodes for the boundary padding.
pad_array(in_array[, out_array, padding_mode]) Returns a version of in_array, padded to add nodes from the boundary conditions or ghost nodes.
shape([include_bc, as_grid]) Return the shape, the number of nodes in each dimension.
unpad_array(in_array[, copy]) Returns a view of in_array, unpadded to the primary or boundary-condition- or ghost-node-free shape.

Attributes Documentation

deltas

Tuple of grid deltas

type[source]

Methods Documentation

dof(include_bc=False)[source]

Return the number of degrees of freedom.

Parameters :

include_bc : boolean

Include the ghost/boundary condition nodes in the count.

get_deltas()[source]

Returns the mesh deltas as a dim-tuple.

Shortcut for self.collect(‘delta’)

inner_product(arg1, arg2)[source]

Compute the correct scaled inner product on the mesh.

mesh_coords(sparse=False, include_bc=False)[source]

A stand-in for meshgrid.

Parameters :

sparse : boolean

Returns a list of [X, [Y]], Z locations but not for each grid point.

include_bc : boolean

Optionally include phyiscal locations of ghost/boundary points.

nodes(include_bc=False)[source]

An NxD array of node locations, optionally include nodes for the boundary padding.

pad_array(in_array, out_array=None, padding_mode=None)[source]

Returns a version of in_array, padded to add nodes from the boundary conditions or ghost nodes.

Parameters :

in_array : ndarray

Input array

out_array : ndarray, optional

If specifed, pad into a pre-allocated array

padding_mode : string

Padding mode option for numpy.pad.

shape(include_bc=False, as_grid=False)[source]

Return the shape, the number of nodes in each dimension.

Parameters :

include_bc : boolean

Include the ghost/boundary condition nodes in the shape

as_grid : boolean

If true, returns the D-dimensional shape, if false, returns the “vectorized” shape.

unpad_array(in_array, copy=False)[source]

Returns a view of in_array, unpadded to the primary or boundary-condition- or ghost-node-free shape.

Parameters :

in_array : ndarray

Input array

copy : boolean

Return a copy of the unpadded array

Previous topic

equispaced_acquisition

Next topic

DerivativeGaussianPulse

This Page