/home/runner/work/amr-wind/amr-wind/amr-wind/utilities/FieldPlaneAveragingFine.H Source File

AMR-Wind API: /home/runner/work/amr-wind/amr-wind/amr-wind/utilities/FieldPlaneAveragingFine.H Source File
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches
FieldPlaneAveragingFine.H
Go to the documentation of this file.
1#ifndef FieldPlaneAveragingFine_H
2#define FieldPlaneAveragingFine_H
3
5#include "amr-wind/CFDSim.H"
8
19namespace amr_wind {
20
29template <typename FType>
31{
32public:
40 const FType& field_in, const amr_wind::SimTime& time, int axis_in);
41
42 virtual ~FPlaneAveragingFine() = default;
43
44 virtual void operator()();
45
46 void convert_x_to_ind(amrex::Real x, int& ind, amrex::Real& c) const;
47
49 amrex::Real line_average_interpolated(amrex::Real x, int comp) const;
51 amrex::Real line_average_cell(int ind, int comp) const;
52
54 const std::string& filename, int step, amrex::Real time);
55 void output_line_average_ascii(int step, amrex::Real time);
56
58 void set_precision(int p) { m_precision = p; };
59
60 int axis() const { return m_axis; };
61 int ncomp() const { return m_ncomp; };
62 int ncell_line() const { return m_ncell_line; };
64
65 const amrex::Vector<amrex::Real>& line_average() const
66 {
67 return m_line_average;
68 };
69 void line_average(int comp, amrex::Vector<amrex::Real>& l_vec);
70 const amrex::Vector<amrex::Real>& line_centroids() const
71 {
72 return m_line_xcentroid;
73 };
74
75 const FType& field() const { return m_field; };
76
77protected:
78 int m_ncomp;
80 amrex::Vector<amrex::Real>
84 amrex::Vector<amrex::Real> m_line_xcentroid;
87 amrex::Real m_dx;
88 amrex::Real m_xlo;
89 amrex::Real m_xhi;
93 int m_precision = 6;
97 const FType& m_field;
99 const int m_axis;
100
101public: // public for GPU
103 template <typename IndexSelector>
104 void compute_averages(const IndexSelector& idxOp);
105};
106
109
114{
115public:
116 VelPlaneAveragingFine(CFDSim& sim, int axis_in);
117
118 ~VelPlaneAveragingFine() override = default;
119
120 void operator()() override;
121
122private:
123 amrex::Vector<amrex::Real>
126 amrex::Vector<amrex::Real>
130 amrex::Vector<amrex::Real>
134public: // public for GPU
136 template <typename IndexSelector>
137 void compute_hvelmag_averages(const IndexSelector& idxOp);
138
141 amrex::Real line_hvelmag_average_interpolated(amrex::Real x) const;
144 amrex::Real line_su_average_interpolated(amrex::Real x) const;
147 amrex::Real line_sv_average_interpolated(amrex::Real x) const;
148};
149
150} // namespace amr_wind
151
152#endif /* FieldPlaneAveraging_H */
Definition CFDSim.H:47
Definition FieldPlaneAveragingFine.H:31
FPlaneAveragingFine(const FType &field_in, const amr_wind::SimTime &time, int axis_in)
Definition FieldPlaneAveragingFine.cpp:9
int m_last_updated_index
Definition FieldPlaneAveragingFine.H:94
int ncomp() const
Definition FieldPlaneAveragingFine.H:61
amrex::Vector< amrex::Real > m_line_xcentroid
Definition FieldPlaneAveragingFine.H:84
int m_precision
Definition FieldPlaneAveragingFine.H:93
int m_ncomp
Definition FieldPlaneAveragingFine.H:78
const int m_axis
Definition FieldPlaneAveragingFine.H:99
const amrex::Vector< amrex::Real > & line_average() const
Definition FieldPlaneAveragingFine.H:65
amrex::Real line_average_interpolated(amrex::Real x, int comp) const
Definition FieldPlaneAveragingFine.cpp:121
amrex::Real m_xhi
Definition FieldPlaneAveragingFine.H:89
int axis() const
Definition FieldPlaneAveragingFine.H:60
amrex::Real line_average_cell(int ind, int comp) const
Definition FieldPlaneAveragingFine.cpp:152
amrex::Real m_xlo
Definition FieldPlaneAveragingFine.H:88
void convert_x_to_ind(amrex::Real x, int &ind, amrex::Real &c) const
Definition FieldPlaneAveragingFine.cpp:49
const FType & field() const
Definition FieldPlaneAveragingFine.H:75
void set_precision(int p)
Definition FieldPlaneAveragingFine.H:58
const SimTime & m_time
Definition FieldPlaneAveragingFine.H:98
const amrex::Vector< amrex::Real > & line_centroids() const
Definition FieldPlaneAveragingFine.H:70
virtual ~FPlaneAveragingFine()=default
amrex::Vector< amrex::Real > m_line_average
Definition FieldPlaneAveragingFine.H:81
virtual void operator()()
Definition FieldPlaneAveragingFine.cpp:163
void compute_averages(const IndexSelector &idxOp)
Definition FieldPlaneAveragingFine.cpp:189
int last_updated_index() const
Definition FieldPlaneAveragingFine.H:63
const FType & m_field
Definition FieldPlaneAveragingFine.H:97
void output_line_average_ascii(const std::string &filename, int step, amrex::Real time)
Definition FieldPlaneAveragingFine.cpp:70
amrex::Real m_dx
Definition FieldPlaneAveragingFine.H:87
int ncell_line() const
Definition FieldPlaneAveragingFine.H:62
int m_ncell_line
Definition FieldPlaneAveragingFine.H:91
Definition SimTime.H:30
Definition FieldPlaneAveragingFine.H:114
amrex::Vector< amrex::Real > m_line_Sv_average
Definition FieldPlaneAveragingFine.H:131
amrex::Vector< amrex::Real > m_line_Su_average
Definition FieldPlaneAveragingFine.H:127
amrex::Real line_hvelmag_average_interpolated(amrex::Real x) const
Definition FieldPlaneAveragingFine.cpp:538
amrex::Vector< amrex::Real > m_line_hvelmag_average
Definition FieldPlaneAveragingFine.H:124
amrex::Real line_sv_average_interpolated(amrex::Real x) const
Definition FieldPlaneAveragingFine.cpp:559
void compute_hvelmag_averages(const IndexSelector &idxOp)
Definition FieldPlaneAveragingFine.cpp:370
VelPlaneAveragingFine(CFDSim &sim, int axis_in)
Definition FieldPlaneAveragingFine.cpp:331
void operator()() override
Definition FieldPlaneAveragingFine.cpp:340
~VelPlaneAveragingFine() override=default
amrex::Real line_su_average_interpolated(amrex::Real x) const
Definition FieldPlaneAveragingFine.cpp:549
Definition BCInterface.cpp:7