GRTLCollaboration / GRTeclyn

Port of GRChombo to AMReX - under development!
BSD 3-Clause "New" or "Revised" License
4 stars 2 forks source link

Refactor derived variables #63

Open mirenradia opened 1 month ago

mirenradia commented 1 month ago

This PR resolves #41 by moving the variable setup and derive() function into the specific level class (well just BinaryBHLevel for now) rather than GRAMRLevel.

It also does the following

I still need to make some changes to resolve some of the clang-tidy warnings but, given the size of this PR, I thought I would create it now so that you can start reviewing next week, @julianakwan.

github-actions[bot] commented 1 month ago

Cpp-Linter Report :warning:

Some files did not pass the configured checks!

clang-tidy reports: 239 concern(s) - **Examples/KerrBH/KerrBHLevel.cpp:7:10:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > 'BoxLoops.hpp' file not found ```cpp 7 | #include "BoxLoops.hpp" | ^~~~~~~~~~~~~~ ``` - **Examples/KerrBH/KerrBHLevel.cpp:12:1:** warning: [[readability-duplicate-include](https://clang.llvm.org/extra/clang-tidy/checks/readability/duplicate-include.html)] > duplicate include ```cpp 11 | #include "Constraints.hpp" | 12 | #include "KerrBHLevel.hpp" | ^~~~~~~~~~~~~~~~~~~~~~~~~~ ``` - **Examples/KerrBH/KerrBHLevel.cpp:53:19:** warning: [[readability-convert-member-functions-to-static](https://clang.llvm.org/extra/clang-tidy/checks/readability/convert-member-functions-to-static.html)] > method 'specificEvalRHS' can be made static ```cpp 53 | void KerrBHLevel::specificEvalRHS(GRLevelData &a_soln, GRLevelData &a_rhs, | ^ | static ``` - **Examples/KerrBH/KerrBHLevel.cpp:53:35:** warning: [[bugprone-easily-swappable-parameters](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/easily-swappable-parameters.html)] > 2 adjacent parameters of 'specificEvalRHS' of similar type ('int &') are easily swapped by mistake ```cpp 53 | void KerrBHLevel::specificEvalRHS(GRLevelData &a_soln, GRLevelData &a_rhs, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Examples/KerrBH/KerrBHLevel.cpp:53:48: note: the first parameter in the range is 'a_soln' 53 | void KerrBHLevel::specificEvalRHS(GRLevelData &a_soln, GRLevelData &a_rhs, | ^~~~~~ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Examples/KerrBH/KerrBHLevel.cpp:53:69: note: the last parameter in the range is 'a_rhs' 53 | void KerrBHLevel::specificEvalRHS(GRLevelData &a_soln, GRLevelData &a_rhs, | ^~~~~ ``` - **Examples/KerrBH/KerrBHLevel.cpp:62:5:** warning: [[bugprone-branch-clone](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/branch-clone.html)] > repeated branch body in conditional chain ```cpp 62 | { | ^ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Examples/KerrBH/KerrBHLevel.cpp:66:6: note: end of the original 66 | } | ^ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Examples/KerrBH/KerrBHLevel.cpp:68:5: note: clone 1 starts here 68 | { | ^ ``` - **Examples/KerrBH/KerrBHLevel.cpp:76:37:** warning: [[bugprone-easily-swappable-parameters](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/easily-swappable-parameters.html)] > 2 adjacent parameters of 'specificUpdateODE' of similar type are easily swapped by mistake ```cpp 76 | const GRLevelData &a_rhs, Real a_dt) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Examples/KerrBH/KerrBHLevel.cpp:76:56: note: the first parameter in the range is 'a_rhs' 76 | const GRLevelData &a_rhs, Real a_dt) | ^~~~~ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Examples/KerrBH/KerrBHLevel.cpp:76:68: note: the last parameter in the range is 'a_dt' 76 | const GRLevelData &a_rhs, Real a_dt) | ^~~~ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Examples/KerrBH/KerrBHLevel.cpp:76:63: note: 'const int &' and 'int' parameters accept and bind the same kind of values 76 | const GRLevelData &a_rhs, Real a_dt) | ^ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Examples/KerrBH/KerrBHLevel.hpp:20:18: warning: 'virtual' is redundant since the function is already declared 'override' [cppcoreguidelines-explicit-virtual-functions,modernize-use-override] 20 | virtual void specificAdvance() override; | ~~~~~~~ ^ ``` - **Examples/KerrBH/KerrBHLevel.hpp:23:18:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > 'initialData' marked 'override' but does not override any member functions ```hpp 23 | virtual void initialData() override; | ^ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Examples/KerrBH/KerrBHLevel.hpp:23:18: warning: 'virtual' is redundant since the function is already declared 'override' [cppcoreguidelines-explicit-virtual-functions,modernize-use-override] 23 | virtual void initialData() override; | ~~~~~~~ ^ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Examples/KerrBH/KerrBHLevel.hpp:26:18: warning: 'virtual' is redundant since the function is already declared 'override' [cppcoreguidelines-explicit-virtual-functions,modernize-use-override] 26 | virtual void specificEvalRHS(GRLevelData &a_soln, GRLevelData &a_rhs, | ~~~~~~~ ^ ``` - **Examples/KerrBH/KerrBHLevel.hpp:26:34:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > unknown type name 'GRLevelData' ```hpp 26 | virtual void specificEvalRHS(GRLevelData &a_soln, GRLevelData &a_rhs, | ^ ``` - **Examples/KerrBH/KerrBHLevel.hpp:26:55:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > unknown type name 'GRLevelData' ```hpp 26 | virtual void specificEvalRHS(GRLevelData &a_soln, GRLevelData &a_rhs, | ^ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Examples/KerrBH/KerrBHLevel.hpp:30:18: warning: 'virtual' is redundant since the function is already declared 'override' [cppcoreguidelines-explicit-virtual-functions,modernize-use-override] 30 | virtual void specificUpdateODE(GRLevelData &a_soln, | ~~~~~~~ ^ ``` - **Examples/KerrBH/KerrBHLevel.hpp:30:36:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > unknown type name 'GRLevelData' ```hpp 30 | virtual void specificUpdateODE(GRLevelData &a_soln, | ^ ``` - **Examples/KerrBH/KerrBHLevel.hpp:31:42:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > unknown type name 'GRLevelData' ```hpp 31 | const GRLevelData &a_rhs, | ^ ``` - **Examples/KerrBH/KerrBHLevel.hpp:32:36:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > unknown type name 'Real'; did you mean 'amrex::Real'? ```hpp 32 | Real a_dt) override; | ^~~~ | amrex::Real /home/runner/work/GRTeclyn/GRTeclyn/amrex/Src/Base/AMReX_REAL.H:76:11: note: 'amrex::Real' declared here 76 | using Real = amrex_real; | ^ ``` - **Examples/KerrBH/KerrBHLevel.hpp:35:18:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > 'preTagCells' marked 'override' but does not override any member functions ```hpp 35 | virtual void preTagCells() override; | ^ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Examples/KerrBH/KerrBHLevel.hpp:35:18: warning: 'virtual' is redundant since the function is already declared 'override' [cppcoreguidelines-explicit-virtual-functions,modernize-use-override] 35 | virtual void preTagCells() override; | ~~~~~~~ ^ ``` - **Examples/KerrBH/KerrBHLevel.hpp:38:5:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > 'computeTaggingCriterion' marked 'override' but does not override any member functions ```hpp 38 | computeTaggingCriterion(FArrayBox &tagging_criterion, | ^ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Examples/KerrBH/KerrBHLevel.hpp:38:5: warning: 'virtual' is redundant since the function is already declared 'override' [cppcoreguidelines-explicit-virtual-functions,modernize-use-override] 37 | virtual void | ~~~~~~~ 38 | computeTaggingCriterion(FArrayBox &tagging_criterion, | ^ ``` - **Examples/KerrBH/KerrBHLevel.hpp:38:29:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > unknown type name 'FArrayBox'; did you mean 'amrex::FArrayBox'? ```hpp 38 | computeTaggingCriterion(FArrayBox &tagging_criterion, | ^~~~~~~~~ | amrex::FArrayBox /home/runner/work/GRTeclyn/GRTeclyn/amrex/Src/AmrCore/AMReX_Interpolater.H:12:7: note: 'amrex::FArrayBox' declared here 12 | class FArrayBox; | ^ ``` - **Examples/KerrBH/KerrBHLevel.hpp:39:35:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > unknown type name 'FArrayBox'; did you mean 'amrex::FArrayBox'? ```hpp 39 | const FArrayBox ¤t_state) override; | ^~~~~~~~~ | amrex::FArrayBox /home/runner/work/GRTeclyn/GRTeclyn/amrex/Src/AmrCore/AMReX_Interpolater.H:12:7: note: 'amrex::FArrayBox' declared here 12 | class FArrayBox; | ^ ``` - **Examples/ScalarField/InitialScalarData.hpp:11:10:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > 'MatterCCZ4RHS.hpp' file not found ```hpp 11 | #include "MatterCCZ4RHS.hpp" | ^~~~~~~~~~~~~~~~~~~ ``` - **Examples/ScalarField/InitialScalarData.hpp:43:16:** warning: [[readability-identifier-length](https://clang.llvm.org/extra/clang-tidy/checks/readability/identifier-length.html)] > variable name 'rr' is too short, expected at least 3 characters ```hpp 43 | data_t rr = coords.get_radius(); | ^ ``` - **Examples/ScalarField/InitialScalarData.hpp:57:20:** warning: [[cppcoreguidelines-avoid-const-or-ref-data-members](https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/avoid-const-or-ref-data-members.html)] > member 'm_params' of type 'const params_t' is const qualified ```hpp 57 | const params_t m_params; //!< The matter initial condition params | ^ ``` - **Examples/ScalarField/ScalarFieldLevel.cpp:67:24:** warning: [[readability-convert-member-functions-to-static](https://clang.llvm.org/extra/clang-tidy/checks/readability/convert-member-functions-to-static.html)] > method 'specificEvalRHS' can be made static ```cpp 67 | void ScalarFieldLevel::specificEvalRHS(GRLevelData &a_soln, GRLevelData &a_rhs, | ^ | static ``` - **Examples/ScalarField/ScalarFieldLevel.cpp:67:40:** warning: [[bugprone-easily-swappable-parameters](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/easily-swappable-parameters.html)] > 2 adjacent parameters of 'specificEvalRHS' of similar type ('int &') are easily swapped by mistake ```cpp 67 | void ScalarFieldLevel::specificEvalRHS(GRLevelData &a_soln, GRLevelData &a_rhs, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Examples/ScalarField/ScalarFieldLevel.cpp:67:53: note: the first parameter in the range is 'a_soln' 67 | void ScalarFieldLevel::specificEvalRHS(GRLevelData &a_soln, GRLevelData &a_rhs, | ^~~~~~ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Examples/ScalarField/ScalarFieldLevel.cpp:67:74: note: the last parameter in the range is 'a_rhs' 67 | void ScalarFieldLevel::specificEvalRHS(GRLevelData &a_soln, GRLevelData &a_rhs, | ^~~~~ ``` - **Examples/ScalarField/ScalarFieldLevel.cpp:80:5:** warning: [[bugprone-branch-clone](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/branch-clone.html)] > repeated branch body in conditional chain ```cpp 80 | { | ^ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Examples/ScalarField/ScalarFieldLevel.cpp:86:6: note: end of the original 86 | } | ^ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Examples/ScalarField/ScalarFieldLevel.cpp:88:5: note: clone 1 starts here 88 | { | ^ ``` - **Examples/ScalarField/ScalarFieldLevel.cpp:99:42:** warning: [[bugprone-easily-swappable-parameters](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/easily-swappable-parameters.html)] > 2 adjacent parameters of 'specificUpdateODE' of similar type are easily swapped by mistake ```cpp 99 | const GRLevelData &a_rhs, Real a_dt) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Examples/ScalarField/ScalarFieldLevel.cpp:99:61: note: the first parameter in the range is 'a_rhs' 99 | const GRLevelData &a_rhs, Real a_dt) | ^~~~~ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Examples/ScalarField/ScalarFieldLevel.cpp:99:73: note: the last parameter in the range is 'a_dt' 99 | const GRLevelData &a_rhs, Real a_dt) | ^~~~ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Examples/ScalarField/ScalarFieldLevel.cpp:99:68: note: 'const int &' and 'int' parameters accept and bind the same kind of values 99 | const GRLevelData &a_rhs, Real a_dt) | ^ ``` - **Examples/ScalarField/ScalarFieldLevel.hpp:13:10:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > 'ScalarField.hpp' file not found ```hpp 13 | #include "ScalarField.hpp" | ^~~~~~~~~~~~~~~~~ ``` - **Examples/ScalarField/ScalarFieldLevel.hpp:31:5:** warning: [[modernize-use-using](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-using.html)] > use 'using' instead of 'typedef' ```hpp 31 | typedef ScalarField ScalarFieldWithPotential; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | using ScalarFieldWithPotential = int /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Examples/ScalarField/ScalarFieldLevel.hpp:34:18: warning: prefer using 'override' or (rarely) 'final' instead of 'virtual' [cppcoreguidelines-explicit-virtual-functions,modernize-use-override] 34 | virtual void specificAdvance(); | ~~~~~~~ ^ | override /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Examples/ScalarField/ScalarFieldLevel.hpp:48:18: warning: 'virtual' is redundant since the function is already declared 'override' [cppcoreguidelines-explicit-virtual-functions,modernize-use-override] 48 | virtual void preTagCells() override; | ~~~~~~~ ^ ``` - **Source/AMRInterpolator/AMRInterpolator.impl.hpp:7:2:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > "This file should only be included through AMRInterpolator.hpp" ```hpp 7 | #error "This file should only be included through AMRInterpolator.hpp" | ^ ``` - **Source/AMRInterpolator/AMRInterpolator.impl.hpp:19:19:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'AMRInterpolator' ```hpp 19 | const std::string AMRInterpolator::TAG = | ^ ``` - **Source/AMRInterpolator/AMRInterpolator.impl.hpp:24:1:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'AMRInterpolator' ```hpp 24 | AMRInterpolator::AMRInterpolator( | ^ ``` - **Source/AMRInterpolator/AMRInterpolator.impl.hpp:25:11:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > unknown type name 'GRAMR' ```hpp 25 | const GRAMR &gr_amr, | ^ ``` - **Source/AMRInterpolator/AMRInterpolator.impl.hpp:34:1:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'AMRInterpolator' ```hpp 34 | AMRInterpolator::AMRInterpolator( | ^ ``` - **Source/AMRInterpolator/AMRInterpolator.impl.hpp:35:11:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > unknown type name 'GRAMR' ```hpp 35 | const GRAMR &gr_amr, | ^ ``` - **Source/AMRInterpolator/AMRInterpolator.impl.hpp:38:5:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > use of undeclared identifier 'BoundaryConditions' ```hpp 38 | BoundaryConditions::params_t a_bc_params, int verbosity) | ^ ``` - **Source/AMRInterpolator/AMRInterpolator.impl.hpp:50:6:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'AMRInterpolator' ```hpp 50 | void AMRInterpolator::refresh(const bool a_fill_ghosts) | ^ ``` - **Source/AMRInterpolator/AMRInterpolator.impl.hpp:97:1:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'AMRInterpolator' ```hpp 97 | AMRInterpolator::get_coarsest_dx() | ^ ``` - **Source/AMRInterpolator/AMRInterpolator.impl.hpp:103:1:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'AMRInterpolator' ```hpp 103 | AMRInterpolator::get_coarsest_origin() | ^ ``` - **Source/AMRInterpolator/AMRInterpolator.impl.hpp:109:6:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'AMRInterpolator' ```hpp 109 | void AMRInterpolator::limit_num_levels(unsigned int num_levels) | ^ ``` - **Source/AMRInterpolator/AMRInterpolator.impl.hpp:134:6:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'AMRInterpolator' ```hpp 134 | void AMRInterpolator::interp(InterpolationQuery &query) | ^ ``` - **Source/AMRInterpolator/AMRInterpolator.impl.hpp:134:42:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > unknown type name 'InterpolationQuery' ```hpp 134 | void AMRInterpolator::interp(InterpolationQuery &query) | ^ ``` - **Source/AMRInterpolator/AMRInterpolator.impl.hpp:203:6:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'AMRInterpolator' ```hpp 203 | void AMRInterpolator::computeLevelLayouts() | ^ ``` - **Source/AMRInterpolator/AMRInterpolator.impl.hpp:288:1:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > unknown type name 'InterpolationLayout' ```hpp 288 | InterpolationLayout | ^ ``` - **Source/AMRInterpolator/AMRInterpolator.impl.hpp:289:1:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'AMRInterpolator' ```hpp 289 | AMRInterpolator::findBoxes(InterpolationQuery &query) | ^ ``` - **Source/AMRInterpolator/AMRInterpolator.impl.hpp:289:40:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > unknown type name 'InterpolationQuery' ```hpp 289 | AMRInterpolator::findBoxes(InterpolationQuery &query) | ^ ``` - **Source/AMRInterpolator/AMRInterpolator.impl.hpp:532:6:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'AMRInterpolator' ```hpp 532 | void AMRInterpolator::prepareMPI(InterpolationQuery &query, | ^ ``` - **Source/AMRInterpolator/AMRInterpolator.impl.hpp:532:46:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > unknown type name 'InterpolationQuery' ```hpp 532 | void AMRInterpolator::prepareMPI(InterpolationQuery &query, | ^ ``` - **Source/AMRInterpolator/InterpolationQuery.hpp:40:9:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > use of undeclared identifier 'AMREX_ASSERT' ```hpp 40 | AMREX_ASSERT(dim < AMREX_SPACEDIM); | ^ ``` - **Source/AMRInterpolator/InterpolationQuery.hpp:50:9:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > use of undeclared identifier 'AMREX_ASSERT' ```hpp 50 | AMREX_ASSERT(out_ptr != NULL || m_num_points == 0); | ^ ``` - **Source/AMRInterpolator/InterpolationQuery.hpp:50:33:** warning: [[modernize-use-nullptr](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-nullptr.html)] > use nullptr ```hpp 50 | AMREX_ASSERT(out_ptr != NULL || m_num_points == 0); | ^~~~ | nullptr ``` - **Source/AMRInterpolator/SurfaceExtraction.impl.hpp:7:2:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > "This file should only be included through SurfaceExtraction.hpp" ```hpp 7 | #error "This file should only be included through SurfaceExtraction.hpp" | ^ ``` - **Source/AMRInterpolator/SurfaceExtraction.impl.hpp:19:1:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'SurfaceExtraction' ```hpp 19 | SurfaceExtraction::SurfaceExtraction( | ^ ``` - **Source/AMRInterpolator/SurfaceExtraction.impl.hpp:20:36:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > unknown type name 'params_t' ```hpp 20 | const SurfaceGeometry &a_geom, params_t a_params, double a_dt, | ^ ``` - **Source/AMRInterpolator/SurfaceExtraction.impl.hpp:80:6:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'SurfaceExtraction' ```hpp 80 | void SurfaceExtraction::add_var(int a_var, | ^ ``` - **Source/AMRInterpolator/SurfaceExtraction.impl.hpp:81:56:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > unknown type name 'VariableType' ```hpp 81 | const VariableType a_var_type, | ^ ``` - **Source/AMRInterpolator/SurfaceExtraction.impl.hpp:82:56:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > unknown type name 'Derivative' ```hpp 82 | const Derivative &a_deriv) | ^ ``` - **Source/AMRInterpolator/SurfaceExtraction.impl.hpp:92:6:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'SurfaceExtraction' ```hpp 92 | void SurfaceExtraction::add_vars( | ^ ``` - **Source/AMRInterpolator/SurfaceExtraction.impl.hpp:93:16:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'vector' in namespace 'std' ```hpp 93 | const std::vector> &a_vars) | ~~~~~^ ``` - **Source/AMRInterpolator/SurfaceExtraction.impl.hpp:93:39:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > use of undeclared identifier 'VariableType' ```hpp 93 | const std::vector> &a_vars) | ^ ``` - **Source/AMRInterpolator/SurfaceExtraction.impl.hpp:103:6:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'SurfaceExtraction' ```hpp 103 | void SurfaceExtraction::add_evolution_vars( | ^ ``` - **Source/AMRInterpolator/SurfaceExtraction.impl.hpp:104:16:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'vector' in namespace 'std' ```hpp 104 | const std::vector &a_vars) | ~~~~~^ ``` - **Source/AMRInterpolator/SurfaceExtraction.impl.hpp:114:6:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'SurfaceExtraction' ```hpp 114 | void SurfaceExtraction::add_diagnostic_vars( | ^ ``` - **Source/AMRInterpolator/SurfaceExtraction.impl.hpp:115:16:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'vector' in namespace 'std' ```hpp 115 | const std::vector &a_vars) | ~~~~~^ ``` - **Source/AMRInterpolator/SurfaceExtraction.impl.hpp:126:1:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'SurfaceExtraction' ```hpp 126 | SurfaceExtraction::SurfaceExtraction( | ^ ``` - **Source/AMRInterpolator/SurfaceExtraction.impl.hpp:127:42:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > unknown type name 'params_t' ```hpp 127 | const SurfaceGeometry &a_geom, const params_t &a_params, | ^ ``` - **Source/AMRInterpolator/SurfaceExtraction.impl.hpp:128:16:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'vector' in namespace 'std' ```hpp 128 | const std::vector> &a_vars, | ~~~~~^ ``` - **Source/AMRInterpolator/SurfaceExtraction.impl.hpp:128:39:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > use of undeclared identifier 'VariableType' ```hpp 128 | const std::vector> &a_vars, | ^ ``` - **Source/AMRInterpolator/SurfaceExtraction.impl.hpp:139:1:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'SurfaceExtraction' ```hpp 139 | SurfaceExtraction::SurfaceExtraction( | ^ ``` - **Source/AMRInterpolator/SurfaceExtraction.impl.hpp:140:42:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > unknown type name 'params_t' ```hpp 140 | const SurfaceGeometry &a_geom, const params_t &a_params, | ^ ``` - **Source/BoxUtils/SixthOrderDerivatives.hpp:17:19:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > static assertion failed: SixthOrderDerivatives todo ```hpp 17 | static_assert(false, "SixthOrderDerivatives todo"); | ^~~~~ ``` - **Source/BoxUtils/SixthOrderDerivatives.hpp:20:18:** warning: [[cppcoreguidelines-avoid-const-or-ref-data-members](https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/avoid-const-or-ref-data-members.html)] > member 'm_dx' of type 'const double' is const qualified ```hpp 20 | const double m_dx; | ^ ``` - **Source/BoxUtils/SixthOrderDerivatives.hpp:23:18:** warning: [[cppcoreguidelines-avoid-const-or-ref-data-members](https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/avoid-const-or-ref-data-members.html)] > member 'm_one_over_dx' of type 'const double' is const qualified ```hpp 23 | const double m_one_over_dx; | ^ ``` - **Source/BoxUtils/SixthOrderDerivatives.hpp:24:18:** warning: [[cppcoreguidelines-avoid-const-or-ref-data-members](https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/avoid-const-or-ref-data-members.html)] > member 'm_one_over_dx2' of type 'const double' is const qualified ```hpp 24 | const double m_one_over_dx2; | ^ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Source/BoxUtils/SixthOrderDerivatives.hpp:36:19: warning: use of function template name with no prior declaration in function call with explicit template arguments is a C++20 extension [clang-diagnostic-c++20-extensions] 36 | auto in = SIMDIFY(in_ptr); | ^ ``` - **Source/BoxUtils/SixthOrderDerivatives.hpp:56:47:** warning: [[bugprone-easily-swappable-parameters](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/easily-swappable-parameters.html)] > 2 adjacent parameters of 'diff1' of similar type are easily swapped by mistake ```hpp 56 | void diff1(vars_t> &d1, const Cell ¤t_cell, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 57 | int direction) const | ~~~~~~~~~~~~~ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Source/BoxUtils/SixthOrderDerivatives.hpp:56:67: note: the first parameter in the range is 'current_cell' 56 | void diff1(vars_t> &d1, const Cell ¤t_cell, | ^~~~~~~~~~~~ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Source/BoxUtils/SixthOrderDerivatives.hpp:57:20: note: the last parameter in the range is 'direction' 57 | int direction) const | ^~~~~~~~~ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Source/BoxUtils/SixthOrderDerivatives.hpp:57:16: note: 'const int &' and 'int' parameters accept and bind the same kind of values 57 | int direction) const | ^ ``` - **Source/BoxUtils/SixthOrderDerivatives.hpp:56:53:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'Cell' ```hpp 56 | void diff1(vars_t> &d1, const Cell ¤t_cell, | ^ ``` - **Source/BoxUtils/SixthOrderDerivatives.hpp:74:22:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'Cell' ```hpp 74 | auto diff1(const Cell ¤t_cell) const | ^ ``` - **Source/BoxUtils/SixthOrderDerivatives.hpp:93:47:** warning: [[bugprone-easily-swappable-parameters](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/easily-swappable-parameters.html)] > 2 adjacent parameters of 'diff1' of similar type are easily swapped by mistake ```hpp 93 | void diff1(Tensor<1, data_t> &diff_value, const Cell ¤t_cell, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 94 | int direction, int ivar) const | ~~~~~~~~~~~~~ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Source/BoxUtils/SixthOrderDerivatives.hpp:93:67: note: the first parameter in the range is 'current_cell' 93 | void diff1(Tensor<1, data_t> &diff_value, const Cell ¤t_cell, | ^~~~~~~~~~~~ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Source/BoxUtils/SixthOrderDerivatives.hpp:94:20: note: the last parameter in the range is 'direction' 94 | int direction, int ivar) const | ^~~~~~~~~ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Source/BoxUtils/SixthOrderDerivatives.hpp:94:16: note: 'const int &' and 'int' parameters accept and bind the same kind of values 94 | int direction, int ivar) const | ^ ``` - **Source/BoxUtils/SixthOrderDerivatives.hpp:93:53:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'Cell' ```hpp 93 | void diff1(Tensor<1, data_t> &diff_value, const Cell ¤t_cell, | ^ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Source/BoxUtils/SixthOrderDerivatives.hpp:104:16: warning: do not declare C-style arrays, use std::array<> instead [cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays] 104 | void diff1(Tensor<1, data_t> (&diff_array)[num_vars], | ^ ``` - **Source/BoxUtils/SixthOrderDerivatives.hpp:105:16:** warning: [[bugprone-easily-swappable-parameters](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/easily-swappable-parameters.html)] > 3 adjacent parameters of 'diff1' of similar type are easily swapped by mistake ```hpp 105 | const Cell ¤t_cell, int direction, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 106 | int start_var = 0) const | ~~~~~~~~~~~~~~~~~ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Source/BoxUtils/SixthOrderDerivatives.hpp:105:36: note: the first parameter in the range is 'current_cell' 105 | const Cell ¤t_cell, int direction, | ^~~~~~~~~~~~ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Source/BoxUtils/SixthOrderDerivatives.hpp:106:20: note: the last parameter in the range is 'start_var' 106 | int start_var = 0) const | ^~~~~~~~~ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Source/BoxUtils/SixthOrderDerivatives.hpp:105:50: note: 'const int &' and 'int' parameters accept and bind the same kind of values 105 | const Cell ¤t_cell, int direction, | ^ ``` - **Source/BoxUtils/SixthOrderDerivatives.hpp:105:22:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'Cell' ```hpp 105 | const Cell ¤t_cell, int direction, | ^ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Source/BoxUtils/SixthOrderDerivatives.hpp:122:19: warning: use of function template name with no prior declaration in function call with explicit template arguments is a C++20 extension [clang-diagnostic-c++20-extensions] 122 | auto in = SIMDIFY(in_ptr); | ^ ``` - **Source/BoxUtils/SixthOrderDerivatives.hpp:141:47:** warning: [[bugprone-easily-swappable-parameters](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/easily-swappable-parameters.html)] > 2 adjacent parameters of 'diff2' of similar type are easily swapped by mistake ```hpp 141 | void diff2(vars_t> &d2, const Cell ¤t_cell, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 142 | int direction) const | ~~~~~~~~~~~~~ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Source/BoxUtils/SixthOrderDerivatives.hpp:141:67: note: the first parameter in the range is 'current_cell' 141 | void diff2(vars_t> &d2, const Cell ¤t_cell, | ^~~~~~~~~~~~ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Source/BoxUtils/SixthOrderDerivatives.hpp:142:20: note: the last parameter in the range is 'direction' 142 | int direction) const | ^~~~~~~~~ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Source/BoxUtils/SixthOrderDerivatives.hpp:142:16: note: 'const int &' and 'int' parameters accept and bind the same kind of values 142 | int direction) const | ^ ``` - **Source/BoxUtils/SixthOrderDerivatives.hpp:141:53:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'Cell' ```hpp 141 | void diff2(vars_t> &d2, const Cell ¤t_cell, | ^ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Source/BoxUtils/SixthOrderDerivatives.hpp:157:16: warning: do not declare C-style arrays, use std::array<> instead [cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays] 157 | void diff2(Tensor<2, data_t> (&diffArray)[NUM_VARS], | ^ ``` - **Source/BoxUtils/SixthOrderDerivatives.hpp:158:16:** warning: [[bugprone-easily-swappable-parameters](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/easily-swappable-parameters.html)] > 2 adjacent parameters of 'diff2' of similar type are easily swapped by mistake ```hpp 158 | const Cell ¤t_cell, int direction) const | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Source/BoxUtils/SixthOrderDerivatives.hpp:158:36: note: the first parameter in the range is 'current_cell' 158 | const Cell ¤t_cell, int direction) const | ^~~~~~~~~~~~ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Source/BoxUtils/SixthOrderDerivatives.hpp:158:54: note: the last parameter in the range is 'direction' 158 | const Cell ¤t_cell, int direction) const | ^~~~~~~~~ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Source/BoxUtils/SixthOrderDerivatives.hpp:158:50: note: 'const int &' and 'int' parameters accept and bind the same kind of values 158 | const Cell ¤t_cell, int direction) const | ^ ``` - **Source/BoxUtils/SixthOrderDerivatives.hpp:158:22:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'Cell' ```hpp 158 | const Cell ¤t_cell, int direction) const | ^ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Source/BoxUtils/SixthOrderDerivatives.hpp:175:19: warning: use of function template name with no prior declaration in function call with explicit template arguments is a C++20 extension [clang-diagnostic-c++20-extensions] 175 | auto in = SIMDIFY(in_ptr); | ^ ``` - **Source/BoxUtils/SixthOrderDerivatives.hpp:230:22:** warning: [[bugprone-easily-swappable-parameters](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/easily-swappable-parameters.html)] > 2 adjacent parameters of 'mixed_diff2' of similar type are easily swapped by mistake ```hpp 230 | const Cell ¤t_cell, int direction1, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Source/BoxUtils/SixthOrderDerivatives.hpp:230:42: note: the first parameter in the range is 'current_cell' 230 | const Cell ¤t_cell, int direction1, | ^~~~~~~~~~~~ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Source/BoxUtils/SixthOrderDerivatives.hpp:230:60: note: the last parameter in the range is 'direction1' 230 | const Cell ¤t_cell, int direction1, | ^~~~~~~~~~ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Source/BoxUtils/SixthOrderDerivatives.hpp:230:56: note: 'const int &' and 'int' parameters accept and bind the same kind of values 230 | const Cell ¤t_cell, int direction1, | ^ ``` - **Source/BoxUtils/SixthOrderDerivatives.hpp:230:28:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'Cell' ```hpp 230 | const Cell ¤t_cell, int direction1, | ^ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Source/BoxUtils/SixthOrderDerivatives.hpp:250:22: warning: do not declare C-style arrays, use std::array<> instead [cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays] 250 | void mixed_diff2(Tensor<2, data_t> (&diffArray)[NUM_VARS], | ^ ``` - **Source/BoxUtils/SixthOrderDerivatives.hpp:251:22:** warning: [[bugprone-easily-swappable-parameters](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/easily-swappable-parameters.html)] > 2 adjacent parameters of 'mixed_diff2' of similar type are easily swapped by mistake ```hpp 251 | const Cell ¤t_cell, int direction1, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Source/BoxUtils/SixthOrderDerivatives.hpp:251:42: note: the first parameter in the range is 'current_cell' 251 | const Cell ¤t_cell, int direction1, | ^~~~~~~~~~~~ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Source/BoxUtils/SixthOrderDerivatives.hpp:251:60: note: the last parameter in the range is 'direction1' 251 | const Cell ¤t_cell, int direction1, | ^~~~~~~~~~ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Source/BoxUtils/SixthOrderDerivatives.hpp:251:56: note: 'const int &' and 'int' parameters accept and bind the same kind of values 251 | const Cell ¤t_cell, int direction1, | ^ ``` - **Source/BoxUtils/SixthOrderDerivatives.hpp:251:28:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'Cell' ```hpp 251 | const Cell ¤t_cell, int direction1, | ^ ``` - **Source/BoxUtils/SixthOrderDerivatives.hpp:274:22:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'Cell' ```hpp 274 | auto diff2(const Cell ¤t_cell) const | ^ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Source/BoxUtils/SixthOrderDerivatives.hpp:308:37: warning: use of function template name with no prior declaration in function call with explicit template arguments is a C++20 extension [clang-diagnostic-c++20-extensions] 308 | const auto in = SIMDIFY(in_ptr); | ^ ``` - **Source/BoxUtils/SixthOrderDerivatives.hpp:344:52:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'Cell' ```hpp 344 | void add_advection(vars_t &vars, const Cell ¤t_cell, | ^ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Source/BoxUtils/SixthOrderDerivatives.hpp:360:24: warning: do not declare C-style arrays, use std::array<> instead [cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays] 360 | void add_advection(data_t (&out)[NUM_VARS], | ^ ``` - **Source/BoxUtils/SixthOrderDerivatives.hpp:361:30:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'Cell' ```hpp 361 | const Cell ¤t_cell, const data_t &vec_comp, | ^ ``` - **Source/BoxUtils/SixthOrderDerivatives.hpp:378:26:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'Cell' ```hpp 378 | auto advection(const Cell ¤t_cell, | ^ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Source/BoxUtils/SixthOrderDerivatives.hpp:431:31: warning: use of function template name with no prior declaration in function call with explicit template arguments is a C++20 extension [clang-diagnostic-c++20-extensions] 431 | const auto in = SIMDIFY(in_ptr); | ^ ``` - **Source/BoxUtils/SixthOrderDerivatives.hpp:447:54:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'Cell' ```hpp 447 | void add_dissipation(vars_t &vars, const Cell ¤t_cell, | ^ ``` - **Source/BoxUtils/SixthOrderDerivatives.hpp:448:26:** warning: [[bugprone-easily-swappable-parameters](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/easily-swappable-parameters.html)] > 2 adjacent parameters of 'add_dissipation' of convertible types are easily swapped by mistake ```hpp 448 | const double factor, const int direction) const | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Source/BoxUtils/SixthOrderDerivatives.hpp:448:39: note: the first parameter in the range is 'factor' 448 | const double factor, const int direction) const | ^~~~~~ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Source/BoxUtils/SixthOrderDerivatives.hpp:448:57: note: the last parameter in the range is 'direction' 448 | const double factor, const int direction) const | ^~~~~~~~~ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Source/BoxUtils/SixthOrderDerivatives.hpp:448:47: note: 'const double' and 'const int' may be implicitly converted: 'const double' (as 'double') -> 'const int' (as 'int'), 'const int' (as 'int') -> 'const double' (as 'double') 448 | const double factor, const int direction) const | ^ ``` - **Source/BoxUtils/SixthOrderDerivatives.hpp:465:54:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'Cell' ```hpp 465 | void add_dissipation(vars_t &vars, const Cell ¤t_cell, | ^ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Source/BoxUtils/SixthOrderDerivatives.hpp:486:26: warning: do not declare C-style arrays, use std::array<> instead [cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays] 486 | void add_dissipation(data_t (&out)[NUM_VARS], | ^ ``` - **Source/BoxUtils/SixthOrderDerivatives.hpp:487:32:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'Cell' ```hpp 487 | const Cell ¤t_cell, const double factor, | ^ ``` - **Source/BoxUtils/SixthOrderDerivatives.hpp:487:60:** warning: [[bugprone-easily-swappable-parameters](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/easily-swappable-parameters.html)] > 2 adjacent parameters of 'add_dissipation' of convertible types are easily swapped by mistake ```hpp 487 | const Cell ¤t_cell, const double factor, | ^~~~~~~~~~~~~~~~~~~~ 488 | const int direction) const | ~~~~~~~~~~~~~~~~~~~ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Source/BoxUtils/SixthOrderDerivatives.hpp:487:73: note: the first parameter in the range is 'factor' 487 | const Cell ¤t_cell, const double factor, | ^~~~~~ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Source/BoxUtils/SixthOrderDerivatives.hpp:488:36: note: the last parameter in the range is 'direction' 488 | const int direction) const | ^~~~~~~~~ /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Source/BoxUtils/SixthOrderDerivatives.hpp:488:26: note: 'const double' and 'const int' may be implicitly converted: 'const double' (as 'double') -> 'const int' (as 'int'), 'const int' (as 'int') -> 'const double' (as 'double') 488 | const int direction) const | ^ ``` - **Source/CCZ4/Constraints.hpp:76:24:** warning: [[cppcoreguidelines-avoid-non-const-global-variables](https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/avoid-non-const-global-variables.html)] > variable 's_calc_mom_norm' is non-const and globally accessible, consider making it const ```hpp 76 | static inline bool s_calc_mom_norm = | ^ ``` - **Source/CCZ4/Constraints.impl.hpp:7:2:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > "This file should only be included through Constraints.hpp" ```hpp 7 | #error "This file should only be included through Constraints.hpp" | ^ ``` - **Source/CCZ4/Constraints.impl.hpp:21:8:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > use of undeclared identifier 'Constraints' ```hpp 21 | inline Constraints::Constraints( | ^ ``` - **Source/CCZ4/Constraints.impl.hpp:22:35:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > unknown type name 'Interval' ```hpp 22 | double dx, int a_c_Ham, const Interval &a_c_Moms, | ^ ``` - **Source/CCZ4/Constraints.impl.hpp:24:11:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > unknown type name 'Interval' ```hpp 24 | const Interval &a_c_Moms_abs_terms /*defaulted*/, | ^ ``` - **Source/CCZ4/Constraints.impl.hpp:49:1:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > use of undeclared identifier 'Constraints' ```hpp 49 | Constraints::compute(int i, int j, int k, const amrex::Array4 &cst, | ^ ``` - **Source/CCZ4/Constraints.impl.hpp:68:18:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > use of undeclared identifier 'Constraints' ```hpp 68 | AMREX_GPU_DEVICE Constraints::Vars Constraints::constraint_equations( | ^ ``` - **Source/CCZ4/Constraints.impl.hpp:68:44:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > use of undeclared identifier 'Constraints' ```hpp 68 | AMREX_GPU_DEVICE Constraints::Vars Constraints::constraint_equations( | ^ ``` - **Source/CCZ4/Constraints.impl.hpp:71:11:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'chris_t' ```hpp 71 | const chris_t &chris) const | ^ ``` - **Source/CCZ4/Constraints.impl.hpp:130:1:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > use of undeclared identifier 'Constraints' ```hpp 130 | Constraints::store_vars(const Vars &out, | ^ ``` - **Source/CCZ4/Constraints.impl.hpp:130:31:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'Vars' ```hpp 130 | Constraints::store_vars(const Vars &out, | ^ ``` - **Source/CCZ4/Constraints.impl.hpp:179:6:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > use of undeclared identifier 'Constraints' ```hpp 179 | void Constraints::set_up(int a_state_index, bool a_calc_mom_norm) | ^ ``` - **Source/CCZ4/GammaCalculator.hpp:36:9:** warning: [[cppcoreguidelines-avoid-const-or-ref-data-members](https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/avoid-const-or-ref-data-members.html)] > member 'm_deriv' of type 'const FourthOrderDerivatives' is const qualified ```hpp 36 | m_deriv; //!< An object for calculating derivatives of the variables | ^ ``` - **Source/CCZ4/GammaCalculator.hpp:41:42:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'Cell' ```hpp 41 | template void compute(Cell current_cell) const | ^ ``` - **Source/CCZ4/Weyl4.impl.hpp:7:2:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > "This file should only be included through Weyl4.hpp" ```hpp 7 | #error "This file should only be included through Weyl4.hpp" | ^ ``` - **Source/CCZ4/Weyl4.impl.hpp:18:1:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > use of undeclared identifier 'Weyl4' ```hpp 18 | Weyl4::compute(int i, int j, int k, const amrex::Array4 &a_derive_array, | ^ ``` - **Source/CCZ4/Weyl4.impl.hpp:52:37:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'Tensor' ```hpp 52 | AMREX_GPU_DEVICE AMREX_FORCE_INLINE Tensor<3, data_t> | ^ ``` - **Source/CCZ4/Weyl4.impl.hpp:53:1:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > use of undeclared identifier 'Weyl4' ```hpp 53 | Weyl4::compute_epsilon3_LUU(const Vars &vars, | ^ ``` - **Source/CCZ4/Weyl4.impl.hpp:53:35:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'Vars' ```hpp 53 | Weyl4::compute_epsilon3_LUU(const Vars &vars, | ^ ``` - **Source/CCZ4/Weyl4.impl.hpp:54:35:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'Tensor' ```hpp 54 | const Tensor<2, data_t> &h_UU) const | ^ ``` - **Source/CCZ4/Weyl4.impl.hpp:104:37:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'EBFields_t' ```hpp 104 | AMREX_GPU_DEVICE AMREX_FORCE_INLINE EBFields_t Weyl4::compute_EB_fields( | ^ ``` - **Source/CCZ4/Weyl4.impl.hpp:104:56:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > use of undeclared identifier 'Weyl4' ```hpp 104 | AMREX_GPU_DEVICE AMREX_FORCE_INLINE EBFields_t Weyl4::compute_EB_fields( | ^ ``` - **Source/CCZ4/Weyl4.impl.hpp:105:11:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'Vars' ```hpp 105 | const Vars &vars, const Vars> &d1, | ^ ``` - **Source/CCZ4/Weyl4.impl.hpp:105:42:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > use of undeclared identifier 'Tensor' ```hpp 105 | const Vars &vars, const Vars> &d1, | ^ ``` - **Source/CCZ4/Weyl4.impl.hpp:106:21:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > use of undeclared identifier 'Tensor' ```hpp 106 | const Diff2Vars> &d2, | ^ ``` - **Source/CCZ4/Weyl4.impl.hpp:107:11:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'Tensor' ```hpp 107 | const Tensor<3, data_t> &epsilon3_LUU, const Tensor<2, data_t> &h_UU, | ^ ``` - **Source/CCZ4/Weyl4.impl.hpp:107:50:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'Tensor' ```hpp 107 | const Tensor<3, data_t> &epsilon3_LUU, const Tensor<2, data_t> &h_UU, | ^ ``` - **Source/CCZ4/Weyl4.impl.hpp:108:11:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'chris_t' ```hpp 108 | const chris_t &chris) const | ^ ``` - **Source/CCZ4/Weyl4.impl.hpp:205:37:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'NPScalar_t' ```hpp 205 | AMREX_GPU_DEVICE AMREX_FORCE_INLINE NPScalar_t Weyl4::compute_Weyl4( | ^ ``` - **Source/CCZ4/Weyl4.impl.hpp:205:56:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > use of undeclared identifier 'Weyl4' ```hpp 205 | AMREX_GPU_DEVICE AMREX_FORCE_INLINE NPScalar_t Weyl4::compute_Weyl4( | ^ ``` - **Source/CCZ4/Weyl4.impl.hpp:206:11:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'EBFields_t' ```hpp 206 | const EBFields_t &ebfields, const Vars &vars, | ^ ``` - **Source/CCZ4/Weyl4.impl.hpp:206:47:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'Vars' ```hpp 206 | const EBFields_t &ebfields, const Vars &vars, | ^ ``` - **Source/CCZ4/Weyl4.impl.hpp:207:16:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > use of undeclared identifier 'Tensor' ```hpp 207 | const Vars> &d1, const Diff2Vars> &d2, | ^ ``` - **Source/GRTeclynCore/GRAMRLevel.cpp:43:21:** warning: [[readability-static-accessed-through-instance](https://clang.llvm.org/extra/clang-tidy/checks/readability/static-accessed-through-instance.html)] > static member accessed through instance ```cpp 43 | boundary_conditions.get_state_var_parity(icomp, idim); | ^~~~~~~~~~~~~~~~~~~~ | BoundaryConditions:: /home/runner/work/GRTeclyn/GRTeclyn/GRTeclyn/Source/GRTeclynCore/GRAMRLevel.hpp:135:18: warning: 'virtual' is redundant since the function is already declared 'override' [cppcoreguidelines-explicit-virtual-functions,modernize-use-override] 135 | virtual void derive(const std::string &name, amrex::Real time, | ~~~~~~~ ^ ``` - **Source/InitialConditions/BlackHoles/KerrBH.hpp:51:42:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > no template named 'Cell' ```hpp 51 | template void compute(Cell current_cell) const; | ^ ``` - **Source/InitialConditions/ScalarFields/ScalarBubble.hpp:11:10:** error: [[clang-diagnostic-error](https://clang.llvm.org/extra/clang-tidy/checks/clang/diagnostic-error.html)] > 'MatterCCZ4RHS.hpp' file not found ```hpp 11 | #include "MatterCCZ4RHS.hpp" | ^~~~~~~~~~~~~~~~~~~ ```

Have any feedback or feature suggestions? Share it here.

mirenradia commented 1 month ago

Nice - the proposed changes work well! I agree that the stateVariableSetUp should be a part of GRAMRLevel that each PhysicsLevel::variableSetUp can call, since not all applications need the extra CCZ4/BSSN variables.

I guess my question was whether we wanted to make DefaultLevelFactory::variableSetUp() call this so there would be no need to define a PhysicsLevel::variableSetUp() if no non-state variables were required?

  • It's a bit cumbersome to have to set the parity for all variables even though reflective boundary conditions are not used. It would be nice if there was a separate option that checked for the type of BCs and then if some of them are reflective, look for the parities.

This is a good idea. Let me look at setting some kind of default so that the user doesn't need to set this if they never intend to use reflective BCs.

  • Consider changing the definition of variables as enums to be a vector of strings like what AMReX requires when interfacing with plotMultiFab, derive.lst etc. I find myself making a separate vector of strings that just goes over the enums so I can pass variable names to AMReX functions.

I presume you mean StateVariables::names which is currently of type std::array<std::string, NUM_VARS>? We went for std::array at the time for GRChombo as the size is known at compile time but since this isn't really performance critical, I guess there isn't much of a downside to switching to amrex::Vector<std::string>.

  • I think some of the code in PhysicsLevel::derive() can be placed in GRAMRLevel and then called by PhysicsLevel like stateVariableSetUp. For example the Hamiltonian and momentum calculations would be common to any GR application and so will be copied in each GR physics example and this is probably a point of failure (if we update the calculations later on).

We don't want to include the constraint code in GRAMRLevel since it's GR specific and GRAMRLevel should be used for non-GR examples too. However, I guess some of the setup code that generates the source multifab can be moved into a GRAMRLevel function.

julianakwan commented 1 month ago

I also forgot to mention: some of the 'old' files in the test directory e.g. Tests/CCZ4RHSTest/ADMConformalVars-fdf5a7a.hpp have been modified but are tagged with a SHA from before the refactoring of the derived variables. Just commenting here so that we remember to update these with the new SHA once this pull request has been merged into the `devel' branch.

mirenradia commented 1 month ago

I also forgot to mention: some of the 'old' files in the test directory e.g. Tests/CCZ4RHSTest/ADMConformalVars-fdf5a7a.hpp have been modified but are tagged with a SHA from before the refactoring of the derived variables. Just commenting here so that we remember to update these with the new SHA once this pull request has been merged into the `devel' branch.

I just had a look at the changes in these files and it's just coming from the renaming UserVariables -> StateVariables. I don't think we should rename them and even if we were, I have no idea what we would rename them to.