-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
75 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
set(namel tracer) | ||
string(TOUPPER ${namel} nameu) | ||
|
||
file(GLOB src_files | ||
*.cpp | ||
) | ||
|
||
string(TOLOWER ${CMAKE_BUILD_TYPE} buildl) | ||
string(TOUPPER ${CMAKE_BUILD_TYPE} buildu) | ||
|
||
add_library(${namel}_${buildl} | ||
OBJECT | ||
${src_files} | ||
) | ||
|
||
set_target_properties(${namel}_${buildl} | ||
PROPERTIES | ||
COMPILE_FLAGS ${CMAKE_CXX_FLAGS_${buildu}} | ||
) |
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 @@ | ||
// athena | ||
#include <athena/mesh/mesh.hpp> | ||
#include <athena/parameter_input.hpp> | ||
#include <athena/scalars/scalars.hpp> | ||
|
||
// application | ||
#include <application/application.hpp> | ||
|
||
// canoe | ||
#include <configure.hpp> | ||
|
||
// tracer | ||
#include "tracer.hpp" | ||
|
||
Tracer::Tracer(MeshBlock *pmb, ParameterInput *pin) : pmy_block_(pmb) { | ||
if (NTRACER == 0) return; | ||
|
||
Application::Logger app("tracer"); | ||
app->Log("Initialize Tracer"); | ||
|
||
w.InitWithShallowSlice(pmb->pscalars->r, 4, NCLOUD + NCHEMISTRY, NTRACER); | ||
u.InitWithShallowSlice(pmb->pscalars->s, 4, NCLOUD + NCHEMISTRY, NTRACER); | ||
} | ||
|
||
Tracer::~Tracer() { | ||
if (NTRACER == 0) return; | ||
|
||
Application::Logger app("tracer"); | ||
app->Log("Destroy Tracer"); | ||
} |
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,26 @@ | ||
#ifndef SRC_TRACER_TRACER_HPP_ | ||
#define SRC_TRACER_TRACER_HPP_ | ||
|
||
// C/C++ | ||
#include <memory> | ||
|
||
// athenapp | ||
#include <athena/athena.hpp> | ||
|
||
class MeshBlock; | ||
class ParameterInput; | ||
|
||
class Tracer { | ||
public: | ||
AthenaArray<Real> w, u; | ||
|
||
Tracer(MeshBlock *pmb, ParameterInput *pin); | ||
~Tracer(); | ||
|
||
protected: | ||
MeshBlock *pmy_block_; | ||
}; | ||
|
||
using TracerPtr = std::shared_ptr<Tracer>; | ||
|
||
#endif // SRC_TRACER_TRACER_HPP_ |