Demonstration of the interpolated derivative of a vector field.
Demonstration of the interpolated derivative of a vector field.
#include <vector/CubicIpol.hpp>
#include <vector/LinearIpol.hpp>
#include <vector/MultiArray.hpp>
#include <vector/Interpolate.hpp>
#include <eagle/Vector.hpp>
#include <eagle/Matrix.hpp>
#include <eagle/QuadraticMatrix.hpp>
#include <time.h>
static int DemonstrateTensorDerivative()
{
enum { x=0, y=1, z=2 };
{
for(
double fr=0;
fr<2;
fr+=0.1)
{
cout <<
"Cubic interpolated derived tensor component Gmn,k " <<
point <<
" " <<
Gnm_k.eval() <<
endl
;
}
}
q = 5.1, 6.8, 5.03;
v = 0.01,0.02,.2;
for(int is = 0; is<40000; is++)
{
double ds = 0.001;
#ifndef EXPLICIT_CHRISTOFFEL_OPERATIONS
#if 0
#elif 0
{for(int j=0; j<3; j++)
for(int i=j; i<3; i++)
{
#if 1
#else
#if 1
#else
#endif
#if 0
#else
#endif
#endif
}
}
#endif
{for(int j=0; j<3; j++)
for(int i=j; i<3; i++)
for(int k=0; k<3; k++)
{
}
}
{for(int k=0; k<3; k++)
{
for(int j=0; j<3; j++)
{
for(int i=0; i<3; i++)
{
}
}
}
}
cout <<
" Coordinate Acceleration:" << a <<
endl;
#else
Chris.getAcceleration(a, v);
#endif
#pragma message "this next operator should work - CHECK!"
v += a*ds;
if (is %1000 == 0)
}
printf(
"Geodesic computation: %2.1f seconds\n", (
double)(finish - start) /
CLOCKS_PER_SEC );
cout <<
"Final: v="<<v<<
"\t q="<<q<<
endl;
cout <<
"EXPECT v=(0.00628477,0.088151,0.180334) q=(5.3987,9.70163,12.4076)" <<
endl;
return 1;
}
static int DemonstrateGeodesics()
{
enum { x=0, y=1, z=2 };
G[ MIndex(5,6,7) ] (2,2) = 2;
q = 5.1, 6.8, 5.03;
v = 0.01,0.02,.2;
v0 = v;
#if 0
#if 1
{
typedef Tensor* MetricStorage_t;
typedef double CoordinateType;
metric_type m = MetricField[0];
}
#else
{for(int is = 0; is<40000; is++)
{
double ds = 0.001;
Chris.getCoordinateAcceleration(a, v);
q += v*ds;
v += a*ds;
if (is %1000 == 0)
}}
printf(
"Geodesic computation: %2.1f seconds\n", (
double)(finish - start) /
CLOCKS_PER_SEC );
{for(int is = 0; is<40000; is++)
{
double ds = -0.001;
Chris.getCoordinateAcceleration(a, v);
q += v*ds;
v += a*ds;
if (is %1000 == 0)
}}
cout <<
"q=" << q <<
"\t q0=" <<
q0 <<
" Diff: " << q-
q0 <<
endl;
cout <<
"v=" << v <<
"\t v0=" << v0 <<
" Diff: " << v-v0 <<
endl;
#endif
#endif
return 1;
}
int dVInterpolCheck()
{
int r=0;
return r;
}
basic_ostream< _CharT, _Traits > & endl(basic_ostream< _CharT, _Traits > &__os)
Vectorized vector.
Definition VVector.hpp:288
An iterator with an optional DataCreator, which is just a class to intercept creation of data along a...
Definition CreativeIterator.hpp:34
double norm2(const PhysicalSpace::bivector &v)
Given a fragmented field of curvilinear coordinates, (3D array of coordinates), build a uniform Grid ...
Definition FAQ.dox:2