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

Add diagnostic vars #119

Merged
merged 7 commits into from
Jul 2, 2020
Merged

Add diagnostic vars #119

merged 7 commits into from
Jul 2, 2020

Conversation

amelialdrew
Copy link
Member

Diagnostic Variables work in progress - has a bug at the moment where NUM_DIAGNOSTIC_VARS=0 is not a valid option, code doesn't compile. Pull request created to discuss best solution.

@amelialdrew amelialdrew marked this pull request as ready for review May 4, 2020 10:42
@mirenradia mirenradia added the enhancement Modification of existing feature/general improvement label May 7, 2020
@mirenradia
Copy link
Member

This resolves #88.

@mirenradia mirenradia force-pushed the enhancement/diagnostic_split branch 2 times, most recently from d73c765 to f770f7a Compare May 11, 2020 15:01
@mirenradia mirenradia changed the title Enhancement/diagnostic split Add diagnostic vars May 11, 2020
mirenradia added a commit that referenced this pull request May 26, 2020
This resolves #118.
* The enum and name definitions of the common CCZ4 variables in
the provided examples have been moved into a common
CCZ4UserVariables.hpp file.
* The type of UserVariables::variable_names has been changed to a more
modern C++ type of std::array<std::string, NUM_VARS>. Note that this is
now const rather than constexpr but I don't think this is an issue.
* A new variable_name_to_enum function which only work with the above
type for variable_names has been defined in the UserVariables namespace
in a new UserVariables.inc.hpp. Since switching to this
will break users' other examples which don't include this file yet, the
old variable_name_to_enum has been temporarily retained in
ChomboParameters. It should be removed in #119.
* A new template function to concatenate std::arrays is defined in a new
ArrayTools namespace (this really ought to be in the standard library)
which is used to concatenate the CCZ4 variable names array with the user
one.
mirenradia added a commit that referenced this pull request May 26, 2020
This resolves #118.
* The enum and name definitions of the common CCZ4 variables in
the provided examples have been moved into a common
CCZ4UserVariables.hpp file.
* The type of UserVariables::variable_names has been changed to a more
modern C++ type of std::array<std::string, NUM_VARS>. Note that this is
now const rather than constexpr but I don't think this is an issue.
* A new variable_name_to_enum function which only work with the above
type for variable_names has been defined in the UserVariables namespace
in a new UserVariables.inc.hpp. Since switching to this
will break users' other examples which don't include this file yet, the
old variable_name_to_enum has been temporarily retained in
ChomboParameters. It should be removed in #119.
* A new template function to concatenate std::arrays is defined in a new
ArrayTools namespace (this really ought to be in the standard library)
which is used to concatenate the CCZ4 variable names array with the user
one.
Amelia Drew and others added 2 commits June 24, 2020 12:59
This guards many calls to m_state_diagnostics in GRAMRLevel with
if (NUM_DIAGNOSTIC_VARS > 0)
@mirenradia mirenradia force-pushed the enhancement/diagnostic_split branch from f770f7a to ef4ae0a Compare June 24, 2020 12:09
This is done by passing the appropriate argument when calling
interpolationQuery::add_comp.

Some other changes:
* Remove deprecated ChomboParameter::variable_name_to_enum.
* Add new DiagnosticVariables::variable_name_to_enum.
* Add VariableType enum class.
* Remove virtual GRAMRLevel::specificWritePlotHeader since vars in plot
files are controlled by a parameter.
* Add selection of diagnostic variables to be in plot files (as for
normal evolution variables) rather than having all of them.
@KAClough
Copy link
Member

Looks great!

As discussed, we need to remove specificWritePlotHeader from GRAMRLevel (and AMRLevel?) and we can move Ham and Mom to diagnostics. Apart from this I am happy.

@KAClough KAClough linked an issue Jul 2, 2020 that may be closed by this pull request
Also remove deprecated GRAMRLevel::specificWritePlotHeader
@mirenradia mirenradia force-pushed the enhancement/diagnostic_split branch from de0f7b3 to 222e051 Compare July 2, 2020 16:14
The wiki page is a guide on how to update old examples to be compatible
with the diagnostic variables changes.
GCC v5 is a little bit more fussy when it comes to implicitly
constructing std::tuples. This looks related to
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4387.html
which was applied in GCC v6.1.
@mirenradia mirenradia force-pushed the enhancement/diagnostic_split branch from 104cee9 to 2a2ad1f Compare July 2, 2020 19:08
@KAClough
Copy link
Member

KAClough commented Jul 2, 2020

This all seems to work fine in the SF example and the wiki page looks good. Sorry to everyone for breaking code, but this is a major performance enhancement, so it will be worth it!

@KAClough KAClough merged commit ffa4bbb into master Jul 2, 2020
@KAClough KAClough deleted the enhancement/diagnostic_split branch July 2, 2020 20:54
KAClough pushed a commit to KAClough/GRChombo_public that referenced this pull request Jul 9, 2020
This resolves GRTLCollaboration#118.
* The enum and name definitions of the common CCZ4 variables in
the provided examples have been moved into a common
CCZ4UserVariables.hpp file.
* The type of UserVariables::variable_names has been changed to a more
modern C++ type of std::array<std::string, NUM_VARS>. Note that this is
now const rather than constexpr but I don't think this is an issue.
* A new variable_name_to_enum function which only work with the above
type for variable_names has been defined in the UserVariables namespace
in a new UserVariables.inc.hpp. Since switching to this
will break users' other examples which don't include this file yet, the
old variable_name_to_enum has been temporarily retained in
ChomboParameters. It should be removed in GRTLCollaboration#119.
* A new template function to concatenate std::arrays is defined in a new
ArrayTools namespace (this really ought to be in the standard library)
which is used to concatenate the CCZ4 variable names array with the user
one.
tamaraevst pushed a commit to tamaraevst/GRChombo that referenced this pull request Dec 2, 2021
This is the same as GRTLCollaboration#124
* The enum and name definitions of the common CCZ4 variables in
the provided examples have been moved into a common
CCZ4UserVariables.hpp file.
* The type of UserVariables::variable_names has been changed to a more
modern C++ type of std::array<std::string, NUM_VARS>. Note that this is
now const rather than constexpr but I don't think this is an issue.
* A new variable_name_to_enum function which only work with the above
type for variable_names has been defined in the UserVariables namespace
in a new UserVariables.inc.hpp. Since switching to this
will break users' other examples which don't include this file yet, the
old variable_name_to_enum has been temporarily retained in
ChomboParameters. It should be removed in GRTLCollaboration#119.
* A new template function to concatenate std::arrays is defined in a new
ArrayTools namespace (this really ought to be in the standard library)
which is used to concatenate the CCZ4 variable names array with the user
one.
mirenradia added a commit to mirenradia/GRChombo-public that referenced this pull request Feb 3, 2023
This resolves GRTLCollaboration#118.
* The enum and name definitions of the common CCZ4 variables in
the provided examples have been moved into a common
CCZ4UserVariables.hpp file.
* The type of UserVariables::variable_names has been changed to a more
modern C++ type of std::array<std::string, NUM_VARS>. Note that this is
now const rather than constexpr but I don't think this is an issue.
* A new variable_name_to_enum function which only work with the above
type for variable_names has been defined in the UserVariables namespace
in a new UserVariables.inc.hpp. Since switching to this
will break users' other examples which don't include this file yet, the
old variable_name_to_enum has been temporarily retained in
ChomboParameters. It should be removed in GRTLCollaboration#119.
* A new template function to concatenate std::arrays is defined in a new
ArrayTools namespace (this really ought to be in the standard library)
which is used to concatenate the CCZ4 variable names array with the user
one.
mirenradia pushed a commit to mirenradia/GRChombo-public that referenced this pull request Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Modification of existing feature/general improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Diagnostic Variables Code
3 participants