v0.14.0
src
ftensor
tests
speed
little.cpp
Go to the documentation of this file.
1
#include "../../FTensor.hpp"
2
#include <iostream>
3
4
using namespace
FTensor
;
5
6
int
main
()
7
{
8
Tensor1<double, 3>
y(0, 1, 2);
9
10
// Tensor1<double,3> y(0,1,2);
11
Tensor1<double, 3>
x(2, 3, 4);
12
Tensor1<double, 3>
n
(5, 6, 7);
13
// Tensor2 t2(1,2,3,4,5,6,7,8,9);
14
// Tensor2 t2e(9,8,7,6,5,4,3,2,1);
15
// Tensor2_symmetric t2s(1,2,3,4,5,6);
16
// Tensor2_symmetric t2es(9,8,7,6,5,4);
17
18
const
Index<'i', 3>
i
;
19
// const Index<'j'> j;
20
// const Index<'k'> k;
21
22
// y(i)=-n(i)+2.0;
23
// y(i)+=n(i)-2.0;
24
// y(i)-=n(i)*2.0;
25
// y(i)+=2.0;
26
// y(i)-=2.0;
27
// y(i)*=2.0;
28
// y(i)/=2.0;
29
// x(i)=2.0+y(i)-n(i)/2.0;
30
// n(i)=2.0-y(i)+2.0*x(i);
31
// n(i)=-(y(i)+x(i))*n(i)*0.0+1.0;
32
// t2(i,j)=t2(i,j)+2.0*t2e(i,j)-t2(i,j)*2.0;
33
// t2e(i,j)=n(k)*n(i)*(-t2(k,j));
34
// x(i)=t2e(i,j)*n(j) - n(j)*t2e(i,j);
35
// n(i)=t2e(j,i)*n(j) - n(j)*t2e(j,i) + t2s(i,j)*y(j);
36
// n(i)+=(y(i)-x(i))-(y(i)-x(i))+(y(i)-x(i))-(y(i)-x(i))+(y(i)-x(i))-(y(i)-x(i))+(y(i)-x(i))-(y(i)-x(i))+(y(i)-x(i))-(y(i)-x(i))+(y(i)-x(i))-(y(i)-x(i))+(y(i)-x(i))-(y(i)-x(i))+(y(i)-x(i))-(y(i)-x(i));
37
// //
38
// n(i)=(y(i)-x(i))*(y(i)-x(i))*(y(i)-x(i))*(y(i)-x(i))*(y(i)-x(i))*(y(i)-x(i))*(y(i)-x(i))*(y(i)-x(i))*(y(i)-x(i))*(y(i)-x(i))*(y(i)-x(i))*(y(i)-x(i))*(y(i)-x(i))*(y(i)-x(i))*(y(i)-x(i))*(y(i)-x(i))/(n(i)*n(i)*n(i)*n(i)*n(i)*n(i)*n(i)*n(i)*n(i)*n(i)*n(i)*n(i)*n(i)*n(i)*n(i));
39
40
for
(
int
ii = 0; ii < 100000000; ii++)
41
{
42
// const Index<'i',3> i;
43
44
// n(i)+=(y(i)-x(i))-(y(i)-x(i))+(y(i)-x(i))-(y(i)-x(i))+(y(i)-x(i))-(y(i)-x(i))+(y(i)-x(i))-(y(i)-x(i))+(y(i)-x(i))-(y(i)-x(i))+(y(i)-x(i))-(y(i)-x(i))+(y(i)-x(i))-(y(i)-x(i))+(y(i)-x(i))-(y(i)-x(i));
45
46
// y(i)+=x(i)+n(i);
47
48
y(
i
) += (x(
i
) +
n
(
i
)) - (x(
i
) +
n
(
i
)) + (x(
i
) +
n
(
i
)) - (x(
i
) +
n
(
i
))
49
+ (x(
i
) +
n
(
i
))
50
// -(x(i)+n(i))+(x(i)+n(i))
51
// -(x(i)+n(i))+(x(i)+n(i))
52
// -(x(i)+n(i))+(x(i)+n(i))
53
// -(x(i)+n(i))+(x(i)+n(i))
54
// -(x(i)+n(i))+(x(i)+n(i))
55
// -(x(i)+n(i))+(x(i)+n(i))
56
// -(x(i)+n(i))+(x(i)+n(i))
57
// -(x(i)+n(i))+(x(i)+n(i))
58
// -(x(i)+n(i))+(x(i)+n(i))
59
// -(x(i)+n(i))+(x(i)+n(i))
60
// -(x(i)+n(i))+(x(i)+n(i))
61
;
62
}
63
std::cout << y(0) <<
" "
<< y(1) <<
" "
<< y(2) << std::endl;
64
// << x(0) << " " << x(1) << " " << x(2) << endl
65
// << n(0) << " " << n(1) << " " << n(2) << endl
66
// << y(i)*n(i) << endl;
67
}
FTensor
JSON compatible output.
Definition:
Christof_constructor.hpp:6
FTensor::Tensor1< double, 3 >
main
int main()
Definition:
little.cpp:6
i
FTensor::Index< 'i', SPACE_DIM > i
Definition:
hcurl_divergence_operator_2d.cpp:27
FTensor::Index< 'i', 3 >
convert.n
n
Definition:
convert.py:82
Generated by
Doxygen
1.8.17 and hosted at