Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #19

Open
wants to merge 31 commits into
base: libyt
Choose a base branch
from
Open

Fix #19

wants to merge 31 commits into from

Conversation

cindytsai
Copy link
Collaborator

Fix bugs, Load Active Particles and Derived Fields

Doc

  • Fix the link.
  • Explain the usage of sm,pt2pt.

Bugs

  • Change user-parameter Gamma to gamma, since enzo's yt frontend reads ds.gamma.
  • Fix yt-parameter velocity_unit, magnetic_unit, periodicity.
  • Map EYT_PINT to YT_LONGLONG when -DCONFIG_PINT_8. (Note that in this setting, MPI is mapped to MPI_LONG_LONG_INT.)

Derived Fields

  • Generate derived fields (Temperature, Cooling_Time) and assign them as enzo inline fields. This avoids looking up grid ID when using libyt's generating data from C-function.

Active Particles

  • Load active particles to libyt.
  • When mapping the particle attributes data type to yt datatype, we use the hdf5 data type as an indicator. This avoids including libyt.h in ParticleAttributeHandler.h. And because hdf5 is a mandatory dependency, using hdf5 data type to map to yt data type won't have any conflict.
  • GetParticleAttributeNames, GetParticleAttributes, and GetParticleAttributesHDF5DataType are created in ActiveParticleHelpers namespace. They are used in libyt only. Since the active particle is created via a register_ptype function layer, adding them here will not alter the original behavior of the active particle.
    • GetParticleAttributes allocates a new data buffer and calls GetAttribute to fill in the buffer. These buffers will be freed after libyt is done. Currently, we only get the attributes that have 1 dimension. (Notice that GetAttribute shifts the buffer pointer when returning.)

…n situ.

We need this because libyt does not make a copy of the names.
I don't know why there is two grid showing active particle count = 1.
There should only be one particle in this run, not sure if it overlapped.
It pre-allocates buffers to store a copy of attribute data. They will free them when libyt ends.
…are not correct)

The attributes are put in a new allocated buffer.
It will be freed when in situ analysis are done.
This is caused by GetAttribute _shifts_ the pointer passed in when returning.
src/enzo/CallInSitulibyt.C Outdated Show resolved Hide resolved
@cindytsai
Copy link
Collaborator Author

@matthewturk , I totally forget about this PR.

This PR supports active particles and derived fields (though limited to Temperature and CoolingTime` only) in Enzo and fixes some bugs.

Copy link
Member

@matthewturk matthewturk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor feedback otherwise LGTM

src/enzo/ActiveParticle.h Outdated Show resolved Hide resolved
src/enzo/CallInSitulibyt.C Outdated Show resolved Hide resolved
src/enzo/CallInSitulibyt.C Show resolved Hide resolved
@cindytsai
Copy link
Collaborator Author

@matthewturk I have fixed the issues.

@cindytsai
Copy link
Collaborator Author

I think I should also update the version of libyt in the doc.

@cindytsai
Copy link
Collaborator Author

Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants