sfepy.discrete.iga.fields module

Fields for isogeometric analysis.

class sfepy.discrete.iga.fields.IGField(name, dtype, shape, region, approx_order=None, **kwargs)[source]

Bezier extraction based NURBS field for isogeometric analysis.


The field has to cover the whole IGA domain. The field’s NURBS basis can have higher degree than the domain NURBS basis.


Create the context required for evaluating the field basis.


Create a mesh with the original NURBS connectivity for evaluating the field. The mesh coordinates are the NURBS control points.

create_mapping(region, integral, integration)[source]

Create a new reference mapping.


Create a mesh corresponding to the field region. For IGA fields, this is directly the topological mesh. The extra_nodes argument is ignored.

create_output(dofs, var_name, dof_names=None, key=None, **kwargs)[source]

Convert the DOFs corresponding to the field to a dictionary of output data usable by Mesh.write().

dofs : array, shape (n_nod, n_component)

The array of DOFs reshaped so that each column corresponds to one component.

var_name : str

The variable name corresponding to dofs.

dof_names : tuple of str

The names of DOF components.

key : str, optional

The key to be used in the output dictionary instead of the variable name.

out : dict

The output dictionary.

family_name = ‘volume_H1_iga’
get_data_shape(integral, integration=’volume’, region_name=None)[source]

Get element data dimensions.

integral : Integral instance

The integral describing used numerical quadrature.

integration : ‘volume’

The term integration type. Only ‘volume’ type is implemented.

region_name : str

The name of the region of the integral.

data_shape : 4 ints

The (n_el, n_qp, dim, n_en) for volume shape kind.


  • n_el = number of elements
  • n_qp = number of quadrature points per element/facet
  • dim = spatial dimension
  • n_en = number of element nodes
get_dofs_in_region(region, merge=True)[source]

Return indices of DOFs that belong to the given region and group.


merge is not used.

get_econn(conn_type, region, is_trace=False, integration=None)[source]

Get DOF connectivity of the given type in the given region.


Return True, if the field’s approximation order is greater than one.

set_dofs(fun=0.0, region=None, dpn=None, warn=None)[source]

Set the values of DOFs given by the region using a function of space coordinates or value fun.

If fun is a function, the l2 projection that is global for all region facets is used to set the DOFs.

If dpn > 1, and fun is a function, it has to return the values DOF-by-DOF, i.e. a single one-dimensional vector with all values of the first component, then of the second one etc. concatenated together.

fun : float or array of length dpn or callable

The DOF values.

region : Region

The region containing the DOFs.

dpn : int, optional

The DOF-per-node count. If not given, the number of field components is used.

warn : str, optional

The warning message printed when the region selects no DOFs.

nods : array, shape (n_dof,)

The field DOFs (or node indices) given by the region.

vals : array, shape (dpn, n_dof)

The values of the DOFs, DOF-by-DOF when raveled in C (row-major) order.

setup_extra_data(geometry, info, is_trace)[source]