Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5847 from nikwit/iteration-tags
Add tags for worldtube iterations
- Loading branch information
Showing
13 changed files
with
161 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...volution/Systems/CurvedScalarWave/Worldtube/ElementActions/InitializeCurrentIteration.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Distributed under the MIT License. | ||
// See LICENSE.txt for details. | ||
|
||
#pragma once | ||
|
||
#include <cstddef> | ||
|
||
#include "DataStructures/DataBox/Protocols/Mutator.hpp" | ||
#include "Evolution/Systems/CurvedScalarWave/Worldtube/Tags.hpp" | ||
#include "Utilities/ProtocolHelpers.hpp" | ||
|
||
namespace CurvedScalarWave::Worldtube::Initialization { | ||
|
||
/*! | ||
* \brief Sets the initial value of `CurrentIteration to 0. | ||
*/ | ||
struct InitializeCurrentIteration : tt::ConformsTo<db::protocols::Mutator> { | ||
using return_tags = | ||
tmpl::list<CurvedScalarWave::Worldtube::Tags::CurrentIteration>; | ||
using argument_tags = tmpl::list<>; | ||
using simple_tags = return_tags; | ||
using compute_tags = tmpl::list<>; | ||
using simple_tags_from_options = tmpl::list<>; | ||
using const_global_cache_tags = tmpl::list<>; | ||
using mutable_global_cache_tags = tmpl::list<>; | ||
static void apply(const gsl::not_null<size_t*> current_iteration) { | ||
*current_iteration = 0; | ||
} | ||
}; | ||
} // namespace CurvedScalarWave::Worldtube::Initialization |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...ion/Systems/CurvedScalarWave/Worldtube/ElementActions/Test_InitializeCurrentIteration.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Distributed under the MIT License. | ||
// See LICENSE.txt for details. | ||
|
||
#include <array> | ||
#include <memory> | ||
|
||
#include "DataStructures/DataBox/DataBox.hpp" | ||
#include "Evolution/Systems/CurvedScalarWave/Worldtube/ElementActions/InitializeCurrentIteration.hpp" | ||
#include "Evolution/Systems/CurvedScalarWave/Worldtube/Tags.hpp" | ||
#include "Framework/TestingFramework.hpp" | ||
|
||
namespace CurvedScalarWave::Worldtube { | ||
namespace { | ||
SPECTRE_TEST_CASE( | ||
"Unit.Evolution.Systems.CSW.Worldtube.InitializeCurrentIteration", | ||
"[Unit][Evolution]") { | ||
const size_t current_iteration = 77; | ||
auto box = | ||
db::create<db::AddSimpleTags<Tags::CurrentIteration>>(current_iteration); | ||
db::mutate_apply<Initialization::InitializeCurrentIteration>( | ||
make_not_null(&box)); | ||
CHECK(get<Tags::CurrentIteration>(box) == 0); | ||
} | ||
} // namespace | ||
} // namespace CurvedScalarWave::Worldtube |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.