CylindricalCoordinatesUnitTest.cpp File Reference
#include <Math/Vector.h>
#include <cstdio>
#include <Logger.h>
#include <Math/Matrix.h>

Functions

int main (int argc UNUSED, char *argv[] UNUSED)
 

Function Documentation

◆ main()

int main ( int argc  UNUSED,
char *argv[]  UNUSED 
)
31 {
32  Vec3D position(1,.5,0);
33  Vec3D velocity;
34  Matrix3D stress;
35 
36  //just to check that the magnitude of position does not matter
37  position *=2;
38 
39  //check velocity in radial direction
40  velocity = Vec3D(1,.5,0);
41  logger(INFO,"radial\tpos % \tvel % \tvel-cyl %",position,velocity,velocity.getCylindricalTensorField(position));
42 
43  //check velocity in angular direction
44  velocity = Vec3D(-.5,1,0);
45  logger(INFO,"angular\tpos % \tvel % \tvel-cyl %",position,velocity,velocity.getCylindricalTensorField(position));
46 
47  //check velocity in z direction
48  velocity = Vec3D(0,0,1);
49  logger(INFO,"z \tpos % \tvel % \tvel-cyl %",position,velocity,velocity.getCylindricalTensorField(position));
50 
51  //check stress in radial direction
52  velocity = Vec3D(1,.5,0);
53  stress = Matrix3D::dyadic(velocity,velocity);
54  logger(INFO,"radial\tpos % \tstress % \tstress-cyl %",position,stress,stress.getCylindricalTensorField(position));
55 
56  //check stress in angular direction
57  velocity = Vec3D(-.5,1,0);
58  stress = Matrix3D::dyadic(velocity,velocity);
59  logger(INFO,"angular\tpos % \tstress %\tstress-cyl %",position,stress,stress.getCylindricalTensorField(position));
60 
61  //check stress in z direction
62  velocity = Vec3D(0,0,1);
63  stress = Matrix3D::dyadic(velocity,velocity);
64  logger(INFO,"z \tpos % \tstress % \tstress-cyl %",position,stress,stress.getCylindricalTensorField(position));
65 
66 }
LL< Log::INFO > INFO
Info log level.
Definition: Logger.cc:55
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
Implementation of a 3D matrix.
Definition: Matrix.h:38
static Matrix3D dyadic(const Vec3D &a, const Vec3D &b)
Calculates the dyadic product of a two Vec3D: .
Definition: Matrix.cc:323
Matrix3D getCylindricalTensorField(const Vec3D &p) const
Returns the matrix in cylindrical coordinates.
Definition: Matrix.cc:394
Definition: Vector.h:51
Vec3D getCylindricalTensorField(const Vec3D &position) const
Returns this vector field at point p to cylindrical coordinates.
Definition: Vector.cc:261

References Matrix3D::dyadic(), Matrix3D::getCylindricalTensorField(), Vec3D::getCylindricalTensorField(), INFO, and logger.