Skip to content

Commit

Permalink
fix value extraction
Browse files Browse the repository at this point in the history
see #228
  • Loading branch information
adtzlr committed Aug 3, 2022
1 parent 4445810 commit caf9104
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions felupe/math/_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,8 @@ def extract(field, grad=True, sym=False, add_identity=True):

def values(field):
"Return values of a field or a tuple of fields."

if "mixed" in str(type(field)).lower():
field = field.fields

if isinstance(field, tuple) or isinstance(field, list):
return np.concatenate([f.values.ravel() for f in field])

else:
return field.values.ravel()

return np.concatenate([f.values.ravel() for f in field.fields])


def norm(array):
Expand Down

0 comments on commit caf9104

Please sign in to comment.