Field#
A field container with pre-defined fields are created with:
- class felupe.FieldsMixed(region, n=3, values=(0, 0, 1, 0), axisymmetric=False, planestrain=False, offset=0, npoints=None, mesh=None, **kwargs)[source]#
A mixed field based on a region and returns a
FieldContainer
instance.- copy()#
Return a copy of the field.
- extract(grad=True, sym=False, add_identity=True)#
Generalized extraction method which evaluates either the gradient or the field values at the integration points of all cells in the region. Optionally, the symmetric part of the gradient is evaluated and/or the identity matrix is added to the gradient.
- Parameters:
grad (bool, optional (default is True)) – Flag for gradient evaluation.
sym (bool, optional (default is False)) – Flag for symmetric part if the gradient is evaluated.
add_identity (bool, optional (default is True)) – Flag for the addition of the identity matrix if the gradient is evaluated.
- Returns:
(Symmetric) gradient or interpolated field values evaluated at the integration points of each cell in the region.
- Return type:
array
- link(other_field)#
Link value array of other field.
- values()#
Return the field values.
A Field-container holds one or more fields.
- class felupe.FieldContainer(fields)[source]#
A container for fields based on a list or tuple of
Field
instances.- extract(grad=True, sym=False, add_identity=True)[source]#
Generalized extraction method which evaluates either the gradient or the field values at the integration points of all cells in the region. Optionally, the symmetric part of the gradient is evaluated and/or the identity matrix is added to the gradient.
- Parameters:
grad (bool, optional (default is True)) – Flag for gradient evaluation.
sym (bool, optional (default is False)) – Flag for symmetric part if the gradient is evaluated.
add_identity (bool, optional (default is True)) – Flag for the addition of the identity matrix if the gradient is evaluated.
- Returns:
(Symmetric) gradient or interpolated field values evaluated at the integration points of each cell in the region.
- Return type:
array
Available kinds of fields:
- class felupe.Field(region, dim=1, values=0, **kwargs)[source]#
A Field on points of a region with dimension dim and initial point values. A slice of this field directly accesses the field values as 1d-array.
The interpolation method returns the field values evaluated at the numeric integration points
p
of all cellsc
in the region.\[u^i_{(pc)} = \hat{u}_a^i h_{a(pc)}\]The gradient method returns the gradient of the field values w.r.t. the undeformed mesh point coordinates, evaluated at the integration points of all cells in the region.
\[\left( \frac{\partial u^i}{\partial X^J} \right)_{(pc)} = \hat{u}^i_{a(pc)} \left( \frac{\partial h_a}{\partial X^J} \right)_{(pc)}\]- Parameters:
region (Region) – The region on which the field will be created.
dim (int (default is 1)) – The dimension of the field.
values (float (default is 0.0) or array) – A single value for all components of the field or an array of shape (region.mesh.npoints, dim)`.
kwargs (dict, optional) – Optional keyword arguments of the field.
- extract(grad=True, sym=False, add_identity=True)[source]#
Generalized extraction method which evaluates either the gradient or the field values at the integration points of all cells in the region. Optionally, the symmetric part of the gradient is evaluated and/or the identity matrix is added to the gradient.
- Parameters:
grad (bool, optional (default is True)) – Flag for gradient evaluation.
sym (bool, optional (default is False)) – Flag for symmetric part if the gradient is evaluated.
add_identity (bool, optional (default is True)) – Flag for the addition of the identity matrix if the gradient is evaluated.
- Returns:
(Symmetric) gradient or interpolated field values evaluated at the integration points of each cell in the region.
- Return type:
array
- grad(sym=False)[source]#
Gradient as partial derivative of field values at points w.r.t. undeformed coordinates, evaluated at the integration points of all cells in the region. Optionally, the symmetric part of the gradient is evaluated.
- Parameters:
sym (bool, optional (default is False)) – Calculate the symmetric part of the gradient.
- Returns:
Gradient as partial derivative of field values at points w.r.t. undeformed coordinates, evaluated at the integration points of all cells in the region.
- Return type:
array
- class felupe.FieldAxisymmetric(region, dim=2, values=0)[source]#
A axisymmetric Field on points of a two-dimensional region with dimension dim (default is 2) and initial point values (default is 0).
component 1 = axial component
component 2 = radial component
x_2 (radial direction) ^ | _ | / \ --|-----------------> x_1 (axial rotation axis) \_^
This is a modified
Field
class in which the radial coordinates are evaluated at the numeric integration points. Thegrad()
-method is modified in such a way that it does not only contain the in-plane 2d-gradient but also the circumferential stretch as shown in Eq.(1).| dudX(2d) : 0 | dudX(axi) = | ..................| (1) | 0 : u_r/R |
- dim#
The dimension of the field.
- Type:
int (default is 2)
- values#
A single value for all components of the field or an array of shape (region.mesh.npoints, dim)`.
- Type:
float (default is 0.0) or array
- copy()#
Return a copy of the field.
- extract(grad=True, sym=False, add_identity=True)#
Generalized extraction method which evaluates either the gradient or the field values at the integration points of all cells in the region. Optionally, the symmetric part of the gradient is evaluated and/or the identity matrix is added to the gradient.
- Parameters:
grad (bool, optional (default is True)) – Flag for gradient evaluation.
sym (bool, optional (default is False)) – Flag for symmetric part if the gradient is evaluated.
add_identity (bool, optional (default is True)) – Flag for the addition of the identity matrix if the gradient is evaluated.
- Returns:
(Symmetric) gradient or interpolated field values evaluated at the integration points of each cell in the region.
- Return type:
array
- fill(a)#
Fill all field values with a scalar value.
- grad(sym=False)[source]#
3D-gradient as partial derivative of field values at points w.r.t. the undeformed coordinates, evaluated at the integration points of all cells in the region. Optionally, the symmetric part of the gradient is returned.
| dudX(2d) : 0 | dudX(axi) = | ..................| | 0 : u_r/R |
- Parameters:
sym (bool, optional (default is False)) – Calculate the symmetric part of the gradient.
- Returns:
Full 3D-gradient as partial derivative of field values at points w.r.t. undeformed coordinates, evaluated at the integration points of all cells in the region.
- Return type:
array
- class felupe.FieldPlaneStrain(region, dim=2, values=0)[source]#
A plane strain Field on points of a two-dimensional region with dimension dim (default is 2) and initial point values (default is 0).
This is a modified
Field
class in which the radial coordinates are evaluated at the numeric integration points. Thegrad()
-method is modified in such a way that it does not only contain the in-plane 2d-gradient but also the circumferential stretch as shown in Eq.(1).| dudX(2d) : 0 | dudX(planestrain) = | ..................| (1) | 0 : 0 |
- dim#
The dimension of the field.
- Type:
int (default is 2)
- values#
A single value for all components of the field or an array of shape (region.mesh.npoints, dim)`.
- Type:
float (default is 0.0) or array
- copy()#
Return a copy of the field.
- extract(grad=True, sym=False, add_identity=True)#
Generalized extraction method which evaluates either the gradient or the field values at the integration points of all cells in the region. Optionally, the symmetric part of the gradient is evaluated and/or the identity matrix is added to the gradient.
- Parameters:
grad (bool, optional (default is True)) – Flag for gradient evaluation.
sym (bool, optional (default is False)) – Flag for symmetric part if the gradient is evaluated.
add_identity (bool, optional (default is True)) – Flag for the addition of the identity matrix if the gradient is evaluated.
- Returns:
(Symmetric) gradient or interpolated field values evaluated at the integration points of each cell in the region.
- Return type:
array
- fill(a)#
Fill all field values with a scalar value.
- grad(sym=False)[source]#
3D-gradient as partial derivative of field values at points w.r.t. the undeformed coordinates, evaluated at the integration points of all cells in the region. Optionally, the symmetric part of the gradient is returned.
| dudX(2d) : 0 | dudX(planestrain) = | ..................| | 0 : 0 |
- Parameters:
sym (bool, optional (default is False)) – Calculate the symmetric part of the gradient.
- Returns:
Full 3D-gradient as partial derivative of field values at points w.r.t. undeformed coordinates, evaluated at the integration points of all cells in the region.
- Return type:
array