Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
chengcli committed Jul 21, 2024
1 parent dbc23d5 commit 2582030
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/tracer/CMakeLists.txt
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}}
)
30 changes: 30 additions & 0 deletions src/tracer/tracer.cpp
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");
}
26 changes: 26 additions & 0 deletions src/tracer/tracer.hpp
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_

0 comments on commit 2582030

Please sign in to comment.