SfePy NTC

Table Of Contents

Previous topic

sfepy.discrete.fem.fields_hierarchic module

Next topic

sfepy.discrete.fem.geometry_element module

This Page

sfepy.discrete.fem.fields_nodal module

Notes

Important attributes of continuous (order > 0) Field and SurfaceField instances:

  • vertex_remap : econn[:, :n_vertex] = vertex_remap[conn]
  • vertex_remap_i : conn = vertex_remap_i[econn[:, :n_vertex]]

where conn is the mesh vertex connectivity, econn is the region-local field connectivity.

class sfepy.discrete.fem.fields_nodal.H1DiscontinuousField(name, dtype, shape, region, approx_order=1)[source]
average_to_vertices(dofs)[source]

Average DOFs of the discontinuous field into the field region vertices.

extend_dofs(dofs, fill_value=None)[source]

Extend DOFs to the whole domain using the fill_value, or the smallest value in dofs if fill_value is None.

family_name = 'volume_H1_lagrange_discontinuous'
remove_extra_dofs(dofs)[source]

Remove DOFs defined in higher order nodes (order > 1).

class sfepy.discrete.fem.fields_nodal.H1NodalMixin(**kwargs)[source]
evaluate_at(coors, source_vals, strategy='kdtree', close_limit=0.1, cache=None, ret_cells=False, ret_status=False, ret_ref_coors=False, verbose=True)[source]

Evaluate source DOF values corresponding to the field in the given coordinates using the field interpolation.

Parameters:

coors : array

The coordinates the source values should be interpolated into.

source_vals : array

The source DOF values corresponding to the field.

strategy : str, optional

The strategy for finding the elements that contain the coordinates. Only ‘kdtree’ is supported for the moment.

close_limit : float, optional

The maximum limit distance of a point from the closest element allowed for extrapolation.

cache : Struct, optional

To speed up a sequence of evaluations, the field mesh, the inverse connectivity of the field mesh and the KDTree instance can be cached as cache.mesh, cache.offsets, cache.iconn and cache.kdtree. Optionally, the cache can also contain the reference element coordinates as cache.ref_coors, cache.cells and cache.status, if the evaluation occurs in the same coordinates repeatedly. In that case the KDTree related data are ignored.

ret_cells : bool, optional

If True, return also the cell indices the coordinates are in.

ret_status : bool, optional

If True, return also the status for each point: 0 is success, 1 is extrapolation within close_limit, 2 is extrapolation outside close_limit, 3 is failure.

ret_ref_coors : bool, optional

If True, return also the found reference element coordinates.

verbose : bool

If False, reduce verbosity.

Returns:

vals : array

The interpolated values.

cells : array

The cell indices, if ret_cells or ret_status are True.

status : array

The status, if ret_status is True.

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

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

class sfepy.discrete.fem.fields_nodal.H1NodalSurfaceField(name, dtype, shape, region, approx_order=1)[source]

A field defined on a surface region.

family_name = 'surface_H1_lagrange'
interp_v_vals_to_n_vals(vec)[source]

Interpolate a function defined by vertex DOF values using the FE surface geometry base (P1 or Q1) into the extra nodes, i.e. define the extra DOF values.

class sfepy.discrete.fem.fields_nodal.H1NodalVolumeField(name, dtype, shape, region, approx_order=1)[source]
family_name = 'volume_H1_lagrange'
interp_v_vals_to_n_vals(vec)[source]

Interpolate a function defined by vertex DOF values using the FE geometry base (P1 or Q1) into the extra nodes, i.e. define the extra DOF values.