REMORA
Regional Modeling of Oceans Refined Adaptively
Loading...
Searching...
No Matches
REMORA_Tracers.cpp
Go to the documentation of this file.
1#include <string>
2#include <REMORA.H>
3#include <REMORA_PC.H>
4
5#ifdef REMORA_USE_PARTICLES
6
7using namespace amrex;
8
9/*! Read tracer and hydro particles parameters */
10void REMORA::readTracersParams ()
11{
13
16
17 pp.queryAdd(std::string("use_"+REMORAParticleNames::tracers).c_str(), m_use_tracer_particles);
18 pp.queryAdd(std::string("use_"+REMORAParticleNames::hydro).c_str(), m_use_hydro_particles);
19
21 particleData.addName(REMORAParticleNames::tracers);
22 }
23
25 particleData.addName(REMORAParticleNames::hydro);
26 }
27 return;
28}
29
30/*! Initialize tracer and hydro particles */
31void REMORA::initializeTracers ( ParGDBBase* a_gdb,
32 const Vector<std::unique_ptr<MultiFab>>& a_z_phys_nd )
33{
34 auto& namelist_unalloc( particleData.getNamesUnalloc() );
35
36 for (auto it = namelist_unalloc.begin(); it != namelist_unalloc.end(); ++it) {
37
38 std::string species_name( *it );
39
40 if (species_name == REMORAParticleNames::tracers) {
41
43 REMORAPC* pc = new REMORAPC(a_gdb, REMORAParticleNames::tracers);
44 pc->InitializeParticles(a_z_phys_nd[0]);
45 amrex::Print() << "Initialized " << pc->TotalNumberOfParticles() << " tracer particles.\n";
46 particleData.pushBack(REMORAParticleNames::tracers, pc);
47
48 } else if (species_name == REMORAParticleNames::hydro) {
49
51 REMORAPC* pc = new REMORAPC(a_gdb, REMORAParticleNames::hydro);
52 pc->InitializeParticles(a_z_phys_nd[0]);
53 amrex::Print() << "Initialized " << pc->TotalNumberOfParticles() << " hydro particles.\n";
54 particleData.pushBack(REMORAParticleNames::hydro, pc);
55
56 }
57 }
58
59 if (m_use_tracer_particles) namelist_unalloc.remove( REMORAParticleNames::tracers );
60 if (m_use_hydro_particles) namelist_unalloc.remove( REMORAParticleNames::hydro );
61
62 return;
63}
64
65/*! Evolve tracers and hydro particles for one time step*/
66void REMORA::evolveTracers ( int a_lev,
67 Real a_dt_lev,
69 const Vector<std::unique_ptr<MultiFab>>& a_z_phys_nd )
70{
72 particleData[REMORAParticleNames::tracers]->EvolveParticles( a_lev,
76 }
78 particleData[REMORAParticleNames::hydro]->EvolveParticles( a_lev,
82 }
83 return;
84}
85
86#endif
mf_h setVal(geomdata.ProbHi(2))
std::string pp_prefix
default prefix for input file parameters
Definition REMORA.H:374