/home/runner/work/amr-wind/amr-wind/amr-wind/wind_energy/actuator/actuator_opsI.H Source File

AMR-Wind API: /home/runner/work/amr-wind/amr-wind/amr-wind/wind_energy/actuator/actuator_opsI.H Source File
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches
actuator_opsI.H
Go to the documentation of this file.
1#ifndef ACTUATOR_OPSI_H
2#define ACTUATOR_OPSI_H
3
5#include "amr-wind/CFDSim.H"
6
7#include <algorithm>
8
10
11template <typename T>
12void determine_influenced_procs(typename T::DataType& data)
13{
14 auto& info = data.info();
15 info.procs =
16 utils::determine_influenced_procs(data.sim().mesh(), info.bound_box);
17
18 if (info.root_proc > -1) {
19 // During regrid, the influenced processes might have changed and might
20 // no longer include the root proc. We insert it back to ensure that it
21 // is always present on the list.
22 info.procs.insert(info.root_proc);
23 }
24
25 const int iproc = amrex::ParallelDescriptor::MyProc();
26 auto in_proc = info.procs.find(iproc);
27 info.actuator_in_proc = (in_proc != info.procs.end());
28 info.sample_vel_in_proc = info.actuator_in_proc;
29}
30
31template <typename T>
33 typename T::DataType& data, amrex::Vector<int>& act_proc_count)
34{
35 auto& info = data.info();
36
37 info.procs =
38 utils::determine_influenced_procs(data.sim().mesh(), info.bound_box);
39
40 utils::determine_root_proc(data.info(), act_proc_count);
41}
42
43} // namespace amr_wind::actuator::ops
44
45#endif /* ACTUATOR_OPSI_H */
Definition ActSrcLineOp.H:9
void determine_root_proc(typename T::DataType &, amrex::Vector< int > &)
Definition actuator_opsI.H:32
void determine_influenced_procs(typename T::DataType &)
Definition actuator_opsI.H:12
std::set< int > determine_influenced_procs(const amrex::AmrCore &mesh, const amrex::RealBox &rbx)
Definition actuator_utils.cpp:6
void determine_root_proc(ActInfo &info, amrex::Vector< int > &act_proc_count)
Definition actuator_utils.cpp:34