FComputeCell.hpp 1.94 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef FCOMPUTECELL_HPP
#define FCOMPUTECELL_HPP
// [--License--]


#include "../Utils/FComplexe.hpp"
#include "../Utils/FMemUtils.hpp"

#include "../Components/FBasicCell.hpp"

/**
* @author Berenger Bramas (berenger.bramas@inria.fr)
* @class FComputeCell
* Please read the license.
*
*/
class FComputeCell : public FBasicCell {
protected:
    static int DevP;
    static int ExpP;

    FComplexe* multipole_exp; //< For multipole extenssion
    FComplexe* local_exp;     //< For local extenssion

public:
    static void Init(const int inDevP){
        DevP = inDevP;
        ExpP = int((DevP+1) * (DevP+2) * 0.5);
    }

31
32
33
34
35
36
37
38
    static int GetP(){
        return DevP;
    }

    static int GetExp(){
        return ExpP;
    }

39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94

    /** Default constructor */
    FComputeCell()
        : multipole_exp(0), local_exp(0){
        multipole_exp = new FComplexe[ExpP];
        local_exp = new FComplexe[ExpP];
    }

    /** Constructor */
    FComputeCell(const FComputeCell& other)
        : multipole_exp(0), local_exp(0){
        multipole_exp = new FComplexe[ExpP];
        local_exp = new FComplexe[ExpP];
        (*this) = other;
    }

    /** Default destructor */
    virtual ~FComputeCell(){
        delete[] multipole_exp;
        delete[] local_exp;
    }

    /** Copy constructor */
    FComputeCell& operator=(const FComputeCell& other) {
        FMemUtils::copyall(multipole_exp, other.multipole_exp, ExpP);
        FMemUtils::copyall(local_exp, other.local_exp, ExpP);
        return *this;
    }

    /** Get Multipole */
    const FComplexe* getMultipole() const {
        return multipole_exp;
    }
    /** Get Local */
    const FComplexe* getLocal() const {
        return local_exp;
    }

    /** Get Multipole */
    FComplexe* getMultipole() {
        return multipole_exp;
    }
    /** Get Local */
    FComplexe* getLocal() {
        return local_exp;
    }
};


int FComputeCell::DevP(-1);
int FComputeCell::ExpP(-1);


#endif //FCOMPUTECELL_HPP

// [--END--]