#ifndef TEMPUS_INITIALIZERS_H #define TEMPUS_INITIALIZERS_H #include "tnl/Vector.h" #include "tnl/VectorFunctions.h" #include "tnl/RecallableFunctions.h" #include "tnl/Grid.h" #include "tnl/tString.h" // // An old initializer that needs to be included for backwards compatibility. // #include "tnl/uniformGrid.h" // // The following includes were added to support FileGridC. // #include #include #include // // Create a Vector of length n having elements va1, val2, ... valn. // n must be less than 11. // Vector VecF(int n, float val1=0.0, float val2=0.0, float val3=0.0, float val4=0.0, float val5=0.0, float val6=0.0, float val7=0.0, float val8=0.0, float val9=0.0, float val10=0.0); // // Create a Vector of length n having elements va1, val2, ... valn. // n must be less than 11. // Vector VecI(int n, int val1=0, int val2=0, int val3=0, int val4=0, int val5=0, int val6=0, int val7=0, int val8=0, int val9=0, int val10=0); // // Create a Vector of length "n" having elements all set to zero. // Vector ZeroVecI(int n); Vector ZerosVecI(int n); Vector ZeroesVecI(int n); // // Create a Vector of length "n" having elements all set to 1. // Vector OnesVecI(int n); // // Create a Vector of length "n" having elements all set to "i". // Vector ConsVecI(int n, int i); // // Create a Vector of length "n" having elements. The first element // has value "first", the second "first+increment" and so on. // Vector IndexVecI(int n, int first=0, int increment=1); // // Create a Vector of length "n" having elements. All elements are // equal to zero, except for the element "ip" which is equal to "poke". // Vector PokeVecI(int n, int ip, int poke=1); // // Create a Vector of length "n" having elements all set to zero. // Vector ZeroVecF(int n); Vector ZerosVecF(int n); Vector ZeroesVecF(int n); // // Create a Vector of length "n" having elements all set to 1. // Vector OnesVecF(int n); // // Create a Vector of length "n" having elements all set to "f". // Vector ConsVecF(int n, float f); // // Create a Vector of length "n" having elements all set to NAN. // Vector NanVec(int n); // // Create a Vector of length "n" having elements. The first element // has value "first", the second "first+increment" and so on. // Vector IndexVecF(int n, float first=0.0, float increment=1.0); // // Create a Vector of length "n" having elements. All elements are // equal to zero, except for the element "ip" which is equal to "poke". // Vector PokeVecF(int n, int ip, float poke=1.0); // // Create a two-element Vector having elements a1 and a2. // Vector TwoVec(float a1, float a2); Vector TwoVecF(float a1, float a2); // // Create a Vector of length n having elements va1, val2, ... valn. // n must be less than 11. // Vector VecD(int n, double val1=0.0, double val2=0.0, double val3=0.0, double val4=0.0, double val5=0.0, double val6=0.0, double val7=0.0, double val8=0.0, double val9=0.0, double val10=0.0); // // Create a Vector of length "n" having elements all set to zero. // Vector ZeroVecD(int n); Vector ZerosVecD(int n); Vector ZeroesVecD(int n); // // Create a Vector of length "n" having elements all set to 1. // Vector OnesVecD(int n); // // Create a Vector of length "n" having elements all set to "d". // Vector ConsVecD(int n, double d); // // Create a Vector of length "n" having elements. The first element // has value "first", the second "first+increment" and so on. // Vector IndexVecD(int n, double first=0.0, double increment=1.0); // // Create a Vector of length "n" having elements. All elements are // equal to zero, except for the element "ip" which is equal to "poke". // Vector PokeVecD(int n, int ip, double poke=1.0); // // Create a two-element Vector having elements a1 and a2. // Vector TwoVecD(double a1, double a2); // // Create a Vector of length "n" having elements all set to (0,0). // Vector ZeroVecC(int n); Vector ZerosVecC(int n); Vector ZeroesVecC(int n); // // Create a Vector of length "n" having elements all set to (1,0). // Vector OnesVecC(int n); // // Create a Vector of length "n" having elements all set to (re, im). // Vector ConsVecC(int n, float re, float im=0.0); // // Create a Vector of length "n" having elements all set to "c". // Vector ConsVecC(int n, Complex c); // // Create a Vector of length "nx * ny" that is the x locations // of nx x ny grid points centered on the origin with spacing dx in x. // Vector MeshXVecF(int nx, int ny, float dx); // // Create a Vector of length "nx * ny" that is the y locations // of nx x ny grid points centered on the origin with spacing dy in y. // Vector MeshYVecF(int nx, int ny, float dy); // // Create a Grid having GridGeometry "gg" where the grid is set to (1,0). // TempGrid OnesGridC(GridGeometry gg); // // Create a Grid having GridGeometry "gg" where the grid is set to 1. // TempGrid OnesGridF(GridGeometry gg); // // Create a Grid having GridGeometry "gg" where the grid is set to (0,0). // TempGrid ZeroGridC(GridGeometry gg); // // Create a Grid having GridGeometry "gg" where the grid is set to 0. // TempGrid ZeroGridF(GridGeometry gg); // // Create a Grid on a grid which has sides of length "nxy" with spacing "dxy". // The origin in both directions is at "nxy/2" point. The entire grid is set to (1,0). // TempGrid OnesGridC(int nxy, float dxy); // // Create a Grid on a grid which has sides of length "nxy" with spacing "dxy". // The origin in both directions is at "nxy/2" point. The entire grid is set to 1. // TempGrid OnesGridF(int nxy, float dxy); // // Create a Grid on a grid which has sides of length "nxy" with spacing "dxy". // The origin in both directions is at "nxy/2" point. The entire grid is set to (0,0). // TempGrid ZeroGridC(int nxy, float dxy); // // Create a Grid on a grid which has sides of length "nxy" with spacing "dxy". // The origin in both directions is at "nxy/2" point. The entire grid is set to 0. // TempGrid ZeroGridF(int nxy, float dxy); // // Create a Grid of size "nx * ny" that is the x locations // of nx x ny grid points centered on the origin with spacing dx in x. // TempGrid MeshXGridF(int nx, int ny, float dx, float dy); // // Create a Grid of size "nx * ny" that is the y locations // of nx x ny grid points centered on the origin with spacing dy in y. // TempGrid MeshYGridF(int nx, int ny, float dx, float dy); // Populate the real and imaginary parts of a complex grid from two separate, // tab-delimited files of the same size. To export such a grid using Matlab, // for example, evaluate the following: // // re = real(grid); // im = imag(grid); // // save('re.txt', 're', '-ASCII', '-TABS') // save('im.txt', 'im', '-ASCII', '-TABS') // TempGrid FileGridC(const char* reFile, const char* imFile, int nx, int ny, double dx, double dy); // // Create a two-dimensional Array of dimension n x m. The values of the array // are specified by val1...val(n*m), where elements along the inner index are // are consecutive. // // For example, specify arrayFloat(2,3,11,14,12,15,13,16) to specify an array of // // 11 12 13 // 14 15 16 // // which is the same as the Matlab array [11,12,13;14,15,16] and is constent with // the Fortran indexing scheme. // Array arrayFloat(int n, int m, float val1=0.0, float val2=0.0, float val3=0.0, float val4=0.0, float val5=0.0, float val6=0.0, float val7=0.0, float val8=0.0, float val9=0.0, float val10=0.0, float val11=0.0, float val12=0.0, float val13=0.0, float val14=0.0, float val15=0.0, float val16=0.0, float val17=0.0, float val18=0.0, float val19=0.0, float val20=0.0, float val21=0.0, float val22=0.0, float val23=0.0, float val24=0.0, float val25=0.0, float val26=0.0, float val27=0.0, float val28=0.0, float val29=0.0, float val30=0.0, float val31=0.0, float val32=0.0, float val33=0.0, float val34=0.0, float val35=0.0, float val36=0.0, float val37=0.0, float val38=0.0, float val39=0.0, float val40=0.0, float val41=0.0, float val42=0.0, float val43=0.0, float val44=0.0, float val45=0.0, float val46=0.0, float val47=0.0, float val48=0.0, float val49=0.0, float val50=0.0, float val51=0.0, float val52=0.0, float val53=0.0, float val54=0.0, float val55=0.0, float val56=0.0, float val57=0.0, float val58=0.0, float val59=0.0, float val60=0.0, float val61=0.0, float val62=0.0, float val63=0.0, float val64=0.0, float val65=0.0, float val66=0.0, float val67=0.0, float val68=0.0, float val69=0.0, float val70=0.0, float val71=0.0, float val72=0.0, float val73=0.0, float val74=0.0, float val75=0.0, float val76=0.0, float val77=0.0, float val78=0.0, float val79=0.0, float val80=0.0, float val81=0.0, float val82=0.0, float val83=0.0, float val84=0.0, float val85=0.0, float val86=0.0, float val87=0.0, float val88=0.0, float val89=0.0, float val90=0.0, float val91=0.0, float val92=0.0, float val93=0.0, float val94=0.0, float val95=0.0, float val96=0.0, float val97=0.0, float val98=0.0, float val99=0.0, float val100=0.0); // Create a three-dimensional Array of dimension n x m x l. The values of the array // are specified by val1...val(n*m*l), where elements along the inner index are // are consecutive. Array arrayFloat3(int n, int m, int l, float val1=0.0, float val2=0.0, float val3=0.0, float val4=0.0, float val5=0.0, float val6=0.0, float val7=0.0, float val8=0.0, float val9=0.0, float val10=0.0, float val11=0.0, float val12=0.0, float val13=0.0, float val14=0.0, float val15=0.0, float val16=0.0, float val17=0.0, float val18=0.0, float val19=0.0, float val20=0.0, float val21=0.0, float val22=0.0, float val23=0.0, float val24=0.0, float val25=0.0, float val26=0.0, float val27=0.0, float val28=0.0, float val29=0.0, float val30=0.0, float val31=0.0, float val32=0.0, float val33=0.0, float val34=0.0, float val35=0.0, float val36=0.0, float val37=0.0, float val38=0.0, float val39=0.0, float val40=0.0, float val41=0.0, float val42=0.0, float val43=0.0, float val44=0.0, float val45=0.0, float val46=0.0, float val47=0.0, float val48=0.0, float val49=0.0, float val50=0.0, float val51=0.0, float val52=0.0, float val53=0.0, float val54=0.0, float val55=0.0, float val56=0.0, float val57=0.0, float val58=0.0, float val59=0.0, float val60=0.0, float val61=0.0, float val62=0.0, float val63=0.0, float val64=0.0, float val65=0.0, float val66=0.0, float val67=0.0, float val68=0.0, float val69=0.0, float val70=0.0, float val71=0.0, float val72=0.0, float val73=0.0, float val74=0.0, float val75=0.0, float val76=0.0, float val77=0.0, float val78=0.0, float val79=0.0, float val80=0.0, float val81=0.0, float val82=0.0, float val83=0.0, float val84=0.0, float val85=0.0, float val86=0.0, float val87=0.0, float val88=0.0, float val89=0.0, float val90=0.0, float val91=0.0, float val92=0.0, float val93=0.0, float val94=0.0, float val95=0.0, float val96=0.0, float val97=0.0, float val98=0.0, float val99=0.0, float val100=0.0); const tString PredataPath(const char *filename); #endif // TEMPUS_INITIALIZERS_H