Commit 45b9d50e authored by berenger-bramas's avatar berenger-bramas

Progress in the development of the new kernel.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/scalfmm/scalfmm/trunk@293 2616d619-271b-44dc-8df4-d4a8f33a7222
parent 57e8751a
This diff is collapsed.
......@@ -48,8 +48,15 @@ class FHarmonic {
FReal* sphereHarmoInnerCoef;
FReal* sphereHarmoOuterCoef;
void init(){
harmonic = new FComplexe[expSize];
cosSin = new FComplexe[2 * devP + 1];
legendre = new FReal[expSize];
thetaDerivatedResult = new FComplexe[expSize];
sphereHarmoInnerCoef = new FReal[int(((inDevP*2)+1) * ((inDevP*2)+2) * 0.5)];
sphereHarmoOuterCoef = new FReal[devP + 1];
void sphericalHarmonicInitialize(){
FReal factOuter = 1.0;
for(int idxP = 0 ; idxP <= devP; factOuter *= FReal(++idxP) ){
sphereHarmoOuterCoef[idxP] = factOuter;
......@@ -111,21 +118,23 @@ class FHarmonic {
}
}
FHarmonic& operator=(const FHarmonic&){ return *this;}
public:
explicit FHarmonic(const int inDevP)
: devP(inDevP),expSize(int(((inDevP)+1) * ((inDevP)+2) * 0.5)),
harmonic(0), cosSin(0), legendre(0), thetaDerivatedResult(0),
sphereHarmoInnerCoef(0), sphereHarmoOuterCoef(0) {
harmonic = new FComplexe[expSize];
cosSin = new FComplexe[2 * devP + 1];
legendre = new FReal[expSize];
init();
}
thetaDerivatedResult = new FComplexe[expSize];
sphereHarmoInnerCoef = new FReal[expSize];
sphereHarmoOuterCoef = new FReal[devP + 1];
FHarmonic(const FHarmonic& other)
: devP(other.devP),expSize(int(((other.devP)+1) * ((other.devP)+2) * 0.5)),
harmonic(0), cosSin(0), legendre(0), thetaDerivatedResult(0),
sphereHarmoInnerCoef(0), sphereHarmoOuterCoef(0) {
sphericalHarmonicInitialize();
init();
}
~FHarmonic(){
......@@ -137,11 +146,15 @@ public:
delete[] sphereHarmoOuterCoef;
}
FComplexe* data(){
int getExpSize() const{
return expSize;
}
FComplexe* result(){
return harmonic;
}
const FComplexe* data() const {
const FComplexe* result() const {
return harmonic;
}
......@@ -153,6 +166,23 @@ public:
return harmonic[index];
}
FComplexe* resultThetaDerivated(){
return thetaDerivatedResult;
}
const FComplexe* resultThetaDerivated() const {
return thetaDerivatedResult;
}
FComplexe& resultThetaDerivated(const int index){
return thetaDerivatedResult[index];
}
const FComplexe& resultThetaDerivated(const int index) const{
return thetaDerivatedResult[index];
}
void computeInner(const FSpherical& inSphere){
computeCosSin(inSphere.getPhi());
......
......@@ -46,6 +46,12 @@ namespace FMemUtils {
}
}
};
template <class TypeClass>
void copyall(TypeClass*const dest, const TypeClass*const source, const int nbElements){
for(int idx = 0 ; idx < nbElements ; ++idx){
dest[idx] = source[idx];
}
}
}
#endif // FMEMUTILS_HPP
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