cad.geometry#

Functions#

export_nurbs_to_hdf5(filename, nurbs[, ...])

Export a single-patch igakit NURBS object to a Psydac geometry file in HDF5 format

import_geopdes_to_nurbs(filename)

This function reads a geopdes geometry file and convert it to igakit nurbs object

refine_knots(knots, ncells, degree[, ...])

This function refines the knot sequence.

refine_nurbs(nrb[, ncells, degree, ...])

This function refines the nurbs object.

Classes#

Inheritance diagram of psydac.cad.geometry

Geometry([domain, ncells, periodic, ...])

Distributed discrete geometry that works for single and multiple patches.

Details#

class Geometry(domain=None, ncells=None, periodic=None, mappings=None, filename=None, comm=None, mpi_dims_mask=None)[source]#

Bases: object

Distributed discrete geometry that works for single and multiple patches. The Geometry object can be created in two ways: - case 1 : through a geometry file whos name can be given to the constructor - case 2 : provide the ncells, the periodicity and the mapping objects of each patch.

Parameters:
domainSympde.topology.Domain

The symbolic domain to be discretized.

ncellslist | tuple | dict

The number of cells of the discretized topological domain in each direction.

periodiclist | tuple | dict

The periodicity of the topological domain in each direction.

mappingsdict

The Mapping of each patch.

filename: str

The path to the geometry file.

comm: MPI.Comm

MPI intra-communicator.

mpi_dims_mask: list of bool

True if the dimension is to be used in the domain decomposition (=default for each dimension). If mpi_dims_mask[i]=False, the i-th dimension will not be decomposed.

classmethod from_discrete_mapping(mapping, comm=None, name=None)[source]#

Create a geometry from one discrete mapping.

Parameters:
mappingSplineMapping

The Mapping from the unit square to the physical domain.

commMPI.Comm

MPI intra-communicator.

namestring

Optional name for the Mapping that will be created. Needed to avoid conflicts in case several mappings are created

classmethod from_topological_domain(domain, ncells, *, periodic=None, comm=None, mpi_dims_mask=None)[source]#
property ldim#
property pdim#
property ncells#
property periodic#
property comm#
property domain#
property ddm#
property is_parallel#
property mappings#
read(filename, comm=None)[source]#
export(filename)[source]#
Parameters:
filenamestr

Name of HDF5 output file.

export_nurbs_to_hdf5(filename, nurbs, periodic=None, comm=None)[source]#

Export a single-patch igakit NURBS object to a Psydac geometry file in HDF5 format

Parameters:
filename<str>

Name of output geometry file, e.g. ‘geo.h5’

nurbs<igakit.nurbs.NURBS>

igakit geometry nurbs object

comm<MPI.COMM>

mpi communicator

refine_nurbs(nrb, ncells=None, degree=None, multiplicity=None, tol=1e-09)[source]#

This function refines the nurbs object. It contructs a new grid based on the new number of cells, and it adds the new break points to the nrb grid, such that the total number of cells is equal to the new number of cells. We use knot insertion to construct the new knot sequence , so the geometry is identical to the previous one. It also elevates the degree of the nrb object based on the new degree.

Parameters:
nrb<igakit.nurbs.NURBS>

geometry nurbs object

ncells<list>

total number of cells in each direction

degree<list>

degree in each direction

multiplicity<list>

multiplicity of each knot in the knot sequence in each direction

tol<float>

Minimum distance between two break points.

Returns:
nrb<igakit.nurbs.NURBS>

the refined geometry nurbs object

refine_knots(knots, ncells, degree, multiplicity=None, tol=1e-09)[source]#

This function refines the knot sequence. It contructs a new grid based on the new number of cells, and it adds the new break points to the nrb grid, such that the total number of cells is equal to the new number of cells. We use knot insertion to construct the new knot sequence , so the geometry is identical to the previous one. It also elevates the degree of the nrb object based on the new degree.

Parameters:
knots<list>

list of knot sequences in each direction

ncells<list>

total number of cells in each direction

degree<list>

degree in each direction

multiplicity<list>

multiplicity of each knot in the knot sequence in each direction

tol<float>

Minimum distance between two break points.

Returns:
knots<list>

the refined knot sequences in each direction

import_geopdes_to_nurbs(filename)[source]#

This function reads a geopdes geometry file and convert it to igakit nurbs object

Parameters:
filename<str>

the filename of the geometry file

Returns:
nrb<igakit.nurbs.NURBS>

the geometry nurbs object