Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ static KOKKOS_INLINE_FUNCTION void nodeApplyAscOrthoCircleTake(const int i_r, co
const bool DirBC_Interior, ConstVector<double>& x,
ConstVector<double>& rhs, Vector<double>& result,
ConstVector<double>& arr, ConstVector<double>& att,
ConstVector<double>& art, ConstVector<double>& detDF,
ConstVector<double>& coeff_beta)
ConstVector<double>& art, ConstVector<double>& detDF)
{
KOKKOS_ASSERT(i_r >= 0 && i_r <= grid.numberSmootherCircles());

Expand Down Expand Up @@ -185,11 +184,11 @@ static KOKKOS_INLINE_FUNCTION void nodeApplyAscOrthoCircleTake(const int i_r, co
}
}

static KOKKOS_INLINE_FUNCTION void
nodeApplyAscOrthoRadialTake(int i_r, int i_theta, const PolarGrid& grid, bool DirBC_Interior, ConstVector<double>& x,
ConstVector<double>& rhs, Vector<double>& result, ConstVector<double>& arr,
const ConstVector<double>& att, ConstVector<double>& art, const ConstVector<double>& detDF,
ConstVector<double>& coeff_beta)
static KOKKOS_INLINE_FUNCTION void nodeApplyAscOrthoRadialTake(const int i_r, const int i_theta, const PolarGrid& grid,
const bool DirBC_Interior, ConstVector<double>& x,
ConstVector<double>& rhs, Vector<double>& result,
ConstVector<double>& arr, ConstVector<double>& att,
ConstVector<double>& art, ConstVector<double>& detDF)
{
assert(i_r >= grid.numberSmootherCircles() - 1 && i_r < grid.nr());

Expand Down Expand Up @@ -471,14 +470,12 @@ void ExtrapolatedSmootherTake<LevelCacheType>::applyAscOrthoBlackCircleSection(C
const LevelCacheType& level_cache = ExtrapolatedSmoother<LevelCacheType>::level_cache_;
const bool DirBC_Interior = ExtrapolatedSmoother<LevelCacheType>::DirBC_Interior_;

assert(level_cache.cacheDensityProfileCoefficients());
assert(level_cache.cacheDomainGeometry());

ConstVector<double> arr = level_cache.arr();
ConstVector<double> att = level_cache.att();
ConstVector<double> art = level_cache.art();
ConstVector<double> detDF = level_cache.detDF();
ConstVector<double> coeff_beta = level_cache.coeff_beta();
ConstVector<double> arr = level_cache.arr();
ConstVector<double> att = level_cache.att();
ConstVector<double> art = level_cache.art();
ConstVector<double> detDF = level_cache.detDF();

/* The outer most circle next to the radial section is defined to be black. */
const int start_black_circles = (grid.numberSmootherCircles() % 2 == 0) ? 1 : 0;
Expand All @@ -493,8 +490,7 @@ void ExtrapolatedSmootherTake<LevelCacheType>::applyAscOrthoBlackCircleSection(C
// Kokkos lambda function to execute for each point in the index space
KOKKOS_LAMBDA(const int circle_task, const int i_theta) {
int i_r = start_black_circles + circle_task * 2;
nodeApplyAscOrthoCircleTake(i_r, i_theta, grid, DirBC_Interior, x, rhs, temp, arr, att, art, detDF,
coeff_beta);
nodeApplyAscOrthoCircleTake(i_r, i_theta, grid, DirBC_Interior, x, rhs, temp, arr, att, art, detDF);
});

Kokkos::fence();
Expand All @@ -511,14 +507,12 @@ void ExtrapolatedSmootherTake<LevelCacheType>::applyAscOrthoWhiteCircleSection(C
const LevelCacheType& level_cache = ExtrapolatedSmoother<LevelCacheType>::level_cache_;
const bool DirBC_Interior = ExtrapolatedSmoother<LevelCacheType>::DirBC_Interior_;

assert(level_cache.cacheDensityProfileCoefficients());
assert(level_cache.cacheDomainGeometry());

ConstVector<double> arr = level_cache.arr();
ConstVector<double> att = level_cache.att();
ConstVector<double> art = level_cache.art();
ConstVector<double> detDF = level_cache.detDF();
ConstVector<double> coeff_beta = level_cache.coeff_beta();
ConstVector<double> arr = level_cache.arr();
ConstVector<double> att = level_cache.att();
ConstVector<double> art = level_cache.art();
ConstVector<double> detDF = level_cache.detDF();

/* The outer most circle next to the radial section is defined to be black. */
const int start_white_circles = (grid.numberSmootherCircles() % 2 == 0) ? 0 : 1;
Expand All @@ -533,8 +527,7 @@ void ExtrapolatedSmootherTake<LevelCacheType>::applyAscOrthoWhiteCircleSection(C
// Kokkos lambda function to execute for each point in the index space
KOKKOS_LAMBDA(const int circle_task, const int i_theta) {
const int i_r = start_white_circles + circle_task * 2;
nodeApplyAscOrthoCircleTake(i_r, i_theta, grid, DirBC_Interior, x, rhs, temp, arr, att, art, detDF,
coeff_beta);
nodeApplyAscOrthoCircleTake(i_r, i_theta, grid, DirBC_Interior, x, rhs, temp, arr, att, art, detDF);
});

Kokkos::fence();
Expand All @@ -551,14 +544,12 @@ void ExtrapolatedSmootherTake<LevelCacheType>::applyAscOrthoBlackRadialSection(C
const LevelCacheType& level_cache = ExtrapolatedSmoother<LevelCacheType>::level_cache_;
const bool DirBC_Interior = ExtrapolatedSmoother<LevelCacheType>::DirBC_Interior_;

assert(level_cache.cacheDensityProfileCoefficients());
assert(level_cache.cacheDomainGeometry());

ConstVector<double> arr = level_cache.arr();
ConstVector<double> att = level_cache.att();
ConstVector<double> art = level_cache.art();
ConstVector<double> detDF = level_cache.detDF();
ConstVector<double> coeff_beta = level_cache.coeff_beta();
ConstVector<double> arr = level_cache.arr();
ConstVector<double> att = level_cache.att();
ConstVector<double> art = level_cache.art();
ConstVector<double> detDF = level_cache.detDF();

assert(grid.ntheta() % 2 == 0);
const int start_black_radials = 0;
Expand All @@ -573,8 +564,7 @@ void ExtrapolatedSmootherTake<LevelCacheType>::applyAscOrthoBlackRadialSection(C
// Kokkos lambda function to execute for each point in the index space
KOKKOS_LAMBDA(const int radial_task, const int i_r) {
const int i_theta = start_black_radials + radial_task * 2;
nodeApplyAscOrthoRadialTake(i_r, i_theta, grid, DirBC_Interior, x, rhs, temp, arr, att, art, detDF,
coeff_beta);
nodeApplyAscOrthoRadialTake(i_r, i_theta, grid, DirBC_Interior, x, rhs, temp, arr, att, art, detDF);
});

Kokkos::fence();
Expand All @@ -591,14 +581,12 @@ void ExtrapolatedSmootherTake<LevelCacheType>::applyAscOrthoWhiteRadialSection(C
const LevelCacheType& level_cache = ExtrapolatedSmoother<LevelCacheType>::level_cache_;
const bool DirBC_Interior = ExtrapolatedSmoother<LevelCacheType>::DirBC_Interior_;

assert(level_cache.cacheDensityProfileCoefficients());
assert(level_cache.cacheDomainGeometry());

ConstVector<double> arr = level_cache.arr();
ConstVector<double> att = level_cache.att();
ConstVector<double> art = level_cache.art();
ConstVector<double> detDF = level_cache.detDF();
ConstVector<double> coeff_beta = level_cache.coeff_beta();
ConstVector<double> arr = level_cache.arr();
ConstVector<double> att = level_cache.att();
ConstVector<double> art = level_cache.art();
ConstVector<double> detDF = level_cache.detDF();

assert(grid.ntheta() % 2 == 0);
const int start_white_radials = 1;
Expand All @@ -613,8 +601,7 @@ void ExtrapolatedSmootherTake<LevelCacheType>::applyAscOrthoWhiteRadialSection(C
// Kokkos lambda function to execute for each point in the index space
KOKKOS_LAMBDA(const int radial_task, const int i_r) {
const int i_theta = start_white_radials + radial_task * 2;
nodeApplyAscOrthoRadialTake(i_r, i_theta, grid, DirBC_Interior, x, rhs, temp, arr, att, art, detDF,
coeff_beta);
nodeApplyAscOrthoRadialTake(i_r, i_theta, grid, DirBC_Interior, x, rhs, temp, arr, att, art, detDF);
});

Kokkos::fence();
Expand Down
65 changes: 26 additions & 39 deletions include/Smoother/SmootherTake/applyAscOrtho.inl
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ static KOKKOS_INLINE_FUNCTION void nodeApplyAscOrthoCircleTake(const int i_r, co
bool DirBC_Interior, ConstVector<double>& x,
ConstVector<double>& rhs, Vector<double>& result,
ConstVector<double>& arr, ConstVector<double>& att,
ConstVector<double>& art, ConstVector<double>& detDF,
ConstVector<double>& coeff_beta)
ConstVector<double>& art, ConstVector<double>& detDF)
{
KOKKOS_ASSERT(i_r >= 0 && i_r < grid.numberSmootherCircles());

Expand Down Expand Up @@ -56,11 +55,11 @@ static KOKKOS_INLINE_FUNCTION void nodeApplyAscOrthoCircleTake(const int i_r, co
);
}

static KOKKOS_INLINE_FUNCTION void
nodeApplyAscOrthoRadialTake(const int i_r, const int i_theta, const PolarGrid& grid, bool DirBC_Interior,
ConstVector<double>& x, ConstVector<double>& rhs, Vector<double>& result,
ConstVector<double>& arr, const ConstVector<double>& att, ConstVector<double>& art,
const ConstVector<double>& detDF, ConstVector<double>& coeff_beta)
static KOKKOS_INLINE_FUNCTION void nodeApplyAscOrthoRadialTake(const int i_r, const int i_theta, const PolarGrid& grid,
bool DirBC_Interior, ConstVector<double>& x,
ConstVector<double>& rhs, Vector<double>& result,
ConstVector<double>& arr, ConstVector<double>& att,
ConstVector<double>& art, ConstVector<double>& detDF)
{
KOKKOS_ASSERT(i_r >= grid.numberSmootherCircles() && i_r < grid.nr());

Expand Down Expand Up @@ -127,14 +126,12 @@ void SmootherTake<LevelCacheType>::applyAscOrthoBlackCircleSection(ConstVector<d
const LevelCacheType& level_cache = Smoother<LevelCacheType>::level_cache_;
const bool DirBC_Interior = Smoother<LevelCacheType>::DirBC_Interior_;

assert(level_cache.cacheDensityProfileCoefficients());
assert(level_cache.cacheDomainGeometry());

ConstVector<double> arr = level_cache.arr();
ConstVector<double> att = level_cache.att();
ConstVector<double> art = level_cache.art();
ConstVector<double> detDF = level_cache.detDF();
ConstVector<double> coeff_beta = level_cache.coeff_beta();
ConstVector<double> arr = level_cache.arr();
ConstVector<double> att = level_cache.att();
ConstVector<double> art = level_cache.art();
ConstVector<double> detDF = level_cache.detDF();

/* The outer most circle next to the radial section is defined to be black. */
const int start_black_circles = (grid.numberSmootherCircles() % 2 == 0) ? 1 : 0;
Expand All @@ -149,8 +146,7 @@ void SmootherTake<LevelCacheType>::applyAscOrthoBlackCircleSection(ConstVector<d
// Kokkos lambda function to execute for each point in the index space
KOKKOS_LAMBDA(const int circle_task, const int i_theta) {
int i_r = start_black_circles + circle_task * 2;
nodeApplyAscOrthoCircleTake(i_r, i_theta, grid, DirBC_Interior, x, rhs, temp, arr, att, art, detDF,
coeff_beta);
nodeApplyAscOrthoCircleTake(i_r, i_theta, grid, DirBC_Interior, x, rhs, temp, arr, att, art, detDF);
});

Kokkos::fence();
Expand All @@ -166,14 +162,12 @@ void SmootherTake<LevelCacheType>::applyAscOrthoWhiteCircleSection(ConstVector<d
const LevelCacheType& level_cache = Smoother<LevelCacheType>::level_cache_;
const bool DirBC_Interior = Smoother<LevelCacheType>::DirBC_Interior_;

assert(level_cache.cacheDensityProfileCoefficients());
assert(level_cache.cacheDomainGeometry());

ConstVector<double> arr = level_cache.arr();
ConstVector<double> att = level_cache.att();
ConstVector<double> art = level_cache.art();
ConstVector<double> detDF = level_cache.detDF();
ConstVector<double> coeff_beta = level_cache.coeff_beta();
ConstVector<double> arr = level_cache.arr();
ConstVector<double> att = level_cache.att();
ConstVector<double> art = level_cache.art();
ConstVector<double> detDF = level_cache.detDF();

/* The outer most circle next to the radial section is defined to be black. */
const int start_white_circles = (grid.numberSmootherCircles() % 2 == 0) ? 0 : 1;
Expand All @@ -188,8 +182,7 @@ void SmootherTake<LevelCacheType>::applyAscOrthoWhiteCircleSection(ConstVector<d
// Kokkos lambda function to execute for each point in the index space
KOKKOS_LAMBDA(const int circle_task, const int i_theta) {
const int i_r = start_white_circles + circle_task * 2;
nodeApplyAscOrthoCircleTake(i_r, i_theta, grid, DirBC_Interior, x, rhs, temp, arr, att, art, detDF,
coeff_beta);
nodeApplyAscOrthoCircleTake(i_r, i_theta, grid, DirBC_Interior, x, rhs, temp, arr, att, art, detDF);
});

Kokkos::fence();
Expand All @@ -205,14 +198,12 @@ void SmootherTake<LevelCacheType>::applyAscOrthoBlackRadialSection(ConstVector<d
const LevelCacheType& level_cache = Smoother<LevelCacheType>::level_cache_;
const bool DirBC_Interior = Smoother<LevelCacheType>::DirBC_Interior_;

assert(level_cache.cacheDensityProfileCoefficients());
assert(level_cache.cacheDomainGeometry());

ConstVector<double> arr = level_cache.arr();
ConstVector<double> att = level_cache.att();
ConstVector<double> art = level_cache.art();
ConstVector<double> detDF = level_cache.detDF();
ConstVector<double> coeff_beta = level_cache.coeff_beta();
ConstVector<double> arr = level_cache.arr();
ConstVector<double> att = level_cache.att();
ConstVector<double> art = level_cache.art();
ConstVector<double> detDF = level_cache.detDF();

assert(grid.ntheta() % 2 == 0);
const int start_black_radials = 0;
Expand All @@ -227,8 +218,7 @@ void SmootherTake<LevelCacheType>::applyAscOrthoBlackRadialSection(ConstVector<d
// Kokkos lambda function to execute for each point in the index space
KOKKOS_LAMBDA(const int radial_task, const int i_r) {
const int i_theta = start_black_radials + radial_task * 2;
nodeApplyAscOrthoRadialTake(i_r, i_theta, grid, DirBC_Interior, x, rhs, temp, arr, att, art, detDF,
coeff_beta);
nodeApplyAscOrthoRadialTake(i_r, i_theta, grid, DirBC_Interior, x, rhs, temp, arr, att, art, detDF);
});

Kokkos::fence();
Expand All @@ -244,14 +234,12 @@ void SmootherTake<LevelCacheType>::applyAscOrthoWhiteRadialSection(ConstVector<d
const LevelCacheType& level_cache = Smoother<LevelCacheType>::level_cache_;
const bool DirBC_Interior = Smoother<LevelCacheType>::DirBC_Interior_;

assert(level_cache.cacheDensityProfileCoefficients());
assert(level_cache.cacheDomainGeometry());

ConstVector<double> arr = level_cache.arr();
ConstVector<double> att = level_cache.att();
ConstVector<double> art = level_cache.art();
ConstVector<double> detDF = level_cache.detDF();
ConstVector<double> coeff_beta = level_cache.coeff_beta();
ConstVector<double> arr = level_cache.arr();
ConstVector<double> att = level_cache.att();
ConstVector<double> art = level_cache.art();
ConstVector<double> detDF = level_cache.detDF();

assert(grid.ntheta() % 2 == 0);
const int start_white_radials = 1;
Expand All @@ -266,8 +254,7 @@ void SmootherTake<LevelCacheType>::applyAscOrthoWhiteRadialSection(ConstVector<d
// Kokkos lambda function to execute for each point in the index space
KOKKOS_LAMBDA(const int radial_task, const int i_r) {
const int i_theta = start_white_radials + radial_task * 2;
nodeApplyAscOrthoRadialTake(i_r, i_theta, grid, DirBC_Interior, x, rhs, temp, arr, att, art, detDF,
coeff_beta);
nodeApplyAscOrthoRadialTake(i_r, i_theta, grid, DirBC_Interior, x, rhs, temp, arr, att, art, detDF);
});

Kokkos::fence();
Expand Down
Loading