Peano 4
Loading...
Searching...
No Matches
ElementMatrix.cpph
Go to the documentation of this file.
1template<int StencilSize>
5) {
7
8 for (int i=0; i<StencilSize; i++) {
9 for (int j=0; j<StencilSize; j++) {
10 result(i+j*StencilSize) = a(i) * b(j);
11 }
12 }
13
14 return result;
15}
16
17
18
19template<int StencilSize>
24) {
26
27 for (int i=0; i<StencilSize; i++) {
28 for (int j=0; j<StencilSize; j++) {
29 for (int k=0; k<StencilSize; k++) {
30 result(i+j*StencilSize+k*StencilSize*StencilSize) = a(i) * b(j) * c(k);
31 }
32 }
33 }
34
35 return result;
36}
And from this we can write down f$ nabla phi_i nabla phi_i dx but since we are constructing matrix let s investigate the f$ j
we integrate over each cell and then take the sum across each of the cells We also consider the terms that enter the f$ k
tarch::la::Vector< StencilSize *StencilSize, double > stencilProduct(const tarch::la::Vector< StencilSize, double > &a, const tarch::la::Vector< StencilSize, double > &b)
Simple vector class.
Definition Vector.h:134