6 #include <athena/hydro/hydro.hpp>
7 #include <athena/mesh/mesh.hpp>
8 #include <athena/parameter_input.hpp>
11 #include <application/application.hpp>
26 Application::Logger app(
"inversion");
27 app->Log(
"Initializing ConcentrationInversion");
32 Vectorize<int>(pin->GetString(
"inversion", name +
".variables").c_str());
37 Xstd_[IDN] = pin->GetReal(
"inversion", name +
".tem.std");
38 app->Log(name +
"::temperature std = " + std::to_string(
Xstd_[IDN]));
40 Xstd_[m] = pin->GetReal(
"inversion", name +
".qvapor" +
41 std::to_string(m) +
".std.gkg") /
43 snprintf(buf,
sizeof(buf),
"%s::vapor %d standard deviation",
45 app->Log(buf + std::to_string(
Xstd_[m]));
49 int ndim =
idx_.size();
50 app->Log(name +
"::number of input dimension = " + std::to_string(ndim));
54 app->Log(
"number of output dimension = " + std::to_string(nvalue));
57 int nwalker = pmb->block_size.nx3;
58 app->Log(
"walkers per block = " + std::to_string(nwalker));
59 app->Log(
"total number of walkers = " +
60 std::to_string(pmb->pmy_mesh->mesh_size.nx3));
61 if ((nwalker < 2) && pmb->pmy_mesh->nlim > 0) {
62 app->Error(
"nwalker (nx3) must be at least 2");
72 Application::Logger app(
"inversion");
75 app->Log(
"Initializing random positions for walkers");
77 unsigned int seed =
time(NULL) + Globals::my_rank;
80 for (
int p = 0;
p < nwalker; ++
p) {
81 for (
size_t n = 0; n <
idx_.size(); ++n) {
89 int jl,
int ju)
const {
90 Application::Logger app(
"inversion");
91 app->Log(
"UpdateConcentration");
~ConcentrationInversion()
ConcentrationInversion(MeshBlock *pmb, ParameterInput *pin, std::string name)
void UpdateConcentration(Hydro *phydro, Real *Xp, int k, int jl, int ju) const
void InitializePositions() override
void InitializeChain(int nstep, int nwalker, int ndim, int nvalue)
void NewCArray(T **&a, int n1, int n2)