Skip to content
This repository has been archived by the owner on May 23, 2022. It is now read-only.

Commit

Permalink
Passive Tracers can now track swarm fields. This should allow trackin…
Browse files Browse the repository at this point in the history
…g material indices among other things
  • Loading branch information
rbeucher committed Jul 12, 2020
1 parent 308d46d commit 7cfbb4a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions UWGeodynamics/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from UWGeodynamics import dimensionalise
from UWGeodynamics import UnitRegistry as u
from .Underworld_extended._utils import _swarmvarschema
from .Underworld_extended import Swarm
from .Underworld_extended import Swarm, SwarmVariable
from scipy import spatial
from mpi4py import MPI as _MPI

Expand Down Expand Up @@ -172,7 +172,11 @@ def save(self, outputDir, checkpointID, time):

obj = getattr(self, name)
if not field["timeIntegration"]:
obj.data[...] = field["value"].evaluate(self)
if not isinstance(field["value"], SwarmVariable):
obj.data[...] = field["value"].evaluate(self)
else:
obj.data[...] = field["value"].evaluate(self.data)

handle = obj.save('%s.h5' % file_prefix, units=field["units"])

if rank == 0:
Expand Down

0 comments on commit 7cfbb4a

Please sign in to comment.