/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 inline const std::string& name() const { return m_name; }
29
31 inline unsigned id() const { return m_id; }
32
34 inline int num_comp() const { return m_ncomp; }
35
37 inline const amrex::IntVect& num_grow() const { return m_ngrow; }
38
40 inline FieldLoc field_location() const { return m_floc; }
41
43 const FieldRepo& repo() const { return m_repo; }
44
46 amrex::iMultiFab& operator()(int lev) noexcept;
47 const amrex::iMultiFab& operator()(int lev) const noexcept;
48
49 amrex::Vector<amrex::iMultiFab*> vec_ptrs() noexcept;
50
51 amrex::Vector<const amrex::iMultiFab*> vec_const_ptrs() const noexcept;
52
53 void setVal(int value) noexcept;
54
55 void setVal(
56 int value, int start_comp, int num_comp = 1, int nghost = 0) noexcept;
57
58 void setVal(const amrex::Vector<int>& values, int nghost = 0) noexcept;
59
60protected:
63 std::string name,
64 const unsigned fid,
65 const int ncomp = 1,
66 const int ngrow = 1,
67 const FieldLoc floc = FieldLoc::CELL);
68
70
71 std::string m_name;
72
73 const unsigned m_id;
74
76
77 amrex::IntVect m_ngrow;
78
80};
81
82} // namespace amr_wind
83
84#endif /* INTFIELD_H */
Definition FieldRepo.H:86
Definition IntField.H:20
IntField(const IntField &)=delete
unsigned id() const
Unique integer ID for this field.
Definition IntField.H:31
int m_ncomp
Definition IntField.H:75
FieldLoc m_floc
Definition IntField.H:79
amrex::IntVect m_ngrow
Definition IntField.H:77
const std::string & name() const
Name of the field.
Definition IntField.H:28
IntField & operator=(const IntField &)=delete
FieldRepo & m_repo
Definition IntField.H:69
std::string m_name
Definition IntField.H:71
amrex::Vector< const amrex::iMultiFab * > vec_const_ptrs() const noexcept
Definition IntField.cpp:46
const amrex::IntVect & num_grow() const
Number of ghost cells.
Definition IntField.H:37
amrex::iMultiFab & operator()(int lev) noexcept
Access the FAB at a given level.
Definition IntField.cpp:23
int num_comp() const
Number of components for this field.
Definition IntField.H:34
void setVal(int value) noexcept
Definition IntField.cpp:58
const FieldRepo & repo() const
Reference to the FieldRepo that holds the fabs.
Definition IntField.H:43
const unsigned m_id
Definition IntField.H:73
FieldLoc field_location() const
Location of the field.
Definition IntField.H:40
amrex::Vector< amrex::iMultiFab * > vec_ptrs() noexcept
Definition IntField.cpp:35
FieldLoc
Definition FieldDescTypes.H:27
@ CELL
Cell-centered (default)
Definition BCInterface.cpp:7
Definition console_io.cpp:25