Commit b07e0909 authored by COULAUD Olivier's avatar COULAUD Olivier

Remove initializer warnings

parent a991bebc
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#ifndef FCHEBSYMM2LHANDLER_HPP #ifndef FCHEBSYMM2LHANDLER_HPP
#define FCHEBSYMM2LHANDLER_HPP #define FCHEBSYMM2LHANDLER_HPP
#include <array>
#include <climits> #include <climits>
#include <sstream> #include <sstream>
...@@ -36,9 +37,10 @@ ...@@ -36,9 +37,10 @@
permutations of the 16 we compute in this function). Depending on whether permutations of the 16 we compute in this function). Depending on whether
FACASVD is defined or not, either ACA+SVD or only SVD is used to compress FACASVD is defined or not, either ACA+SVD or only SVD is used to compress
them. */ them. */
template <class FReal, int ORDER, typename MatrixKernelClass> template <class FReal, int ORDER, typename MatrixKernelClass, class ArrayK, class ArrayLr>
static void precompute(const MatrixKernelClass *const MatrixKernel, const FReal CellWidth, static void precompute(const MatrixKernelClass *const MatrixKernel, const FReal CellWidth,
const FReal Epsilon, FReal* K[343], int LowRank[343]) const FReal Epsilon, ArrayK K, ArrayLr LowRank)
// const FReal Epsilon, FReal* K[343], int LowRank[343])
{ {
// std::cout << "\nComputing 16 far-field interactions (l=" << ORDER << ", eps=" << Epsilon // std::cout << "\nComputing 16 far-field interactions (l=" << ORDER << ", eps=" << Epsilon
// << ") for cells of width w = " << CellWidth << std::endl; // << ") for cells of width w = " << CellWidth << std::endl;
...@@ -492,10 +494,10 @@ static void ComputeAndCompressAndStoreInBinaryFile(const MatrixKernelClass *cons ...@@ -492,10 +494,10 @@ static void ComputeAndCompressAndStoreInBinaryFile(const MatrixKernelClass *cons
static const unsigned int nnodes = ORDER*ORDER*ORDER; static const unsigned int nnodes = ORDER*ORDER*ORDER;
// compute and compress //////////// // compute and compress ////////////
FReal* K[343]; std::array<FReal*,343> K{};
int LowRank[343]; std::array<int,343> LowRank{};
for (unsigned int idx=0; idx<343; ++idx) // for (unsigned int idx=0; idx<343; ++idx)
{ K[idx] = nullptr; LowRank[idx] = 0; } // { K[idx] = nullptr; LowRank[idx] = 0; }
precompute<FReal,ORDER>(MatrixKernel, FReal(2.), Epsilon, K, LowRank); precompute<FReal,ORDER>(MatrixKernel, FReal(2.), Epsilon, K, LowRank);
// write to binary file //////////// // write to binary file ////////////
......
...@@ -48,8 +48,9 @@ class FInterpSymmetries ...@@ -48,8 +48,9 @@ class FInterpSymmetries
// set quads and cones permutations // set quads and cones permutations
unsigned int evn[ORDER], odd[ORDER]; unsigned int evn[ORDER], odd[ORDER];
for (unsigned int o=0; o<ORDER; ++o) for (unsigned int o=0; o<ORDER; ++o) {
{evn[o] = o; odd[o] = ORDER-1 - o;} evn[o] = o;
odd[o] = ORDER-1 - o;}
for (unsigned int i=0; i<ORDER; ++i) { for (unsigned int i=0; i<ORDER; ++i) {
for (unsigned int j=0; j<ORDER; ++j) { for (unsigned int j=0; j<ORDER; ++j) {
...@@ -81,12 +82,15 @@ class FInterpSymmetries ...@@ -81,12 +82,15 @@ class FInterpSymmetries
} }
// set 48 global permutations (combinations of 8 quadrants and 6 cones respectively) // set 48 global permutations (combinations of 8 quadrants and 6 cones respectively)
for (unsigned int q=0; q<8; ++q) for (unsigned int q=0; q<8; ++q) {
for (unsigned int c=0; c<8; ++c) for (unsigned int c=0; c<8; ++c){
if (c!=2 && c!=5) // cone 2 and 5 do not exist if (c!=2 && c!=5) {// cone 2 and 5 do not exist
for (unsigned int n=0; n<nnodes; ++n) for (unsigned int n=0; n<nnodes; ++n){
permutations[q*8 + c][n] = cones[c][quads[q][n]]; permutations[q*8 + c][n] = cones[c][quads[q][n]];
}
}
}
}
// permutation of interaction indices (already absolute value) // permutation of interaction indices (already absolute value)
perms[0][0] = 0; perms[0][1] = 1; perms[0][2] = 2; perms[0][0] = 0; perms[0][1] = 1; perms[0][2] = 2;
perms[1][0] = 0; perms[1][1] = 2; perms[1][2] = 1; perms[1][0] = 0; perms[1][1] = 2; perms[1][2] = 1;
...@@ -119,7 +123,8 @@ class FInterpSymmetries ...@@ -119,7 +123,8 @@ class FInterpSymmetries
const int cidx = (q2 | q1 | q0); const int cidx = (q2 | q1 | q0);
// set permutation array ///////////////////////////////////////// // set permutation array /////////////////////////////////////////
for (unsigned int n=0; n<nnodes; ++n) permutation[n] = permutations[qidx*8 + cidx][n]; for (unsigned int n=0; n<nnodes; ++n) {
permutation[n] = permutations[qidx*8 + cidx][n]; }
// set permutation index ///////////////////////////////////////// // set permutation index /////////////////////////////////////////
return static_cast<unsigned> (u[perms[cidx][0]]+3)*7*7 + (u[perms[cidx][1]]+3)*7 + (u[perms[cidx][2]]+3); return static_cast<unsigned> (u[perms[cidx][0]]+3)*7*7 + (u[perms[cidx][1]]+3)*7 + (u[perms[cidx][2]]+3);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment