Allow X splitting with FCI#2651
Conversation
Might help with performance
Otherwise the regions aren't cached.
Might help with performance
Precalculate the matrix. This hard-codes the DDX and DDZ derivative to C2. Rather than taking derivatives, this first does the matrix-matrix multiplication and then does only a single matrix-vector operation, rather than 4. Retains a switch to go back to the old version.
release leaks the pointer, reset free's the object.
* helped finding the bug for the boundary * rather slow (around 1 minute) * needs internet connectivity
|
Requires #2324 |
| XZHermiteSpline(const BoutMask& mask, int y_offset = 0, Mesh* mesh = nullptr) | ||
| : XZHermiteSpline(y_offset, mesh) { | ||
| region = regionFromMask(mask, localmesh); | ||
| setRegion(regionFromMask(mask, localmesh)); |
There was a problem hiding this comment.
warning: no matching member function for call to 'setRegion' [clang-diagnostic-error]
setRegion(regionFromMask(mask, localmesh));
^Additional context
include/bout/interpolation_xz.hxx:77: candidate function not viable: no known conversion from 'XZHermiteSpline' to 'XZInterpolation' for object argument
void setRegion(const std::unique_ptr<Region<Ind3D>> region) { setRegion(*region); }
^include/bout/interpolation_xz.hxx:74: candidate function not viable: no known conversion from 'XZHermiteSpline' to 'XZInterpolation' for object argument
void setRegion(const std::string& region_name) {
^include/bout/interpolation_xz.hxx:78: candidate function not viable: no known conversion from 'XZHermiteSpline' to 'XZInterpolation' for object argument
void setRegion(const Region<Ind3D>& region) {
^| XZLagrange4pt(const BoutMask& mask, int y_offset = 0, Mesh* mesh = nullptr) | ||
| : XZLagrange4pt(y_offset, mesh) { | ||
| region = regionFromMask(mask, localmesh); | ||
| setRegion(regionFromMask(mask, localmesh)); |
There was a problem hiding this comment.
warning: no matching member function for call to 'setRegion' [clang-diagnostic-error]
setRegion(regionFromMask(mask, localmesh));
^Additional context
include/bout/interpolation_xz.hxx:77: candidate function not viable: no known conversion from 'XZLagrange4pt' to 'XZInterpolation' for object argument
void setRegion(const std::unique_ptr<Region<Ind3D>> region) { setRegion(*region); }
^include/bout/interpolation_xz.hxx:74: candidate function not viable: no known conversion from 'XZLagrange4pt' to 'XZInterpolation' for object argument
void setRegion(const std::string& region_name) {
^include/bout/interpolation_xz.hxx:78: candidate function not viable: no known conversion from 'XZLagrange4pt' to 'XZInterpolation' for object argument
void setRegion(const Region<Ind3D>& region) {
^| XZBilinear(const BoutMask& mask, int y_offset = 0, Mesh* mesh = nullptr) | ||
| : XZBilinear(y_offset, mesh) { | ||
| region = regionFromMask(mask, localmesh); | ||
| setRegion(regionFromMask(mask, localmesh)); |
There was a problem hiding this comment.
warning: no matching member function for call to 'setRegion' [clang-diagnostic-error]
setRegion(regionFromMask(mask, localmesh));
^Additional context
include/bout/interpolation_xz.hxx:77: candidate function not viable: no known conversion from 'XZBilinear' to 'XZInterpolation' for object argument
void setRegion(const std::unique_ptr<Region<Ind3D>> region) { setRegion(*region); }
^include/bout/interpolation_xz.hxx:74: candidate function not viable: no known conversion from 'XZBilinear' to 'XZInterpolation' for object argument
void setRegion(const std::string& region_name) {
^include/bout/interpolation_xz.hxx:78: candidate function not viable: no known conversion from 'XZBilinear' to 'XZInterpolation' for object argument
void setRegion(const Region<Ind3D>& region) {
^| return data[i.ind]; | ||
| } | ||
|
|
||
| T& operator[](Ind3D i) { |
There was a problem hiding this comment.
warning: class member cannot be redeclared [clang-diagnostic-error]
T& operator[](Ind3D i) {
^Additional context
include/bout/utils.hxx:363: previous definition is here
T& operator[](Ind3D i) {
^| #ifdef HS_USE_PETSC | ||
| IndConverter conv{localmesh}; | ||
| #endif | ||
| BOUT_FOR(i, getRegion(region)) { |
There was a problem hiding this comment.
warning: no matching member function for call to 'getRegion' [clang-diagnostic-error]
BOUT_FOR(i, getRegion(region)) {
^Additional context
include/bout/region.hxx:135: expanded from macro 'BOUT_FOR'
BOUT_FOR_OMP(index, region, parallel for schedule(BOUT_OPENMP_SCHEDULE))
^include/bout/region.hxx:131: expanded from macro 'BOUT_FOR_OMP'
#define BOUT_FOR_OMP(index, region, omp_pragmas) BOUT_FOR_SERIAL(index, region)
^include/bout/region.hxx:119: expanded from macro 'BOUT_FOR_SERIAL'
for (auto block = region.getBlocks().cbegin(), end = region.getBlocks().cend(); \
^include/bout/interpolation_xz.hxx:91: candidate function not viable: no known conversion from 'XZHermiteSpline' to 'const XZInterpolation' for object argument
const Region<Ind3D>& getRegion(const std::string& region) const {
^include/bout/interpolation_xz.hxx:87: candidate function not viable: requires 0 arguments, but 1 was provided
const Region<Ind3D>& getRegion() const {
^| @@ -59,67 +59,50 @@ Field3D XZMonotonicHermiteSpline::interpolate(const Field3D& f, | |||
|
|
|||
| const auto curregion{getRegion(region)}; | |||
There was a problem hiding this comment.
warning: no matching member function for call to 'getRegion' [clang-diagnostic-error]
const auto curregion{getRegion(region)};
^Additional context
include/bout/interpolation_xz.hxx:91: candidate function not viable: no known conversion from 'const XZMonotonicHermiteSpline' to 'const XZInterpolation' for object argument
const Region<Ind3D>& getRegion(const std::string& region) const {
^include/bout/interpolation_xz.hxx:87: candidate function not viable: requires 0 arguments, but 1 was provided
const Region<Ind3D>& getRegion() const {
^Based on @dschwoerer's implementation in #2651
|
@ZedThree clang-tidy-review is failing with: Do you know what is going on? |
|
I thought it might be from an outdated version of |
Uses PETSc. Currently only implemented for hermitespline.