-
Notifications
You must be signed in to change notification settings - Fork 109
Field3DParallel #3320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Field3DParallel #3320
Changes from all commits
f5ca1d0
12df335
e71eebe
a9366cb
b3983c1
32f4c65
09f7466
e1a15dd
f98d5de
fc98ac4
205d502
6a7c407
268ecfc
f3b36a4
b47343f
d07bde5
6374539
f49c94c
140bf78
84d99b3
1219197
7bb8367
acd9b93
0e6fc75
9b119c8
69dfaad
7b9525c
fb6c016
033d872
2590f7c
957f058
ea71ae2
46d6663
b1068d1
f15f204
d8b2240
9a8ebcb
b6e1b56
82d046a
00048e0
2dd2335
4f2f60a
1adc1fc
a46781a
80d7d34
40e1c2e
ee6b03e
9501f7a
ddb9132
b5a2c3b
2e7dccf
6e21bb8
e5eb01a
763ce78
02aafda
f98fe9d
bf6743f
85fb0fd
a9c5059
14462be
d5272c4
360358e
9943956
01582cd
f529158
8ad5817
8d6e1a9
de707f3
bd7dd2d
481179f
ca77f6b
1a5b922
f89333d
cbacecc
bfbae40
d4e137c
3d184a6
2abbd6c
2436326
c9868d3
5bdacef
a50c531
b57ea10
be8bae5
f606ad1
202e51d
f828a9c
1d7b9f0
4b49458
c865d1b
07afd43
61f00bb
a6f2f25
c44416b
e191ce7
7066e3f
86945d5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,9 +4,9 @@ | |
| * \brief Definition of 2D scalar field class | ||
| * | ||
| ************************************************************************** | ||
| * Copyright 2010 B.D.Dudson, S.Farley, M.V.Umansky, X.Q.Xu | ||
| * Copyright 2010 - 2026 BOUT++ contributors | ||
| * | ||
| * Contact: Ben Dudson, bd512@york.ac.uk | ||
| * Contact: Ben Dudson, dudson2@llnl.gov | ||
| * | ||
| * This file is part of BOUT++. | ||
| * | ||
|
|
@@ -33,13 +33,17 @@ class Field2D; | |
| #define BOUT_FIELD2D_H | ||
|
|
||
| #include "bout/array.hxx" | ||
| #include "bout/build_config.hxx" | ||
| #include "bout/assert.hxx" | ||
| #include "bout/bout_types.hxx" | ||
| #include "bout/build_defines.hxx" | ||
| #include "bout/field.hxx" | ||
| #include "bout/field_data.hxx" | ||
| #include "bout/fieldperp.hxx" | ||
| #include "bout/region.hxx" | ||
|
|
||
| #include <cstddef> | ||
| #include <ostream> | ||
| #include <string> | ||
|
|
||
| #if BOUT_HAS_RAJA | ||
| #include "RAJA/RAJA.hpp" // using RAJA lib | ||
|
|
@@ -70,7 +74,7 @@ public: | |
| Field2D(Mesh* localmesh = nullptr, CELL_LOC location_in = CELL_CENTRE, | ||
| DirectionTypes directions_in = {YDirectionType::Standard, | ||
| ZDirectionType::Average}, | ||
|
dschwoerer marked this conversation as resolved.
|
||
| std::optional<size_t> region = {}); | ||
| std::optional<size_t> regionID = {}); | ||
|
dschwoerer marked this conversation as resolved.
|
||
|
|
||
| /*! | ||
| * Copy constructor. After this both fields | ||
|
|
@@ -206,7 +210,7 @@ public: | |
| } | ||
| #endif | ||
|
|
||
| return data[jx * ny + jy]; | ||
| return data[(jx * ny) + jy]; | ||
| } | ||
| inline const BoutReal& operator()(int jx, int jy) const { | ||
| #if CHECK > 2 && !BOUT_HAS_CUDA | ||
|
|
@@ -220,7 +224,7 @@ public: | |
| } | ||
| #endif | ||
|
|
||
| return data[jx * ny + jy]; | ||
| return data[(jx * ny) + jy]; | ||
| } | ||
|
|
||
| /*! | ||
|
|
@@ -274,6 +278,11 @@ public: | |
|
|
||
| int size() const override { return nx * ny; } | ||
|
|
||
| /// Return a field that can be used to perform parallel (Y) derivatives. | ||
| /// This is used to write generic FA/FCI code. | ||
| Field2D& asField3DParallel() { return *this; } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks potentially very confusing: surely
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed, it looks confusing. However, this is needed to write FA / FCI independent code.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah I see. Perhaps just a comment might be sufficient. |
||
| const Field2D& asField3DParallel() const { return *this; } | ||
|
|
||
| private: | ||
| /// Internal data array. Handles allocation/freeing of memory | ||
| Array<BoutReal> data; | ||
|
|
@@ -286,6 +295,10 @@ private: | |
| }; | ||
|
|
||
| // Non-member overloaded operators | ||
| FieldPerp operator+(const Field2D& lhs, const FieldPerp& rhs); | ||
| FieldPerp operator-(const Field2D& lhs, const FieldPerp& rhs); | ||
| FieldPerp operator*(const Field2D& lhs, const FieldPerp& rhs); | ||
| FieldPerp operator/(const Field2D& lhs, const FieldPerp& rhs); | ||
|
|
||
| Field2D operator+(const Field2D& lhs, const Field2D& rhs); | ||
| Field2D operator-(const Field2D& lhs, const Field2D& rhs); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.