/home/runner/work/amr-wind/amr-wind/amr-wind/core/IntField.H Source File

AMR-Wind API: /home/runner/work/amr-wind/amr-wind/amr-wind/core/IntField.H Source File
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches
IntField.H
Go to the documentation of this file.
1#ifndef INTFIELD_H
2#define INTFIELD_H
3
4#include <string>
5
7
8#include "AMReX_iMultiFab.H"
9
10namespace amr_wind {
11
12class FieldRepo;
13
20{
21public:
22 friend class FieldRepo;
23
24 IntField(const IntField&) = delete;
25 IntField& operator=(const IntField&) = delete;
26
28 [[nodiscard]] const std::string& name() const { return m_name; }
29
31 [[nodiscard]] unsigned id() const { return m_id; }
32
34 [[nodiscard]] int num_comp() const { return m_ncomp; }
35
37 [[nodiscard]] const amrex::IntVect& num_grow() const { return m_ngrow; }
38
40 [[nodiscard]] FieldLoc field_location() const { return m_floc; }
41
43 [[nodiscard]] const FieldRepo& repo() const { return m_repo; }
44
46 amrex::iMultiFab& operator()(int lev);
47 const amrex::iMultiFab& operator()(int lev) const;
48
49 amrex::Vector<amrex::iMultiFab*> vec_ptrs();
50
51 [[nodiscard]] amrex::Vector<const amrex::iMultiFab*> vec_const_ptrs() const;
52
53 void setVal(int value);
54
55 void setVal(int value, int start_comp, int num_comp = 1, int nghost = 0);
56
57 void setVal(const amrex::Vector<int>& values, int nghost = 0);
58
59protected:
62 std::string name,
63 unsigned fid,
64 int ncomp = 1,
65 int ngrow = 1,
67
69
70 std::string m_name;
71
72 const unsigned m_id;
73
75
76 amrex::IntVect m_ngrow;
77
79};
80
81} // namespace amr_wind
82
83#endif /* INTFIELD_H */
Definition FieldRepo.H:86
IntField(const IntField &)=delete
unsigned id() const
Unique integer ID for this field.
Definition IntField.H:31
amrex::Vector< const amrex::iMultiFab * > vec_const_ptrs() const
Definition IntField.cpp:46
int m_ncomp
Definition IntField.H:74
FieldLoc m_floc
Definition IntField.H:78
amrex::IntVect m_ngrow
Definition IntField.H:76
const std::string & name() const
Name of the field.
Definition IntField.H:28
IntField & operator=(const IntField &)=delete
amrex::Vector< amrex::iMultiFab * > vec_ptrs()
Definition IntField.cpp:35
FieldRepo & m_repo
Definition IntField.H:68
std::string m_name
Definition IntField.H:70
const amrex::IntVect & num_grow() const
Number of ghost cells.
Definition IntField.H:37
int num_comp() const
Number of components for this field.
Definition IntField.H:34
const FieldRepo & repo() const
Reference to the FieldRepo that holds the fabs.
Definition IntField.H:43
friend class FieldRepo
Definition IntField.H:22
const unsigned m_id
Definition IntField.H:72
amrex::iMultiFab & operator()(int lev)
Access the FAB at a given level.
Definition IntField.cpp:23
FieldLoc field_location() const
Location of the field.
Definition IntField.H:40
void setVal(int value)
Definition IntField.cpp:59
FieldLoc
Definition FieldDescTypes.H:29
@ CELL
Cell-centered (default)
Definition FieldDescTypes.H:30
This test case is intended as an evaluation of the momentum advection scheme.
Definition BCInterface.cpp:10