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

Particle masses bugfix #89

Merged
merged 69 commits into from
May 26, 2022
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
f47382f
Adds has_attribute() and has_constant() methods to the Particle and P…
stefanarridge Apr 13, 2021
5efcce4
EnzoMethodPmDeposit treats particle mass as mass always
stefanarridge Apr 13, 2021
1ea6e9c
Changed/ removed comments in EnzoMethodPmDeposit
stefanarridge Apr 28, 2021
b9d7d0c
Changed 'divide by inv_vol' to 'multiply by inv_vol' in EnzoMethodPmD…
stefanarridge Apr 28, 2021
fdedf5e
Changed 'Edited' to '@author'
stefanarridge May 5, 2021
aad8a46
Removes a comment from EnzoMethodPmDeposit
stefanarridge May 18, 2021
a8c5e3d
Merged with main
stefanarridge Jun 2, 2021
c7ff73c
EnzoMethodPmDeposit reports negative densities for rank = 1,2,3, and …
stefanarridge Jun 10, 2021
3df4172
Fixed bug in ParticleDescr is_attribute and is_constant methods
stefanarridge Jun 10, 2021
79963a5
Moved lines of code which calculate the inverse cell volume in EnzoMe…
stefanarridge Jun 10, 2021
0fc15c0
EnzoMethodPmDeposit allocates the pmass array once per particle type …
stefanarridge Jun 10, 2021
39b80f0
In EnzoMethodPmDeposit, the timestep used to advance the gas density …
stefanarridge Jun 23, 2021
cc7a53d
Merge branch 'main' into particle_masses
stefanarridge Jan 24, 2022
af82abf
pm_deposit method treats the gas density field the same as in the mai…
stefanarridge Jan 24, 2022
694100e
Fixed typo in src/Enzo/enzo_EnzoMethodPmDepositDeposit.cpp which prev…
stefanarridge Feb 14, 2022
af96ff2
Merge branch 'main' into particle_masses
stefanarridge Feb 14, 2022
616d3f0
Renamed ParticleDescr::has_constant to ParticleDescr::is_constant and…
stefanarridge Feb 14, 2022
124104f
Simplified ParticleDescr::is_attribute. No longer uses the variable.…
stefanarridge Feb 14, 2022
3a6670c
Simplified ParticleDescr::is_attribute. No longer uses the const vari…
stefanarridge Feb 14, 2022
4f22911
Merge branch 'particle-descr-helper-functions-fix' of github.com:stef…
stefanarridge Feb 15, 2022
0a54a03
Merge branch 'main' into particle_masses
stefanarridge Feb 24, 2022
f287107
Merge branch 'main' into particle-descr-helper-functions-fix
stefanarridge Feb 24, 2022
698d437
Merge branch 'particle-descr-helper-functions-fix' into particle_masses
stefanarridge Feb 24, 2022
53c00f7
Renamed ParticleDescr::is_constant and ParticleDescr::is_attribute fu…
stefanarridge Feb 25, 2022
916625a
pm_deposit method allows particles in the "has_mass" group to have a …
stefanarridge Feb 25, 2022
26272c9
Renamed "has_mass" particle group to "is_gravitating"
stefanarridge Mar 1, 2022
798917a
Added check for whether particle types in "is_gravitating" group have…
stefanarridge Mar 1, 2022
bd6c90f
Edited parameter files to change "mass" attributes / constants to "de…
stefanarridge Mar 1, 2022
0df1737
Fixed mistake in ASSERT call in constructor of EnzoMethodPmDeposit, w…
stefanarridge Mar 1, 2022
1ab275a
Removed input/MergeStars/merge_stars_test.in
stefanarridge Mar 1, 2022
3e3b63b
Removed star particles from "is_gravitating" group in input/MergeStar…
stefanarridge Mar 1, 2022
bfcd977
Changed "mass" to "is_gravitating" in preamble of src/Enzo/enzo_EnzoM…
stefanarridge Mar 2, 2022
6145676
pm_deposit method pre-computes a "density scale factor", equal to 2^(…
stefanarridge Mar 2, 2022
2878937
Cleaned up src/Enzo/enzo_EnzoMethodPmDeposit.cpp
stefanarridge Mar 2, 2022
0e859f0
Added check for whether star particles exist and whether they have a …
stefanarridge Mar 3, 2022
a213537
Added check for whether star particles exist and whether they have a …
stefanarridge Mar 3, 2022
d4af1e8
Added check for whether star particles exist and whether they have a …
stefanarridge Mar 3, 2022
c09ea84
Renamed "particle with mass" to "gravitating particles" and "num_mass…
stefanarridge Mar 3, 2022
27d8c37
Added check for whether star particles exist and whether they have a …
stefanarridge Mar 4, 2022
cdc4c95
Added check for whether star particles exist and whether they have a …
stefanarridge Mar 4, 2022
917ef3f
Added check for whether star particles exist and whether they have a …
stefanarridge Mar 4, 2022
807fa89
Added check for whether star particles exist and whether they have a …
stefanarridge Mar 4, 2022
95c26f9
Added check for whether star particles exist and whether they have a …
stefanarridge Mar 4, 2022
616cbef
Updated user guide for pm_deposit, pm_update, and merge_stars methods.
stefanarridge Mar 8, 2022
e0fe776
Updated reference guide for merge_stars_test initializer.
stefanarridge Mar 8, 2022
089cbd8
Update src/Enzo/enzo_EnzoMethodStarMaker.cpp - remove whitespace in l…
stefanarridge Apr 5, 2022
43d8b60
Update src/Cello/data_Particle.hpp - removed whitespace in line 129
stefanarridge Apr 5, 2022
c5d0d44
Update src/Enzo/enzo_EnzoMethodPmDeposit.cpp - removed whitespace in …
stefanarridge Apr 5, 2022
023f925
Update src/Enzo/enzo_EnzoMethodPmDeposit.cpp - removed whitespace in …
stefanarridge Apr 5, 2022
ba65b19
Update src/Enzo/enzo_EnzoMethodPmDeposit.cpp - remove whitespace in l…
stefanarridge Apr 5, 2022
6d2f6ae
Update src/Enzo/enzo_EnzoMethodPmDeposit.cpp - remove whitepace in li…
stefanarridge Apr 5, 2022
de8db5e
Update src/Enzo/enzo_EnzoMethodPmDeposit.cpp - removed whitespace in …
stefanarridge Apr 5, 2022
ba089f9
Update src/Enzo/enzo_EnzoMethodPmDeposit.cpp - removed whitespace in …
stefanarridge Apr 5, 2022
a660481
Update src/Enzo/enzo_EnzoMethodPmDeposit.cpp - removed whitespace in …
stefanarridge Apr 5, 2022
232532e
Update src/Enzo/enzo_EnzoMethodPmDeposit.cpp - removed whitespace in …
stefanarridge Apr 5, 2022
3fbe230
Update src/Enzo/enzo_EnzoMethodPmDeposit.cpp - removed whitespace in …
stefanarridge Apr 5, 2022
6b7af1b
Update src/Enzo/enzo_EnzoMethodPmDeposit.cpp - removed whitespace in …
stefanarridge Apr 5, 2022
95e487c
Update src/Enzo/enzo_EnzoMethodPmDeposit.cpp -fixed indentation on li…
stefanarridge Apr 5, 2022
86c6658
Update src/Enzo/enzo_EnzoMethodPmDeposit.cpp - removed whitespace on …
stefanarridge Apr 5, 2022
8b16384
Update src/Enzo/enzo_EnzoMethodPmDeposit.cpp - removed whitespace in …
stefanarridge Apr 5, 2022
0e4737e
Update src/Enzo/enzo_EnzoMethodPmDeposit.cpp - removed whitespace in …
stefanarridge Apr 5, 2022
1405739
Update src/Enzo/enzo_EnzoMethodPmDeposit.cpp - removed whitespace in …
stefanarridge Apr 5, 2022
76cef5d
Added check_particle_attribute to enzo namespace, which takes the nam…
stefanarridge Apr 6, 2022
33b4dee
Changed EnzoMethodPmDeposit::compute so that it uses the WARNING2 mac…
stefanarridge Apr 6, 2022
1296b65
Moved "check_particle_attribute" from the enzo namespace to a member …
stefanarridge Apr 13, 2022
af6e42f
The ".libconfig" and ".parameters" output files now always contain a …
stefanarridge May 11, 2022
06f4fe8
Updated "pm_deposit" method to remove the option for particles to hav…
stefanarridge May 12, 2022
2ff1cdf
Edited input/Cosmology/method_cosmology.incl, so that the particles h…
stefanarridge May 12, 2022
41bd6e0
Updated documention.
stefanarridge May 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/Cello/data_Particle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class Particle {
{ return particle_descr_->num_attributes(it); }

/// Check if attribute exists

stefanarridge marked this conversation as resolved.
Show resolved Hide resolved
bool is_attribute (int it, std::string attribute) const
{ return particle_descr_->is_attribute(it,attribute); }

Expand Down Expand Up @@ -204,9 +204,8 @@ class Particle {

/// Check if given constant exists

bool has_constant(int it, std::string constant) const
{ return particle_descr_->has_constant(it,constant); }

bool is_constant(int it, std::string constant) const
{ return particle_descr_->is_constant(it,constant); }

//--------------------------------------------------
// BYTES
Expand Down
17 changes: 9 additions & 8 deletions src/Cello/data_ParticleDescr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,10 @@ int ParticleDescr::attribute_index (int it, std::string attribute_name) const
bool ParticleDescr::is_attribute(int it, std::string attribute_name) const
{
ASSERT1("ParticleDescr::is_attribute",
Copy link
Contributor

@jwise77 jwise77 May 21, 2021

Choose a reason for hiding this comment

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

Mismatch, but I'd just go with is_attribute to be consistent with #49

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I named has_attribute as such to maintain consistency with the has_constant method. I have now decided to name the methods 'is_attribute' and 'is_constant' instead.

"Trying to access unknown particle type %d",
it,
(0 <= it && it < num_types()));

"Trying to access unknown particle type '%s'",
type_name(it).c_str(),
mabruzzo marked this conversation as resolved.
Show resolved Hide resolved
(0 <= it && it < num_types()));
auto iter=attribute_index_[it].find(attribute_name);

int index = (iter != attribute_index_[it].end()) ? iter->second : -1;
Expand All @@ -268,6 +268,7 @@ bool ParticleDescr::is_attribute(int it, std::string attribute_name) const

return !((index == -1) && (count[cello::index_static()]++ < 10));
}

//----------------------------------------------------------------------

std::string ParticleDescr::attribute_name (int it, int ia) const
Expand Down Expand Up @@ -409,12 +410,12 @@ int ParticleDescr::constant_offset (int it, int ic) const

//----------------------------------------------------------------------

bool ParticleDescr::has_constant(int it, std::string constant_name) const
bool ParticleDescr::is_constant(int it, std::string constant_name) const
{
ASSERT1("ParticleDescr::constant_index",
"Trying to access unknown particle type %d",
it,
(0 <= it && it < num_types()));
"Trying to access unknown particle type '%s'",
mabruzzo marked this conversation as resolved.
Show resolved Hide resolved
type_name(it).c_str(),
(0 <= it && it < num_types()));

auto iter=constant_index_[it].find(constant_name);

Expand Down
3 changes: 1 addition & 2 deletions src/Cello/data_ParticleDescr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ class ParticleDescr {
char * constant_value (int it, int ic);

/// Check if given constant exists for the given particle type

bool has_constant (int it, std::string constant) const;
bool is_constant (int it, std::string constant) const;

//--------------------------------------------------
// ATTRIBUTES
Expand Down
Loading