Skip to content

Commit

Permalink
field integration: fix field-trimming for plane strain
Browse files Browse the repository at this point in the history
fixes #259
  • Loading branch information
adtzlr committed Aug 19, 2022
1 parent 254b5f6 commit 9e7b291
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions felupe/_assembly/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,15 @@ def integrate(self, parallel=False, jit=False):
dV = self.dV
fun = self.fun

if len(fun) > v.dim:
fun = fun[tuple([slice(v.dim)] * (len(fun.shape) - 2))]
# plane strain
# trim 3d vector-valued functions to the dimension of the field
function_dimension = len(fun.shape) - 2
function_is_vector = function_dimension >= 1
function_is_3d = len(fun) == 3
field_is_2d = v.dim == 2

if function_is_vector and function_is_3d and field_is_2d:
fun = fun[tuple([slice(2)] * function_dimension)]

if parallel:
einsum = einsumt
Expand Down

0 comments on commit 9e7b291

Please sign in to comment.