├── docs ├── _doxygen │ ├── html │ │ └── .nojekyll │ ├── LOGO.png │ └── VM2D-Paper.pdf ├── _static │ ├── LOGO.png │ └── authors │ │ ├── Kobzar.jpg │ │ ├── Ryatina.jpg │ │ ├── Sokol.jpg │ │ ├── Gumirova.jpg │ │ ├── Izmailova.jpg │ │ ├── Kolganova.jpg │ │ ├── Shcheglov.jpg │ │ ├── Soldatova.jpg │ │ ├── Marchevsky.jpg │ │ ├── Serafimova.jpg │ │ └── Serebrovskaya.jpg ├── index.rst ├── index-ru.rst ├── 05_run-eng.rst └── 05_run.rst ├── src ├── VMlib │ ├── AirfoilGeometry │ │ ├── AirfoilGeometry.cpp │ │ └── AirfoilGeometry.h │ └── CMakeLists.txt ├── VMcuda │ ├── knn │ │ ├── knn.cu │ │ └── knn.cuh │ ├── intersection │ │ ├── lbvh │ │ │ ├── query.cuh │ │ │ └── utility.cuh │ │ ├── intersection.cuh │ │ └── lbvh.cuh │ ├── GPU │ │ └── ShiftKernels │ │ │ └── IncludeKer.cu │ ├── CMakeLists.txt │ └── operations │ │ └── types.cuh └── VM2D │ ├── Wake2D │ ├── knnOld.zip │ └── knnCPU-new.h │ ├── Gmres2D │ └── Gmres2D.cpp │ └── CMakeLists.txt ├── include ├── Eigen │ ├── Eigen │ ├── src │ │ ├── Core │ │ │ ├── util │ │ │ │ ├── NonMPL2.h │ │ │ │ ├── ReenableStupidWarnings.h │ │ │ │ └── ReshapedHelper.h │ │ │ ├── functors │ │ │ │ └── TernaryFunctors.h │ │ │ ├── arch │ │ │ │ ├── HIP │ │ │ │ │ └── hcc │ │ │ │ │ │ └── math_constants.h │ │ │ │ ├── AVX512 │ │ │ │ │ └── TypeCasting.h │ │ │ │ ├── Default │ │ │ │ │ ├── Settings.h │ │ │ │ │ └── ConjHelper.h │ │ │ │ └── NEON │ │ │ │ │ └── MathFunctions.h │ │ │ ├── DiagonalProduct.h │ │ │ └── SelfCwiseBinaryOp.h │ │ ├── misc │ │ │ ├── lapacke_mangling.h │ │ │ └── RealSvd2x2.h │ │ ├── SparseCore │ │ │ ├── SparseFuzzy.h │ │ │ └── SparseRedux.h │ │ └── SparseLU │ │ │ └── SparseLU_Utils.h │ ├── Dense │ ├── StdList │ ├── StdDeque │ ├── StdVector │ ├── Householder │ ├── Sparse │ ├── Jacobi │ ├── QtAlignedMalloc │ ├── MetisSupport │ ├── PardisoSupport │ ├── SPQRSupport │ ├── SparseQR │ ├── SparseCholesky │ ├── Cholesky │ ├── QR │ ├── UmfPackSupport │ ├── KLUSupport │ ├── LU │ ├── SVD │ ├── PaStiXSupport │ ├── SparseLU │ ├── Eigenvalues │ ├── CholmodSupport │ ├── Geometry │ └── IterativeLinearSolvers └── unsupported │ ├── test │ ├── FFT.cpp │ ├── cxx11_tensor_lvalue.cpp │ ├── cxx11_tensor_empty.cpp │ ├── matrix_square_root.cpp │ ├── cxx11_tensor_math.cpp │ ├── gmres.cpp │ ├── dgmres.cpp │ ├── cxx11_tensor_mixed_indices.cpp │ ├── cxx11_tensor_roundings.cpp │ ├── minres.cpp │ ├── cxx11_tensor_notification.cpp │ ├── cxx11_tensor_layout_swap.cpp │ ├── cxx11_tensor_const.cpp │ ├── cxx11_maxsizevector.cpp │ ├── cxx11_tensor_sugar.cpp │ ├── cxx11_tensor_move.cpp │ ├── cxx11_tensor_comparisons.cpp │ └── matrix_functions.h │ ├── doc │ ├── CMakeLists.txt │ ├── SYCL.dox │ ├── examples │ │ ├── MatrixExponential.cpp │ │ ├── MatrixPower.cpp │ │ ├── MatrixLogarithm.cpp │ │ ├── MatrixPower_optimal.cpp │ │ ├── MatrixSquareRoot.cpp │ │ ├── MatrixFunction.cpp │ │ ├── MatrixSine.cpp │ │ ├── MatrixSinh.cpp │ │ ├── PolynomialUtils1.cpp │ │ ├── CMakeLists.txt │ │ ├── SYCL │ │ │ └── CMakeLists.txt │ │ ├── EulerAngles.cpp │ │ └── BVH_Example.cpp │ ├── Overview.dox │ └── snippets │ │ └── CMakeLists.txt │ ├── Eigen │ ├── src │ │ ├── EulerAngles │ │ │ └── CMakeLists.txt │ │ └── NonLinearOptimization │ │ │ ├── r1mpyq.h │ │ │ ├── rwupdt.h │ │ │ ├── chkder.h │ │ │ └── covar.h │ ├── CXX11 │ │ ├── src │ │ │ ├── Tensor │ │ │ │ ├── TensorDeviceCuda.h │ │ │ │ ├── TensorReductionCuda.h │ │ │ │ ├── TensorContractionCuda.h │ │ │ │ ├── TensorGpuHipCudaUndefines.h │ │ │ │ └── TensorGlobalFunctions.h │ │ │ └── ThreadPool │ │ │ │ ├── ThreadYield.h │ │ │ │ ├── ThreadCancel.h │ │ │ │ ├── ThreadEnvironment.h │ │ │ │ ├── ThreadPoolInterface.h │ │ │ │ └── Barrier.h │ │ ├── CMakeLists.txt │ │ └── TensorSymmetry │ ├── MoreVectorization │ ├── CMakeLists.txt │ ├── ArpackSupport │ ├── Skyline │ ├── KroneckerProduct │ ├── Splines │ ├── EulerAngles │ ├── AutoDiff │ ├── LevenbergMarquardt │ ├── SparseExtra │ ├── IterativeSolvers │ └── NumericalDiff │ ├── CMakeLists.txt │ └── README.txt ├── settings ├── airfoils │ ├── V12.pfl │ ├── rhombic │ ├── bridgegLarsen │ ├── tacomagi │ ├── bridgegi │ ├── squareg │ ├── semicirc │ ├── circle20 │ ├── rect01Frolov36 │ └── rectFrolov-c025-n38 └── wakes │ ├── two_vortex │ ├── four_vortex │ └── one_vortex ├── run ├── batch ├── task ├── defaults ├── problems └── mechanics ├── .gitignore ├── .travis.yml ├── .readthedocs.yaml └── tutorials ├── tube ├── pointsVP └── passport ├── lamb └── passport ├── blasius └── passport ├── rotor └── passport ├── wingBase └── passport ├── blasius5k └── passport ├── squareGivenLaw └── passport ├── oscilCircle └── passport ├── circle200 └── passport ├── coupledProblem └── passport ├── twoCircle └── passport └── cylPlate └── passport /docs/_doxygen/html/.nojekyll: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/VMlib/AirfoilGeometry/AirfoilGeometry.cpp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /include/Eigen/Eigen: -------------------------------------------------------------------------------- 1 | #include "Dense" 2 | #include "Sparse" 3 | -------------------------------------------------------------------------------- /include/unsupported/test/FFT.cpp: -------------------------------------------------------------------------------- 1 | #define test_FFTW test_FFT 2 | #include "FFTW.cpp" 3 | -------------------------------------------------------------------------------- /docs/_doxygen/LOGO.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vortexmethods/VM2D/HEAD/docs/_doxygen/LOGO.png -------------------------------------------------------------------------------- /docs/_static/LOGO.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vortexmethods/VM2D/HEAD/docs/_static/LOGO.png -------------------------------------------------------------------------------- /src/VMcuda/knn/knn.cu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vortexmethods/VM2D/HEAD/src/VMcuda/knn/knn.cu -------------------------------------------------------------------------------- /settings/airfoils/V12.pfl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vortexmethods/VM2D/HEAD/settings/airfoils/V12.pfl -------------------------------------------------------------------------------- /src/VM2D/Wake2D/knnOld.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vortexmethods/VM2D/HEAD/src/VM2D/Wake2D/knnOld.zip -------------------------------------------------------------------------------- /docs/_doxygen/VM2D-Paper.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vortexmethods/VM2D/HEAD/docs/_doxygen/VM2D-Paper.pdf -------------------------------------------------------------------------------- /src/VM2D/Gmres2D/Gmres2D.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vortexmethods/VM2D/HEAD/src/VM2D/Gmres2D/Gmres2D.cpp -------------------------------------------------------------------------------- /docs/_static/authors/Kobzar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vortexmethods/VM2D/HEAD/docs/_static/authors/Kobzar.jpg -------------------------------------------------------------------------------- /docs/_static/authors/Ryatina.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vortexmethods/VM2D/HEAD/docs/_static/authors/Ryatina.jpg -------------------------------------------------------------------------------- /docs/_static/authors/Sokol.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vortexmethods/VM2D/HEAD/docs/_static/authors/Sokol.jpg -------------------------------------------------------------------------------- /docs/_static/authors/Gumirova.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vortexmethods/VM2D/HEAD/docs/_static/authors/Gumirova.jpg -------------------------------------------------------------------------------- /docs/_static/authors/Izmailova.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vortexmethods/VM2D/HEAD/docs/_static/authors/Izmailova.jpg -------------------------------------------------------------------------------- /docs/_static/authors/Kolganova.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vortexmethods/VM2D/HEAD/docs/_static/authors/Kolganova.jpg -------------------------------------------------------------------------------- /docs/_static/authors/Shcheglov.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vortexmethods/VM2D/HEAD/docs/_static/authors/Shcheglov.jpg -------------------------------------------------------------------------------- /docs/_static/authors/Soldatova.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vortexmethods/VM2D/HEAD/docs/_static/authors/Soldatova.jpg -------------------------------------------------------------------------------- /docs/_static/authors/Marchevsky.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vortexmethods/VM2D/HEAD/docs/_static/authors/Marchevsky.jpg -------------------------------------------------------------------------------- /docs/_static/authors/Serafimova.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vortexmethods/VM2D/HEAD/docs/_static/authors/Serafimova.jpg -------------------------------------------------------------------------------- /docs/_static/authors/Serebrovskaya.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vortexmethods/VM2D/HEAD/docs/_static/authors/Serebrovskaya.jpg -------------------------------------------------------------------------------- /src/VMcuda/intersection/lbvh/query.cuh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vortexmethods/VM2D/HEAD/src/VMcuda/intersection/lbvh/query.cuh -------------------------------------------------------------------------------- /include/Eigen/src/Core/util/NonMPL2.h: -------------------------------------------------------------------------------- 1 | #ifdef EIGEN_MPL2_ONLY 2 | #error Including non-MPL2 code in EIGEN_MPL2_ONLY mode 3 | #endif 4 | -------------------------------------------------------------------------------- /src/VMcuda/intersection/intersection.cuh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vortexmethods/VM2D/HEAD/src/VMcuda/intersection/intersection.cuh -------------------------------------------------------------------------------- /settings/airfoils/rhombic: -------------------------------------------------------------------------------- 1 | geometry = { 2 | {0.5, 0.0, c}, 3 | {0.0, 0.5, c}, 4 | {-0.5, 0.0, c}, 5 | {0.0, -0.5, c}, 6 | {0.5, 0.0, c} 7 | }; -------------------------------------------------------------------------------- /include/unsupported/doc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set_directory_properties(PROPERTIES EXCLUDE_FROM_ALL TRUE) 2 | 3 | add_subdirectory(examples) 4 | add_subdirectory(snippets) 5 | -------------------------------------------------------------------------------- /include/Eigen/Dense: -------------------------------------------------------------------------------- 1 | #include "Core" 2 | #include "LU" 3 | #include "Cholesky" 4 | #include "QR" 5 | #include "SVD" 6 | #include "Geometry" 7 | #include "Eigenvalues" 8 | -------------------------------------------------------------------------------- /include/unsupported/Eigen/src/EulerAngles/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB Eigen_EulerAngles_SRCS "*.h") 2 | 3 | install(FILES 4 | ${Eigen_EulerAngles_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen/src/EulerAngles COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /settings/airfoils/bridgegLarsen: -------------------------------------------------------------------------------- 1 | geometry={ 2 | { 15.5, 0.650, c}, 3 | { 13.5, 1.650, c}, 4 | { 0.0, 1.987, c}, 5 | {-13.5, 1.650, c}, 6 | {-15.5, 0.650, c}, 7 | { -9.5, -2.350, c}, 8 | { 0.0, -2.350, c}, 9 | { 9.5, -2.350, c}, 10 | { 15.5, 0.650, c} 11 | }; -------------------------------------------------------------------------------- /run/batch: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #SBATCH --job-name=Marchevsky_M70 3 | #SBATCH --time=48:00:00 4 | #SBATCH --nodes=1 --cpus-per-task=18 5 | #SBATCH --partition release 6 | ulimit -l unlimited 7 | # mpirun -n 1 echo $HOSTNAME 8 | mpirun -n 1 /nethome/student/FS18/FS2-x1/Izmailova/VM2D-06-06/build/VM2Dfix -------------------------------------------------------------------------------- /include/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceCuda.h: -------------------------------------------------------------------------------- 1 | 2 | #if defined(__clang__) || defined(__GNUC__) 3 | #warning "Deprecated header file, please either include the main Eigen/CXX11/Tensor header or the respective TensorDeviceGpu.h file" 4 | #endif 5 | 6 | #include "TensorDeviceGpu.h" 7 | -------------------------------------------------------------------------------- /include/unsupported/Eigen/CXX11/src/Tensor/TensorReductionCuda.h: -------------------------------------------------------------------------------- 1 | 2 | #if defined(__clang__) || defined(__GNUC__) 3 | #warning "Deprecated header file, please either include the main Eigen/CXX11/Tensor header or the respective TensorReductionGpu.h file" 4 | #endif 5 | 6 | #include "TensorReductionGpu.h" 7 | -------------------------------------------------------------------------------- /include/unsupported/Eigen/CXX11/src/Tensor/TensorContractionCuda.h: -------------------------------------------------------------------------------- 1 | 2 | #if defined(__clang__) || defined(__GNUC__) 3 | #warning "Deprecated header file, please either include the main Eigen/CXX11/Tensor header or the respective TensorContractionGpu.h file" 4 | #endif 5 | 6 | #include "TensorContractionGpu.h" 7 | -------------------------------------------------------------------------------- /run/task: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #PBS -N VM2D_User 3 | #PBS -S /bin/bash 4 | #PBS -l walltime=48:00:00 5 | #PBS -l nodes=2:ppn=12 6 | #PBS -q bl220 7 | #PBS -d /unicluster/home/guest13/VortTest/run 8 | 9 | cat $PBS_NODEFILE 10 | 11 | mpirun -machinefile $PBS_NODEFILE -np 2 -map-by slot:pe=12 VM2D > log.log 12 | -------------------------------------------------------------------------------- /src/VMcuda/intersection/lbvh.cuh: -------------------------------------------------------------------------------- 1 | #ifndef LBVH_LBVH_CUH 2 | #define LBVH_LBVH_CUH 3 | 4 | #include "lbvh/aabb.cuh" 5 | #include "lbvh/bvh.cuh" 6 | #include "lbvh/morton_code.cuh" 7 | #include "lbvh/predicator.cuh" 8 | #include "lbvh/query.cuh" 9 | #include "lbvh/utility.cuh" 10 | 11 | #endif// LBVH_LBVH_CUH 12 | -------------------------------------------------------------------------------- /include/unsupported/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(Eigen) 2 | add_subdirectory(doc EXCLUDE_FROM_ALL) 3 | if(BUILD_TESTING) 4 | if(EIGEN_LEAVE_TEST_IN_ALL_TARGET) 5 | add_subdirectory(test) # can't do EXCLUDE_FROM_ALL here, breaks CTest 6 | else() 7 | add_subdirectory(test EXCLUDE_FROM_ALL) 8 | endif() 9 | endif() 10 | -------------------------------------------------------------------------------- /src/VM2D/Wake2D/knnCPU-new.h: -------------------------------------------------------------------------------- 1 | #ifndef KNNCPUNEW_H 2 | #define KNNCPUNEW_H 3 | 4 | #include "Vortex2D.h" 5 | 6 | void WakekNNnew(const std::vector& vtx, const size_t k, std::vector>>& initdist, 7 | double cSP, double cRBP, double maxG, double epsCol, int type); 8 | 9 | 10 | #endif -------------------------------------------------------------------------------- /include/unsupported/Eigen/CXX11/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(Eigen_CXX11_HEADERS Tensor TensorSymmetry ThreadPool) 2 | 3 | install(FILES 4 | ${Eigen_CXX11_HEADERS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen/CXX11 COMPONENT Devel 6 | ) 7 | 8 | install(DIRECTORY src DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen/CXX11 COMPONENT Devel FILES_MATCHING PATTERN "*.h") 9 | -------------------------------------------------------------------------------- /include/unsupported/doc/SYCL.dox: -------------------------------------------------------------------------------- 1 | /** \page SYCL_EIGEN Eigen SYCL Backend 2 | 3 | Useful information for Eigen SYCL Backend: 4 | 5 | - Getting Started with Eigen 6 | 7 | - Options for Building Eigen SYCL 8 | 9 | */ 10 | -------------------------------------------------------------------------------- /src/VMcuda/knn/knn.cuh: -------------------------------------------------------------------------------- 1 | #ifndef KNN_CUH 2 | #define KNN_CUH 3 | 4 | #include 5 | #include "Vortex2D.h" 6 | 7 | 8 | class VectorsForKnn; 9 | 10 | void kNNcuda(const std::vector& vtx, 11 | const size_t k, 12 | std::vector>& initdist, 13 | VectorsForKnn*& vecForKnn, 14 | double cSP, double cRBP, double maxG, double epsCol, int typ); 15 | 16 | 17 | #endif //KNN_CUH -------------------------------------------------------------------------------- /settings/airfoils/tacomagi: -------------------------------------------------------------------------------- 1 | geometry={ 2 | {5.95, 0.00, c}, 3 | {5.95, 1.225, c}, 4 | {5.7, 1.225, c}, 5 | {5.7, 0.1, c}, 6 | {0.0, 0.1, c}, 7 | {-5.7, 0.1, c}, 8 | {-5.7, 1.225, c}, 9 | {-5.95, 1.225, c}, 10 | {-5.95, 0.0, c}, 11 | {-5.95, -1.225, c}, 12 | {-5.7, -1.225, c}, 13 | {-5.7, -0.1, c}, 14 | {0.0, -0.1, c}, 15 | {5.7, -0.1, c}, 16 | {5.7, -1.225, c}, 17 | {5.95, -1.225, c}, 18 | {5.95, 0.0, c} 19 | }; -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | 34 | # Folders 35 | build/ 36 | 37 | -------------------------------------------------------------------------------- /include/unsupported/doc/examples/MatrixExponential.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace Eigen; 5 | 6 | int main() 7 | { 8 | const double pi = std::acos(-1.0); 9 | 10 | MatrixXd A(3,3); 11 | A << 0, -pi/4, 0, 12 | pi/4, 0, 0, 13 | 0, 0, 0; 14 | std::cout << "The matrix A is:\n" << A << "\n\n"; 15 | std::cout << "The matrix exponential of A is:\n" << A.exp() << "\n\n"; 16 | } 17 | -------------------------------------------------------------------------------- /include/unsupported/doc/examples/MatrixPower.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace Eigen; 5 | 6 | int main() 7 | { 8 | const double pi = std::acos(-1.0); 9 | Matrix3d A; 10 | A << cos(1), -sin(1), 0, 11 | sin(1), cos(1), 0, 12 | 0 , 0 , 1; 13 | std::cout << "The matrix A is:\n" << A << "\n\n" 14 | "The matrix power A^(pi/4) is:\n" << A.pow(pi/4) << std::endl; 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /include/unsupported/doc/examples/MatrixLogarithm.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace Eigen; 5 | 6 | int main() 7 | { 8 | using std::sqrt; 9 | MatrixXd A(3,3); 10 | A << 0.5*sqrt(2), -0.5*sqrt(2), 0, 11 | 0.5*sqrt(2), 0.5*sqrt(2), 0, 12 | 0, 0, 1; 13 | std::cout << "The matrix A is:\n" << A << "\n\n"; 14 | std::cout << "The matrix logarithm of A is:\n" << A.log() << "\n"; 15 | } 16 | -------------------------------------------------------------------------------- /src/VMlib/AirfoilGeometry/AirfoilGeometry.h: -------------------------------------------------------------------------------- 1 | #ifndef AIRFOILGEOMETRY_H_ 2 | #define AIRFOILGEOMETRY_H_ 3 | 4 | #include "numvector.h" 5 | #include "Point2D.h" 6 | 7 | namespace VMlib 8 | { 9 | struct GeomPoint 10 | { 11 | //private: 12 | Point2D r; 13 | std::string type; 14 | //public: 15 | 16 | GeomPoint() {}; 17 | 18 | GeomPoint(const Point2D& _r, const std::string& _type) 19 | : r(_r), type(_type) { } 20 | 21 | ~GeomPoint() {}; 22 | }; 23 | } 24 | 25 | using VMlib::GeomPoint; 26 | 27 | #endif -------------------------------------------------------------------------------- /include/unsupported/doc/examples/MatrixPower_optimal.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace Eigen; 5 | 6 | int main() 7 | { 8 | Matrix4cd A = Matrix4cd::Random(); 9 | MatrixPower Apow(A); 10 | 11 | std::cout << "The matrix A is:\n" << A << "\n\n" 12 | "A^3.1 is:\n" << Apow(3.1) << "\n\n" 13 | "A^3.3 is:\n" << Apow(3.3) << "\n\n" 14 | "A^3.7 is:\n" << Apow(3.7) << "\n\n" 15 | "A^3.9 is:\n" << Apow(3.9) << std::endl; 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /include/unsupported/doc/examples/MatrixSquareRoot.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace Eigen; 5 | 6 | int main() 7 | { 8 | const double pi = std::acos(-1.0); 9 | 10 | MatrixXd A(2,2); 11 | A << cos(pi/3), -sin(pi/3), 12 | sin(pi/3), cos(pi/3); 13 | std::cout << "The matrix A is:\n" << A << "\n\n"; 14 | std::cout << "The matrix square root of A is:\n" << A.sqrt() << "\n\n"; 15 | std::cout << "The square of the last matrix is:\n" << A.sqrt() * A.sqrt() << "\n"; 16 | } 17 | -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | .. VM2D documentation master file, created by 2 | sphinx-quickstart on Fri Jul 16 00:03:46 2021. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | The VM2D code 7 | ============= 8 | 9 | .. toctree:: 10 | :maxdepth: 2 11 | :caption: User guide for the VM2D code: 12 | 13 | 01_installation-eng 14 | 02_syntax-eng 15 | 03_starting-eng 16 | 04_passport-eng 17 | 05_run-eng 18 | 19 | 20 | 21 | .. * :ref:`genindex` 22 | .. * :ref:`modindex` 23 | .. * :ref:`search` 24 | -------------------------------------------------------------------------------- /include/Eigen/src/misc/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | #ifndef LAPACK_HEADER_INCLUDED 2 | #define LAPACK_HEADER_INCLUDED 3 | 4 | #ifndef LAPACK_GLOBAL 5 | #if defined(LAPACK_GLOBAL_PATTERN_LC) || defined(ADD_) 6 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname##_ 7 | #elif defined(LAPACK_GLOBAL_PATTERN_UC) || defined(UPPER) 8 | #define LAPACK_GLOBAL(lcname,UCNAME) UCNAME 9 | #elif defined(LAPACK_GLOBAL_PATTERN_MC) || defined(NOCHANGE) 10 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname 11 | #else 12 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname##_ 13 | #endif 14 | #endif 15 | 16 | #endif 17 | 18 | -------------------------------------------------------------------------------- /docs/index-ru.rst: -------------------------------------------------------------------------------- 1 | .. VM2D documentation master file, created by 2 | sphinx-quickstart on Fri Jul 16 00:03:46 2021. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | Документация пользователя пакета VM2D 7 | ===================================== 8 | 9 | .. toctree:: 10 | :maxdepth: 2 11 | :caption: User guide for the VM2D code: 12 | 13 | 01_installation 14 | 02_syntax 15 | 03_starting 16 | 04_passport 17 | 05_run 18 | 19 | 20 | 21 | .. * :ref:`genindex` 22 | .. * :ref:`modindex` 23 | .. * :ref:`search` 24 | -------------------------------------------------------------------------------- /include/unsupported/doc/examples/MatrixFunction.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace Eigen; 5 | 6 | std::complex expfn(std::complex x, int) 7 | { 8 | return std::exp(x); 9 | } 10 | 11 | int main() 12 | { 13 | const double pi = std::acos(-1.0); 14 | 15 | MatrixXd A(3,3); 16 | A << 0, -pi/4, 0, 17 | pi/4, 0, 0, 18 | 0, 0, 0; 19 | 20 | std::cout << "The matrix A is:\n" << A << "\n\n"; 21 | std::cout << "The matrix exponential of A is:\n" 22 | << A.matrixFunction(expfn) << "\n\n"; 23 | } 24 | -------------------------------------------------------------------------------- /include/unsupported/doc/examples/MatrixSine.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace Eigen; 5 | 6 | int main() 7 | { 8 | MatrixXd A = MatrixXd::Random(3,3); 9 | std::cout << "A = \n" << A << "\n\n"; 10 | 11 | MatrixXd sinA = A.sin(); 12 | std::cout << "sin(A) = \n" << sinA << "\n\n"; 13 | 14 | MatrixXd cosA = A.cos(); 15 | std::cout << "cos(A) = \n" << cosA << "\n\n"; 16 | 17 | // The matrix functions satisfy sin^2(A) + cos^2(A) = I, 18 | // like the scalar functions. 19 | std::cout << "sin^2(A) + cos^2(A) = \n" << sinA*sinA + cosA*cosA << "\n\n"; 20 | } 21 | -------------------------------------------------------------------------------- /include/unsupported/doc/examples/MatrixSinh.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace Eigen; 5 | 6 | int main() 7 | { 8 | MatrixXf A = MatrixXf::Random(3,3); 9 | std::cout << "A = \n" << A << "\n\n"; 10 | 11 | MatrixXf sinhA = A.sinh(); 12 | std::cout << "sinh(A) = \n" << sinhA << "\n\n"; 13 | 14 | MatrixXf coshA = A.cosh(); 15 | std::cout << "cosh(A) = \n" << coshA << "\n\n"; 16 | 17 | // The matrix functions satisfy cosh^2(A) - sinh^2(A) = I, 18 | // like the scalar functions. 19 | std::cout << "cosh^2(A) - sinh^2(A) = \n" << coshA*coshA - sinhA*sinhA << "\n\n"; 20 | } 21 | -------------------------------------------------------------------------------- /src/VMcuda/GPU/ShiftKernels/IncludeKer.cu: -------------------------------------------------------------------------------- 1 | #include "ShiftKernels/SummKer1.cu" 2 | #include "ShiftKernels/SummKer2.cu" 3 | #include "ShiftKernels/SummKer3.cu" 4 | #include "ShiftKernels/SummKer4.cu" 5 | #include "ShiftKernels/SummKer5.cu" 6 | #include "ShiftKernels/SummKer6.cu" 7 | #include "ShiftKernels/SummKer7.cu" 8 | #include "ShiftKernels/SummKer8.cu" 9 | #include "ShiftKernels/SummKer9.cu" 10 | #include "ShiftKernels/SummKer10.cu" 11 | #include "ShiftKernels/SummKer11.cu" 12 | #include "ShiftKernels/SummKer12.cu" 13 | #include "ShiftKernels/SummKer13.cu" 14 | #include "ShiftKernels/SummKer14.cu" 15 | #include "ShiftKernels/SummKer15.cu" 16 | #include "ShiftKernels/SummKer16.cu" -------------------------------------------------------------------------------- /include/unsupported/Eigen/MoreVectorization: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla 6 | // Public License v. 2.0. If a copy of the MPL was not distributed 7 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | #ifndef EIGEN_MOREVECTORIZATION_MODULE_H 10 | #define EIGEN_MOREVECTORIZATION_MODULE_H 11 | 12 | #include "../../Eigen/Core" 13 | 14 | namespace Eigen { 15 | 16 | /** 17 | * \defgroup MoreVectorization More vectorization module 18 | */ 19 | 20 | } 21 | 22 | #include "src/MoreVectorization/MathFunctions.h" 23 | 24 | #endif // EIGEN_MOREVECTORIZATION_MODULE_H 25 | -------------------------------------------------------------------------------- /include/Eigen/src/Core/functors/TernaryFunctors.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2016 Eugene Brevdo 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_TERNARY_FUNCTORS_H 11 | #define EIGEN_TERNARY_FUNCTORS_H 12 | 13 | namespace Eigen { 14 | 15 | namespace internal { 16 | 17 | //---------- associative ternary functors ---------- 18 | 19 | 20 | 21 | } // end namespace internal 22 | 23 | } // end namespace Eigen 24 | 25 | #endif // EIGEN_TERNARY_FUNCTORS_H 26 | -------------------------------------------------------------------------------- /include/unsupported/doc/examples/PolynomialUtils1.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace Eigen; 5 | using namespace std; 6 | 7 | int main() 8 | { 9 | Vector4d roots = Vector4d::Random(); 10 | cout << "Roots: " << roots.transpose() << endl; 11 | Eigen::Matrix polynomial; 12 | roots_to_monicPolynomial( roots, polynomial ); 13 | cout << "Polynomial: "; 14 | for( int i=0; i<4; ++i ){ cout << polynomial[i] << ".x^" << i << "+ "; } 15 | cout << polynomial[4] << ".x^4" << endl; 16 | Vector4d evaluation; 17 | for( int i=0; i<4; ++i ){ 18 | evaluation[i] = poly_eval( polynomial, roots[i] ); } 19 | cout << "Evaluation of the polynomial at the roots: " << evaluation.transpose(); 20 | } 21 | -------------------------------------------------------------------------------- /include/unsupported/Eigen/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(Eigen_HEADERS 2 | AdolcForward 3 | AlignedVector3 4 | ArpackSupport 5 | AutoDiff 6 | BVH 7 | EulerAngles 8 | FFT 9 | IterativeSolvers 10 | KroneckerProduct 11 | LevenbergMarquardt 12 | MatrixFunctions 13 | MoreVectorization 14 | MPRealSupport 15 | NonLinearOptimization 16 | NumericalDiff 17 | OpenGLSupport 18 | Polynomials 19 | Skyline 20 | SparseExtra 21 | SpecialFunctions 22 | Splines 23 | ) 24 | 25 | install(FILES 26 | ${Eigen_HEADERS} 27 | DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen COMPONENT Devel 28 | ) 29 | 30 | install(DIRECTORY src DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen COMPONENT Devel FILES_MATCHING PATTERN "*.h") 31 | 32 | add_subdirectory(CXX11) 33 | -------------------------------------------------------------------------------- /include/Eigen/src/Core/arch/HIP/hcc/math_constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * math_constants.h - 3 | * HIP equivalent of the CUDA header of the same name 4 | */ 5 | 6 | #ifndef __MATH_CONSTANTS_H__ 7 | #define __MATH_CONSTANTS_H__ 8 | 9 | /* single precision constants */ 10 | 11 | #define HIPRT_INF_F __int_as_float(0x7f800000) 12 | #define HIPRT_NAN_F __int_as_float(0x7fffffff) 13 | #define HIPRT_MIN_DENORM_F __int_as_float(0x00000001) 14 | #define HIPRT_MAX_NORMAL_F __int_as_float(0x7f7fffff) 15 | #define HIPRT_NEG_ZERO_F __int_as_float(0x80000000) 16 | #define HIPRT_ZERO_F 0.0f 17 | #define HIPRT_ONE_F 1.0f 18 | 19 | /* double precision constants */ 20 | #define HIPRT_INF __hiloint2double(0x7ff00000, 0x00000000) 21 | #define HIPRT_NAN __hiloint2double(0xfff80000, 0x00000000) 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /include/Eigen/StdList: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Hauke Heibel 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_STDLIST_MODULE_H 11 | #define EIGEN_STDLIST_MODULE_H 12 | 13 | #include "Core" 14 | #include 15 | 16 | #if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes in 64 bit builds */ 17 | 18 | #define EIGEN_DEFINE_STL_LIST_SPECIALIZATION(...) 19 | 20 | #else 21 | 22 | #include "src/StlSupport/StdList.h" 23 | 24 | #endif 25 | 26 | #endif // EIGEN_STDLIST_MODULE_H 27 | -------------------------------------------------------------------------------- /include/unsupported/Eigen/CXX11/src/ThreadPool/ThreadYield.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2016 Benoit Steiner 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_CXX11_THREADPOOL_THREAD_YIELD_H 11 | #define EIGEN_CXX11_THREADPOOL_THREAD_YIELD_H 12 | 13 | // Try to come up with a portable way to yield 14 | #if EIGEN_COMP_GNUC && EIGEN_GNUC_AT_MOST(4, 7) 15 | #define EIGEN_THREAD_YIELD() sched_yield() 16 | #else 17 | #define EIGEN_THREAD_YIELD() std::this_thread::yield() 18 | #endif 19 | 20 | #endif // EIGEN_CXX11_THREADPOOL_THREAD_YIELD_H 21 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # This will run on Travis' 'new' container-based infrastructure 2 | sudo: false 3 | 4 | # Blacklist 5 | branches: 6 | only: 7 | - master 8 | 9 | # Install dependencies 10 | addons: 11 | apt: 12 | packages: 13 | - doxygen 14 | - doxygen-doc 15 | - doxygen-latex 16 | - doxygen-gui 17 | - graphviz 18 | 19 | # Build your code e.g. by calling make 20 | script: 21 | - cd docs 22 | - cd _doxygen 23 | # - touch .nojekyll 24 | - doxygen Doxyfile 2>&1 | tee doxygen.log 25 | # - echo $TRAVIS_BUILD_DIR 26 | # - cd $TRAVIS_BUILD_DIR 27 | # - pwd 28 | # - ls 29 | 30 | # Deploy using travis builtin GitHub Pages support 31 | deploy: 32 | provider: pages 33 | skip_cleanup: true 34 | local-dir: docs/_doxygen/html 35 | github_token: $GITHUB_TOKEN # Set in travis-ci.org dashboard 36 | on: 37 | branch: master -------------------------------------------------------------------------------- /include/unsupported/doc/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB examples_SRCS "*.cpp") 2 | 3 | add_custom_target(unsupported_examples) 4 | 5 | include_directories(../../../unsupported ../../../unsupported/test) 6 | 7 | foreach(example_src ${examples_SRCS}) 8 | get_filename_component(example ${example_src} NAME_WE) 9 | add_executable(example_${example} ${example_src}) 10 | if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO) 11 | target_link_libraries(example_${example} ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO}) 12 | endif() 13 | add_custom_command( 14 | TARGET example_${example} 15 | POST_BUILD 16 | COMMAND example_${example} 17 | ARGS >${CMAKE_CURRENT_BINARY_DIR}/${example}.out 18 | ) 19 | add_dependencies(unsupported_examples example_${example}) 20 | endforeach(example_src) 21 | 22 | if(EIGEN_TEST_SYCL) 23 | add_subdirectory(SYCL) 24 | endif(EIGEN_TEST_SYCL) 25 | -------------------------------------------------------------------------------- /include/unsupported/Eigen/CXX11/src/ThreadPool/ThreadCancel.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2016 Benoit Steiner 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_CXX11_THREADPOOL_THREAD_CANCEL_H 11 | #define EIGEN_CXX11_THREADPOOL_THREAD_CANCEL_H 12 | 13 | // Try to come up with a portable way to cancel a thread 14 | #if EIGEN_OS_GNULINUX 15 | #define EIGEN_THREAD_CANCEL(t) \ 16 | pthread_cancel(t.native_handle()); 17 | #define EIGEN_SUPPORTS_THREAD_CANCELLATION 1 18 | #else 19 | #define EIGEN_THREAD_CANCEL(t) 20 | #endif 21 | 22 | 23 | #endif // EIGEN_CXX11_THREADPOOL_THREAD_CANCEL_H 24 | -------------------------------------------------------------------------------- /include/Eigen/StdDeque: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Gael Guennebaud 5 | // Copyright (C) 2009 Hauke Heibel 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_STDDEQUE_MODULE_H 12 | #define EIGEN_STDDEQUE_MODULE_H 13 | 14 | #include "Core" 15 | #include 16 | 17 | #if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes in 64 bit builds */ 18 | 19 | #define EIGEN_DEFINE_STL_DEQUE_SPECIALIZATION(...) 20 | 21 | #else 22 | 23 | #include "src/StlSupport/StdDeque.h" 24 | 25 | #endif 26 | 27 | #endif // EIGEN_STDDEQUE_MODULE_H 28 | -------------------------------------------------------------------------------- /include/Eigen/StdVector: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Gael Guennebaud 5 | // Copyright (C) 2009 Hauke Heibel 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_STDVECTOR_MODULE_H 12 | #define EIGEN_STDVECTOR_MODULE_H 13 | 14 | #include "Core" 15 | #include 16 | 17 | #if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes in 64 bit builds */ 18 | 19 | #define EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(...) 20 | 21 | #else 22 | 23 | #include "src/StlSupport/StdVector.h" 24 | 25 | #endif 26 | 27 | #endif // EIGEN_STDVECTOR_MODULE_H 28 | -------------------------------------------------------------------------------- /src/VMcuda/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | link_directories(${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) 2 | 3 | SUBDIRLIST(VMcudasubdir_VMcuda ${CMAKE_CURRENT_SOURCE_DIR}) 4 | SUBDIRLIST(VMcudasubdir_VMlib ${CMAKE_SOURCE_DIR}/src/VMlib) 5 | LIST(APPEND VMcudadirs ${VMcudasubdir_VMcuda} ${VMcudasubdir_VMlib}) 6 | 7 | #message(STATUS "VMcuda_dirs: ${VMcudadirs}") 8 | 9 | include_directories(${CMAKE_SOURCE_DIR}/include) 10 | include_directories(${VMcudadirs}) 11 | 12 | include_directories(${CUDA_INCLUDE_DIRS}) 13 | 14 | FILE(GLOB VMcuda_ALLFILES 15 | ${CMAKE_CURRENT_SOURCE_DIR}/*/*.cpp 16 | ${CMAKE_CURRENT_SOURCE_DIR}/*/*.h 17 | ${CMAKE_CURRENT_SOURCE_DIR}/*/*.cu 18 | ${CMAKE_CURRENT_SOURCE_DIR}/*/*.cuh 19 | ) 20 | 21 | #CUDA 22 | if (CMAKE_CUDA_COMPILER) 23 | add_library(VMcuda ${VMcuda_ALLFILES}) 24 | set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} --expt-extended-lambda --expt-relaxed-constexpr") 25 | set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --expt-extended-lambda --expt-relaxed-constexpr") 26 | endif() -------------------------------------------------------------------------------- /include/Eigen/Householder: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_HOUSEHOLDER_MODULE_H 9 | #define EIGEN_HOUSEHOLDER_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** \defgroup Householder_Module Householder module 16 | * This module provides Householder transformations. 17 | * 18 | * \code 19 | * #include 20 | * \endcode 21 | */ 22 | 23 | #include "src/Householder/Householder.h" 24 | #include "src/Householder/HouseholderSequence.h" 25 | #include "src/Householder/BlockHouseholder.h" 26 | 27 | #include "src/Core/util/ReenableStupidWarnings.h" 28 | 29 | #endif // EIGEN_HOUSEHOLDER_MODULE_H 30 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 31 | -------------------------------------------------------------------------------- /include/unsupported/doc/Overview.dox: -------------------------------------------------------------------------------- 1 | /// \brief Namespace containing all symbols from the %Eigen library. 2 | namespace Eigen { 3 | 4 | /** \mainpage %Eigen's unsupported modules 5 | 6 | This is the API documentation for %Eigen's unsupported modules. 7 | 8 | These modules are contributions from various users. They are provided "as is", without any support. 9 | 10 | Click on the \e Modules tab at the top of this page to get a list of all unsupported modules. 11 | 12 | Don't miss the official Eigen documentation. 13 | 14 | \subpage SYCL_EIGEN "SYCL backend for Eigen" 15 | 16 | */ 17 | 18 | /* 19 | 20 | \defgroup Unsupported_modules Unsupported modules 21 | 22 | The unsupported modules are contributions from various users. They are 23 | provided "as is", without any support. Nevertheless, some of them are 24 | subject to be included in %Eigen in the future. 25 | 26 | */ 27 | 28 | /// \internal \brief Namespace containing low-level routines from the %Eigen library. 29 | namespace internal {} 30 | } 31 | 32 | -------------------------------------------------------------------------------- /include/Eigen/Sparse: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_SPARSE_MODULE_H 9 | #define EIGEN_SPARSE_MODULE_H 10 | 11 | /** \defgroup Sparse_Module Sparse meta-module 12 | * 13 | * Meta-module including all related modules: 14 | * - \ref SparseCore_Module 15 | * - \ref OrderingMethods_Module 16 | * - \ref SparseCholesky_Module 17 | * - \ref SparseLU_Module 18 | * - \ref SparseQR_Module 19 | * - \ref IterativeLinearSolvers_Module 20 | * 21 | \code 22 | #include 23 | \endcode 24 | */ 25 | 26 | #include "SparseCore" 27 | #include "OrderingMethods" 28 | #include "SparseCholesky" 29 | #include "SparseLU" 30 | #include "SparseQR" 31 | #include "IterativeLinearSolvers" 32 | 33 | #endif // EIGEN_SPARSE_MODULE_H 34 | 35 | -------------------------------------------------------------------------------- /include/Eigen/Jacobi: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_JACOBI_MODULE_H 9 | #define EIGEN_JACOBI_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** \defgroup Jacobi_Module Jacobi module 16 | * This module provides Jacobi and Givens rotations. 17 | * 18 | * \code 19 | * #include 20 | * \endcode 21 | * 22 | * In addition to listed classes, it defines the two following MatrixBase methods to apply a Jacobi or Givens rotation: 23 | * - MatrixBase::applyOnTheLeft() 24 | * - MatrixBase::applyOnTheRight(). 25 | */ 26 | 27 | #include "src/Jacobi/Jacobi.h" 28 | 29 | #include "src/Core/util/ReenableStupidWarnings.h" 30 | 31 | #endif // EIGEN_JACOBI_MODULE_H 32 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 33 | 34 | -------------------------------------------------------------------------------- /include/unsupported/Eigen/ArpackSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla 6 | // Public License v. 2.0. If a copy of the MPL was not distributed 7 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | #ifndef EIGEN_ARPACKSUPPORT_MODULE_H 10 | #define EIGEN_ARPACKSUPPORT_MODULE_H 11 | 12 | #include "../../Eigen/Core" 13 | 14 | /** \defgroup ArpackSupport_Module Arpack support module 15 | * 16 | * This module provides a wrapper to Arpack, a library for sparse eigenvalue decomposition. 17 | * 18 | * \code 19 | * #include 20 | * \endcode 21 | */ 22 | 23 | #include "../../Eigen/SparseCholesky" 24 | 25 | #include "../../Eigen/src/Core/util/DisableStupidWarnings.h" 26 | #include "src/Eigenvalues/ArpackSelfAdjointEigenSolver.h" 27 | 28 | #include "../../Eigen/src/Core/util/ReenableStupidWarnings.h" 29 | 30 | #endif // EIGEN_ARPACKSUPPORT_MODULE_H 31 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 32 | -------------------------------------------------------------------------------- /settings/wakes/two_vortex: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- VM2D -*-----------------*---------------*\ 2 | | ## ## ## ## #### ##### | | Version 1.12 | 3 | | ## ## ### ### ## ## ## ## | VM2D: Vortex Method | 2024/01/14 | 4 | | ## ## ## # ## ## ## ## | for 2D Flow Simulation *----------------* 5 | | #### ## ## ## ## ## | Open Source Code | 6 | | ## ## ## ###### ##### | https://www.github.com/vortexmethods/VM2D | 7 | | | 8 | | Copyright (C) 2017-2024 I. Marchevsky, K. Sokol, E. Ryatina, A. Kolganova | 9 | *-----------------------------------------------------------------------------* 10 | | File name: two_vortex | 11 | | Info: Two vortices near circular airfoil | 12 | \*---------------------------------------------------------------------------*/ 13 | 14 | vtx = { 15 | {0.51, 0.0, 0.00005}, 16 | {0.51, 0.001, 0.00006}, 17 | }; -------------------------------------------------------------------------------- /settings/airfoils/bridgegi: -------------------------------------------------------------------------------- 1 | geometry={ 2 | {15.3211, -0.149443, i}, 3 | {15.3615, -0.112573, i}, 4 | {15.3764, -0.06, i}, 5 | {15.3615, -0.00742689, i}, 6 | {15.3211, 0.0294427, i}, 7 | {13.5199, 0.93003, i}, 8 | {13.5099, 0.934388, i}, 9 | {13.4994, 0.937618, i}, 10 | {13.4886, 0.939683, i}, 11 | {13.4777, 0.940556, i}, 12 | {0.00249552, 1.27694, i}, 13 | {0.00124786, 1.27696, i}, 14 | {0.0, 1.27697, i}, 15 | {-0.00124786, 1.27696, i}, 16 | {-0.00249552, 1.27694, i}, 17 | {-13.4777, 0.940556, i}, 18 | {-13.4886, 0.939683, i}, 19 | {-13.4994, 0.937618, i}, 20 | {-13.5099, 0.934388, i}, 21 | {-13.5199, 0.93003, i}, 22 | {-15.3211, 0.0294427, i}, 23 | {-15.3615, -0.00742689, i}, 24 | {-15.3764, -0.06, i}, 25 | {-15.3615, -0.112573, i}, 26 | {-15.3211, -0.149443, i}, 27 | {-9.52111, -3.04944, i}, 28 | {-9.51047, -3.05401, i}, 29 | {-9.49937, -3.05732, i}, 30 | {-9.48796, -3.05933, i}, 31 | {-9.47639, -3.06, i}, 32 | {0., -3.06, i}, 33 | {9.47639, -3.06, i}, 34 | {9.48796, -3.05933, i}, 35 | {9.49937, -3.05732, i}, 36 | {9.51047, -3.05401, i}, 37 | {9.52111, -3.04944, i} 38 | }; -------------------------------------------------------------------------------- /include/unsupported/Eigen/Skyline: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla 6 | // Public License v. 2.0. If a copy of the MPL was not distributed 7 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | #ifndef EIGEN_SKYLINE_MODULE_H 10 | #define EIGEN_SKYLINE_MODULE_H 11 | 12 | 13 | #include "../../Eigen/Core" 14 | 15 | #include "../../Eigen/src/Core/util/DisableStupidWarnings.h" 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | /** 23 | * \defgroup Skyline_Module Skyline module 24 | * 25 | * 26 | * 27 | * 28 | */ 29 | 30 | #include "src/Skyline/SkylineUtil.h" 31 | #include "src/Skyline/SkylineMatrixBase.h" 32 | #include "src/Skyline/SkylineStorage.h" 33 | #include "src/Skyline/SkylineMatrix.h" 34 | #include "src/Skyline/SkylineInplaceLU.h" 35 | #include "src/Skyline/SkylineProduct.h" 36 | 37 | #include "../../Eigen/src/Core/util/ReenableStupidWarnings.h" 38 | 39 | #endif // EIGEN_SKYLINE_MODULE_H 40 | -------------------------------------------------------------------------------- /include/unsupported/Eigen/KroneckerProduct: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla 6 | // Public License v. 2.0. If a copy of the MPL was not distributed 7 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | #ifndef EIGEN_KRONECKER_PRODUCT_MODULE_H 10 | #define EIGEN_KRONECKER_PRODUCT_MODULE_H 11 | 12 | #include "../../Eigen/Core" 13 | 14 | #include "../../Eigen/src/Core/util/DisableStupidWarnings.h" 15 | 16 | #include "../../Eigen/src/SparseCore/SparseUtil.h" 17 | 18 | namespace Eigen { 19 | 20 | /** 21 | * \defgroup KroneckerProduct_Module KroneckerProduct module 22 | * 23 | * This module contains an experimental Kronecker product implementation. 24 | * 25 | * \code 26 | * #include 27 | * \endcode 28 | */ 29 | 30 | } // namespace Eigen 31 | 32 | #include "src/KroneckerProduct/KroneckerTensorProduct.h" 33 | 34 | #include "../../Eigen/src/Core/util/ReenableStupidWarnings.h" 35 | 36 | #endif // EIGEN_KRONECKER_PRODUCT_MODULE_H 37 | -------------------------------------------------------------------------------- /include/Eigen/src/Core/DiagonalProduct.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008 Gael Guennebaud 5 | // Copyright (C) 2007-2009 Benoit Jacob 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_DIAGONALPRODUCT_H 12 | #define EIGEN_DIAGONALPRODUCT_H 13 | 14 | namespace Eigen { 15 | 16 | /** \returns the diagonal matrix product of \c *this by the diagonal matrix \a diagonal. 17 | */ 18 | template 19 | template 20 | EIGEN_DEVICE_FUNC inline const Product 21 | MatrixBase::operator*(const DiagonalBase &a_diagonal) const 22 | { 23 | return Product(derived(),a_diagonal.derived()); 24 | } 25 | 26 | } // end namespace Eigen 27 | 28 | #endif // EIGEN_DIAGONALPRODUCT_H 29 | -------------------------------------------------------------------------------- /include/Eigen/QtAlignedMalloc: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_QTMALLOC_MODULE_H 9 | #define EIGEN_QTMALLOC_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #if (!EIGEN_MALLOC_ALREADY_ALIGNED) 14 | 15 | #include "src/Core/util/DisableStupidWarnings.h" 16 | 17 | void *qMalloc(std::size_t size) 18 | { 19 | return Eigen::internal::aligned_malloc(size); 20 | } 21 | 22 | void qFree(void *ptr) 23 | { 24 | Eigen::internal::aligned_free(ptr); 25 | } 26 | 27 | void *qRealloc(void *ptr, std::size_t size) 28 | { 29 | void* newPtr = Eigen::internal::aligned_malloc(size); 30 | std::memcpy(newPtr, ptr, size); 31 | Eigen::internal::aligned_free(ptr); 32 | return newPtr; 33 | } 34 | 35 | #include "src/Core/util/ReenableStupidWarnings.h" 36 | 37 | #endif 38 | 39 | #endif // EIGEN_QTMALLOC_MODULE_H 40 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 41 | -------------------------------------------------------------------------------- /include/Eigen/MetisSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_METISSUPPORT_MODULE_H 9 | #define EIGEN_METISSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | extern "C" { 16 | #include 17 | } 18 | 19 | 20 | /** \ingroup Support_modules 21 | * \defgroup MetisSupport_Module MetisSupport module 22 | * 23 | * \code 24 | * #include 25 | * \endcode 26 | * This module defines an interface to the METIS reordering package (http://glaros.dtc.umn.edu/gkhome/views/metis). 27 | * It can be used just as any other built-in method as explained in \link OrderingMethods_Module here. \endlink 28 | */ 29 | 30 | 31 | #include "src/MetisSupport/MetisSupport.h" 32 | 33 | #include "src/Core/util/ReenableStupidWarnings.h" 34 | 35 | #endif // EIGEN_METISSUPPORT_MODULE_H 36 | -------------------------------------------------------------------------------- /settings/wakes/four_vortex: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- VM2D -*-----------------*---------------*\ 2 | | ## ## ## ## #### ##### | | Version 1.12 | 3 | | ## ## ### ### ## ## ## ## | VM2D: Vortex Method | 2024/01/14 | 4 | | ## ## ## # ## ## ## ## | for 2D Flow Simulation *----------------* 5 | | #### ## ## ## ## ## | Open Source Code | 6 | | ## ## ## ###### ##### | https://www.github.com/vortexmethods/VM2D | 7 | | | 8 | | Copyright (C) 2017-2024 I. Marchevsky, K. Sokol, E. Ryatina, A. Kolganova | 9 | *-----------------------------------------------------------------------------* 10 | | File name: four_vortex | 11 | | Info: Four vortices near circular airfoil | 12 | \*---------------------------------------------------------------------------*/ 13 | 14 | vtx = { 15 | {0.50999, 0.0, 0.000025}, 16 | {0.51001, 0.0, 0.000025}, 17 | 18 | {0.50999, 0.001, 0.000030}, 19 | {0.51001, 0.001, 0.000030}, 20 | }; -------------------------------------------------------------------------------- /settings/wakes/one_vortex: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- VM2D -*-----------------*---------------*\ 2 | | ## ## ## ## #### ##### | | Version 1.12 | 3 | | ## ## ### ### ## ## ## ## | VM2D: Vortex Method | 2024/01/14 | 4 | | ## ## ## # ## ## ## ## | for 2D Flow Simulation *----------------* 5 | | #### ## ## ## ## ## | Open Source Code | 6 | | ## ## ## ###### ##### | https://www.github.com/vortexmethods/VM2D | 7 | | | 8 | | Copyright (C) 2017-2024 I. Marchevsky, K. Sokol, E. Ryatina, A. Kolganova | 9 | *-----------------------------------------------------------------------------* 10 | | File name: one_vortex | 11 | | Info: One vortex near circular airfoil | 12 | \*---------------------------------------------------------------------------*/ 13 | 14 | vtx = { 15 | {0.35, 0.4, 0.1}, 16 | {0.35000001, 0.40000001, 0.0}, 17 | {0.35000002, 0.40000002, 0.0}, 18 | {0.35000003, 0.40000003, 0.0}, 19 | }; -------------------------------------------------------------------------------- /include/unsupported/Eigen/Splines: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 20010-2011 Hauke Heibel 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPLINES_MODULE_H 11 | #define EIGEN_SPLINES_MODULE_H 12 | 13 | namespace Eigen 14 | { 15 | /** 16 | * \defgroup Splines_Module Spline and spline fitting module 17 | * 18 | * This module provides a simple multi-dimensional spline class while 19 | * offering most basic functionality to fit a spline to point sets. 20 | * 21 | * \code 22 | * #include 23 | * \endcode 24 | */ 25 | } 26 | 27 | #include "../../Eigen/src/Core/util/DisableStupidWarnings.h" 28 | 29 | #include "src/Splines/SplineFwd.h" 30 | #include "src/Splines/Spline.h" 31 | #include "src/Splines/SplineFitting.h" 32 | 33 | #include "../../Eigen/src/Core/util/ReenableStupidWarnings.h" 34 | 35 | #endif // EIGEN_SPLINES_MODULE_H 36 | -------------------------------------------------------------------------------- /include/unsupported/test/cxx11_tensor_lvalue.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2014 Benoit Steiner 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #include "main.h" 11 | 12 | #include 13 | 14 | using Eigen::Tensor; 15 | using Eigen::RowMajor; 16 | 17 | 18 | static void test_compound_assignment() 19 | { 20 | Tensor mat1(2,3,7); 21 | Tensor mat2(2,3,7); 22 | Tensor mat3(2,3,7); 23 | 24 | mat1.setRandom(); 25 | mat2.setRandom(); 26 | mat3 = mat1; 27 | mat3 += mat2; 28 | 29 | for (int i = 0; i < 2; ++i) { 30 | for (int j = 0; j < 3; ++j) { 31 | for (int k = 0; k < 7; ++k) { 32 | VERIFY_IS_APPROX(mat3(i,j,k), mat1(i,j,k) + mat2(i,j,k)); 33 | } 34 | } 35 | } 36 | } 37 | 38 | 39 | EIGEN_DECLARE_TEST(cxx11_tensor_lvalue) 40 | { 41 | CALL_SUBTEST(test_compound_assignment()); 42 | } 43 | -------------------------------------------------------------------------------- /settings/airfoils/squareg: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- VM2D -*-----------------*---------------*\ 2 | | ## ## ## ## #### ##### | | Version 1.12 | 3 | | ## ## ### ### ## ## ## ## | VM2D: Vortex Method | 2024/01/14 | 4 | | ## ## ## # ## ## ## ## | for 2D Flow Simulation *----------------* 5 | | #### ## ## ## ## ## | Open Source Code | 6 | | ## ## ## ###### ##### | https://www.github.com/vortexmethods/VM2D | 7 | | | 8 | | Copyright (C) 2017-2024 I. Marchevsky, K. Sokol, E. Ryatina, A. Kolganova | 9 | *-----------------------------------------------------------------------------* 10 | | File name: square | 11 | | Info: Square airfoil | 12 | \*---------------------------------------------------------------------------*/ 13 | 14 | geometry = { 15 | {0.5, 0.0, c}, 16 | {0.5, 0.5, c}, 17 | {-0.5, 0.5, c}, 18 | {-0.5, 0.0, c}, 19 | {-0.5, -0.5, c}, 20 | {0.5, -0.5, c}, 21 | {0.5, 0.0, c}, 22 | } -------------------------------------------------------------------------------- /include/Eigen/src/Core/util/ReenableStupidWarnings.h: -------------------------------------------------------------------------------- 1 | #ifdef EIGEN_WARNINGS_DISABLED_2 2 | // "DisableStupidWarnings.h" was included twice recursively: Do not reenable warnings yet! 3 | # undef EIGEN_WARNINGS_DISABLED_2 4 | 5 | #elif defined(EIGEN_WARNINGS_DISABLED) 6 | #undef EIGEN_WARNINGS_DISABLED 7 | 8 | #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS 9 | #ifdef _MSC_VER 10 | #pragma warning( pop ) 11 | #elif defined __INTEL_COMPILER 12 | #pragma warning pop 13 | #elif defined __clang__ 14 | #pragma clang diagnostic pop 15 | #elif defined __GNUC__ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) 16 | #pragma GCC diagnostic pop 17 | #endif 18 | 19 | #if defined __NVCC__ 20 | // Don't reenable the diagnostic messages, as it turns out these messages need 21 | // to be disabled at the point of the template instantiation (i.e the user code) 22 | // otherwise they'll be triggered by nvcc. 23 | // #pragma diag_default code_is_unreachable 24 | // #pragma diag_default initialization_not_reachable 25 | // #pragma diag_default 2651 26 | // #pragma diag_default 2653 27 | #endif 28 | 29 | #endif 30 | 31 | #endif // EIGEN_WARNINGS_DISABLED 32 | -------------------------------------------------------------------------------- /include/unsupported/test/cxx11_tensor_empty.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2015 Benoit Steiner 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #include "main.h" 11 | 12 | #include 13 | 14 | 15 | static void test_empty_tensor() 16 | { 17 | Tensor source; 18 | Tensor tgt1 = source; 19 | Tensor tgt2(source); 20 | Tensor tgt3; 21 | tgt3 = tgt1; 22 | tgt3 = tgt2; 23 | } 24 | 25 | static void test_empty_fixed_size_tensor() 26 | { 27 | TensorFixedSize > source; 28 | TensorFixedSize > tgt1 = source; 29 | TensorFixedSize > tgt2(source); 30 | TensorFixedSize > tgt3; 31 | tgt3 = tgt1; 32 | tgt3 = tgt2; 33 | } 34 | 35 | 36 | EIGEN_DECLARE_TEST(cxx11_tensor_empty) 37 | { 38 | CALL_SUBTEST(test_empty_tensor()); 39 | CALL_SUBTEST(test_empty_fixed_size_tensor()); 40 | } 41 | -------------------------------------------------------------------------------- /settings/airfoils/semicirc: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- VM2D -*-----------------*---------------*\ 2 | | ## ## ## ## #### ##### | | Version 1.12 | 3 | | ## ## ### ### ## ## ## ## | VM2D: Vortex Method | 2024/01/14 | 4 | | ## ## ## # ## ## ## ## | for 2D Flow Simulation *----------------* 5 | | #### ## ## ## ## ## | Open Source Code | 6 | | ## ## ## ###### ##### | https://www.github.com/vortexmethods/VM2D | 7 | | | 8 | | Copyright (C) 2017-2024 I. Marchevsky, K. Sokol, E. Ryatina, A. Kolganova | 9 | *-----------------------------------------------------------------------------* 10 | | File name: semicirc | 11 | | Info: Semicrcular airfoil | 12 | \*---------------------------------------------------------------------------*/ 13 | 14 | geometry = { 15 | {0.25, 0, c}, 16 | {0.25, 0.5, c}, 17 | {-0.25, 0.0, i}, 18 | {0.25, -0.5, c}, 19 | {0.25, -0.52, c}, 20 | {0.30, -0.25, i}, 21 | {0.25, -0.10, c}, 22 | {0.25, 0, c} 23 | }; -------------------------------------------------------------------------------- /include/unsupported/test/matrix_square_root.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2011 Jitse Niesen 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #include "matrix_functions.h" 11 | 12 | template 13 | void testMatrixSqrt(const MatrixType& m) 14 | { 15 | MatrixType A; 16 | generateTestMatrix::run(A, m.rows()); 17 | MatrixType sqrtA = A.sqrt(); 18 | VERIFY_IS_APPROX(sqrtA * sqrtA, A); 19 | } 20 | 21 | EIGEN_DECLARE_TEST(matrix_square_root) 22 | { 23 | for (int i = 0; i < g_repeat; i++) { 24 | CALL_SUBTEST_1(testMatrixSqrt(Matrix3cf())); 25 | CALL_SUBTEST_2(testMatrixSqrt(MatrixXcd(12,12))); 26 | CALL_SUBTEST_3(testMatrixSqrt(Matrix4f())); 27 | CALL_SUBTEST_4(testMatrixSqrt(Matrix(9, 9))); 28 | CALL_SUBTEST_5(testMatrixSqrt(Matrix())); 29 | CALL_SUBTEST_5(testMatrixSqrt(Matrix,1,1>())); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /include/unsupported/test/cxx11_tensor_math.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2015 Benoit Steiner 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #include "main.h" 11 | 12 | #include 13 | 14 | using Eigen::Tensor; 15 | using Eigen::RowMajor; 16 | 17 | static void test_tanh() 18 | { 19 | Tensor vec1(6); 20 | vec1.setRandom(); 21 | 22 | Tensor vec2 = vec1.tanh(); 23 | 24 | for (int i = 0; i < 6; ++i) { 25 | VERIFY_IS_APPROX(vec2(i), tanhf(vec1(i))); 26 | } 27 | } 28 | 29 | static void test_sigmoid() 30 | { 31 | Tensor vec1(6); 32 | vec1.setRandom(); 33 | 34 | Tensor vec2 = vec1.sigmoid(); 35 | 36 | for (int i = 0; i < 6; ++i) { 37 | VERIFY_IS_APPROX(vec2(i), 1.0f / (1.0f + std::exp(-vec1(i)))); 38 | } 39 | } 40 | 41 | 42 | EIGEN_DECLARE_TEST(cxx11_tensor_math) 43 | { 44 | CALL_SUBTEST(test_tanh()); 45 | CALL_SUBTEST(test_sigmoid()); 46 | } 47 | -------------------------------------------------------------------------------- /include/unsupported/Eigen/src/NonLinearOptimization/r1mpyq.h: -------------------------------------------------------------------------------- 1 | namespace Eigen { 2 | 3 | namespace internal { 4 | 5 | // TODO : move this to GivensQR once there's such a thing in Eigen 6 | 7 | template 8 | void r1mpyq(DenseIndex m, DenseIndex n, Scalar *a, const std::vector > &v_givens, const std::vector > &w_givens) 9 | { 10 | typedef DenseIndex Index; 11 | 12 | /* apply the first set of givens rotations to a. */ 13 | for (Index j = n-2; j>=0; --j) 14 | for (Index i = 0; i 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPARSE_FUZZY_H 11 | #define EIGEN_SPARSE_FUZZY_H 12 | 13 | namespace Eigen { 14 | 15 | template 16 | template 17 | bool SparseMatrixBase::isApprox(const SparseMatrixBase& other, const RealScalar &prec) const 18 | { 19 | const typename internal::nested_eval::type actualA(derived()); 20 | typename internal::conditional::type, 22 | const PlainObject>::type actualB(other.derived()); 23 | 24 | return (actualA - actualB).squaredNorm() <= prec * prec * numext::mini(actualA.squaredNorm(), actualB.squaredNorm()); 25 | } 26 | 27 | } // end namespace Eigen 28 | 29 | #endif // EIGEN_SPARSE_FUZZY_H 30 | -------------------------------------------------------------------------------- /src/VM2D/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | link_directories(${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) 2 | 3 | SUBDIRLIST(VM2Dsubdir_VM2D ${CMAKE_CURRENT_SOURCE_DIR}) 4 | SUBDIRLIST(VM2Dsubdir_VMlib ${CMAKE_SOURCE_DIR}/src/VMlib) 5 | SUBDIRLIST(VM2Dsubdir_VMcuda ${CMAKE_SOURCE_DIR}/src/VMcuda) 6 | LIST(APPEND VM2Ddirs ${VM2Dsubdir_VM2D} ${VM2Dsubdir_VMlib} ${VM2Dsubdir_VMcuda}) 7 | 8 | #message(STATUS "VM2D_dirs: ${VM2Ddirs}") 9 | 10 | include_directories(${CMAKE_SOURCE_DIR}/include) 11 | include_directories(${VM2Ddirs}) 12 | 13 | FILE(GLOB VM2D_ALLFILES 14 | ${CMAKE_CURRENT_SOURCE_DIR}/*/*.cpp 15 | ${CMAKE_CURRENT_SOURCE_DIR}/*/*.h 16 | ) 17 | 18 | add_executable(VM2D ${VM2D_ALLFILES}) 19 | 20 | target_link_libraries(VM2D debug VMlib2) 21 | target_link_libraries(VM2D optimized VMlib2) 22 | 23 | target_compile_features(VM2D PRIVATE cxx_std_17) 24 | 25 | if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") 26 | if(WIN32) 27 | target_link_libraries(VM2D debug "c:/Program Files/LLVM/lib/libomp.lib") 28 | target_link_libraries(VM2D optimized "c:/Program Files/LLVM/lib/libomp.lib") 29 | endif() 30 | endif() 31 | 32 | #CUDA 33 | if(CUDA_FOUND OR CMAKE_CUDA_COMPILER) 34 | target_link_libraries(VM2D debug VMcuda) 35 | target_link_libraries(VM2D optimized VMcuda) 36 | endif() 37 | -------------------------------------------------------------------------------- /src/VMlib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | link_directories(${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) 2 | 3 | SUBDIRLIST(VMlibSubdir_VM2D ${CMAKE_SOURCE_DIR}/src/VM2D) 4 | SUBDIRLIST(VMlibSubdir_VM3D ${CMAKE_SOURCE_DIR}/src/VM3D) 5 | SUBDIRLIST(VMlibSubdir_VMlib ${CMAKE_CURRENT_SOURCE_DIR}) 6 | SUBDIRLIST(VMlibSubdir_VMcuda ${CMAKE_SOURCE_DIR}/src/VMcuda) 7 | LIST(APPEND VMlibDirs ${VMlibSubdir_VMlib} ${VMlibSubdir_VM2D} ${VMlibSubdir_VM3D} ${VMlibSubdir_VMcuda}) 8 | 9 | #message(STATUS "VMlib_Dirs: ${VMlibDirs}") 10 | 11 | include_directories(${CMAKE_SOURCE_DIR}/include) 12 | include_directories(${VMlibDirs}) 13 | 14 | FILE(GLOB VMlib_ALLFILES 15 | ${CMAKE_CURRENT_SOURCE_DIR}/*/*.cpp 16 | ${CMAKE_CURRENT_SOURCE_DIR}/*/*.h 17 | ) 18 | 19 | IF(EXISTS "${CMAKE_SOURCE_DIR}/src/VM2D/CMakeLists.txt") 20 | #message(STATUS "-------------------------2D CODE-------------------------") 21 | add_library(VMlib2 STATIC ${VMlib_ALLFILES}) 22 | target_compile_definitions(VMlib2 PUBLIC -DCODE2D) 23 | ENDIF() 24 | 25 | IF(EXISTS "${CMAKE_SOURCE_DIR}/src/VM3D/CMakeLists.txt") 26 | #message(STATUS "-------------------------3D CODE-------------------------") 27 | add_library(VMlib3 STATIC ${VMlib_ALLFILES}) 28 | target_compile_definitions(VMlib3 PUBLIC -DCODE3D) 29 | ENDIF() 30 | 31 | 32 | -------------------------------------------------------------------------------- /include/unsupported/doc/snippets/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB snippets_SRCS "*.cpp") 2 | 3 | add_custom_target(unsupported_snippets) 4 | 5 | foreach(snippet_src ${snippets_SRCS}) 6 | get_filename_component(snippet ${snippet_src} NAME_WE) 7 | set(compile_snippet_target compile_${snippet}) 8 | set(compile_snippet_src ${compile_snippet_target}.cpp) 9 | file(READ ${snippet_src} snippet_source_code) 10 | configure_file(${PROJECT_SOURCE_DIR}/doc/snippets/compile_snippet.cpp.in 11 | ${CMAKE_CURRENT_BINARY_DIR}/${compile_snippet_src}) 12 | add_executable(${compile_snippet_target} 13 | ${CMAKE_CURRENT_BINARY_DIR}/${compile_snippet_src}) 14 | if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO) 15 | target_link_libraries(${compile_snippet_target} ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO}) 16 | endif() 17 | add_custom_command( 18 | TARGET ${compile_snippet_target} 19 | POST_BUILD 20 | COMMAND ${compile_snippet_target} 21 | ARGS >${CMAKE_CURRENT_BINARY_DIR}/${snippet}.out 22 | ) 23 | add_dependencies(unsupported_snippets ${compile_snippet_target}) 24 | set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${compile_snippet_src} 25 | PROPERTIES OBJECT_DEPENDS ${snippet_src}) 26 | endforeach(snippet_src) 27 | -------------------------------------------------------------------------------- /include/Eigen/PardisoSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_PARDISOSUPPORT_MODULE_H 9 | #define EIGEN_PARDISOSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | #include 16 | 17 | /** \ingroup Support_modules 18 | * \defgroup PardisoSupport_Module PardisoSupport module 19 | * 20 | * This module brings support for the Intel(R) MKL PARDISO direct sparse solvers. 21 | * 22 | * \code 23 | * #include 24 | * \endcode 25 | * 26 | * In order to use this module, the MKL headers must be accessible from the include paths, and your binary must be linked to the MKL library and its dependencies. 27 | * See this \ref TopicUsingIntelMKL "page" for more information on MKL-Eigen integration. 28 | * 29 | */ 30 | 31 | #include "src/PardisoSupport/PardisoSupport.h" 32 | 33 | #include "src/Core/util/ReenableStupidWarnings.h" 34 | 35 | #endif // EIGEN_PARDISOSUPPORT_MODULE_H 36 | -------------------------------------------------------------------------------- /include/Eigen/SPQRSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_SPQRSUPPORT_MODULE_H 9 | #define EIGEN_SPQRSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | #include "SuiteSparseQR.hpp" 16 | 17 | /** \ingroup Support_modules 18 | * \defgroup SPQRSupport_Module SuiteSparseQR module 19 | * 20 | * This module provides an interface to the SPQR library, which is part of the suitesparse package. 21 | * 22 | * \code 23 | * #include 24 | * \endcode 25 | * 26 | * In order to use this module, the SPQR headers must be accessible from the include paths, and your binary must be linked to the SPQR library and its dependencies (Cholmod, AMD, COLAMD,...). 27 | * For a cmake based project, you can use our FindSPQR.cmake and FindCholmod.Cmake modules 28 | * 29 | */ 30 | 31 | #include "src/CholmodSupport/CholmodSupport.h" 32 | #include "src/SPQRSupport/SuiteSparseQRSupport.h" 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /include/Eigen/src/Core/arch/AVX512/TypeCasting.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2019 Rasmus Munk Larsen 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_TYPE_CASTING_AVX512_H 11 | #define EIGEN_TYPE_CASTING_AVX512_H 12 | 13 | namespace Eigen { 14 | 15 | namespace internal { 16 | 17 | template <> 18 | struct type_casting_traits { 19 | enum { 20 | VectorizedCast = 1, 21 | SrcCoeffRatio = 1, 22 | TgtCoeffRatio = 1 23 | }; 24 | }; 25 | 26 | template<> EIGEN_STRONG_INLINE Packet16f pcast(const Packet16h& a) { 27 | return half2float(a); 28 | } 29 | 30 | template <> 31 | struct type_casting_traits { 32 | enum { 33 | VectorizedCast = 1, 34 | SrcCoeffRatio = 1, 35 | TgtCoeffRatio = 1 36 | }; 37 | }; 38 | 39 | template<> EIGEN_STRONG_INLINE Packet16h pcast(const Packet16f& a) { 40 | return float2half(a); 41 | } 42 | 43 | } // end namespace internal 44 | 45 | } // end namespace Eigen 46 | 47 | #endif // EIGEN_TYPE_CASTING_AVX512_H 48 | -------------------------------------------------------------------------------- /include/unsupported/Eigen/EulerAngles: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2015 Tal Hadad 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_EULERANGLES_MODULE_H 11 | #define EIGEN_EULERANGLES_MODULE_H 12 | 13 | 14 | #include "../../Eigen/Core" 15 | #include "../../Eigen/Geometry" 16 | 17 | #include "../../Eigen/src/Core/util/DisableStupidWarnings.h" 18 | 19 | namespace Eigen { 20 | 21 | /** 22 | * \defgroup EulerAngles_Module EulerAngles module 23 | * \brief This module provides generic euler angles rotation. 24 | * 25 | * Euler angles are a way to represent 3D rotation. 26 | * 27 | * In order to use this module in your code, include this header: 28 | * \code 29 | * #include 30 | * \endcode 31 | * 32 | * See \ref EulerAngles for more information. 33 | * 34 | */ 35 | 36 | } 37 | 38 | #include "src/EulerAngles/EulerSystem.h" 39 | #include "src/EulerAngles/EulerAngles.h" 40 | 41 | #include "../../Eigen/src/Core/util/ReenableStupidWarnings.h" 42 | 43 | #endif // EIGEN_EULERANGLES_MODULE_H 44 | -------------------------------------------------------------------------------- /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | # Read the Docs configuration file for Sphinx projects 2 | 3 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details 4 | 5 | 6 | # Required 7 | 8 | version: 2 9 | 10 | 11 | # Set the OS, Python version and other tools you might need 12 | 13 | build: 14 | 15 | os: ubuntu-22.04 16 | 17 | tools: 18 | 19 | python: "3.12" 20 | 21 | # You can also specify other tool versions: 22 | 23 | # nodejs: "20" 24 | 25 | # rust: "1.70" 26 | 27 | # golang: "1.20" 28 | 29 | 30 | # Build documentation in the "docs/" directory with Sphinx 31 | 32 | sphinx: 33 | 34 | configuration: docs/conf.py 35 | 36 | # You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs 37 | 38 | # builder: "dirhtml" 39 | 40 | # Fail on all warnings to avoid broken references 41 | 42 | # fail_on_warning: true 43 | 44 | 45 | # Optionally build your docs in additional formats such as PDF and ePub 46 | 47 | # formats: 48 | 49 | # - pdf 50 | 51 | # - epub 52 | 53 | 54 | # Optional but recommended, declare the Python requirements required 55 | 56 | # to build your documentation 57 | 58 | # See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html 59 | 60 | # python: 61 | 62 | # install: 63 | 64 | # - requirements: docs/requirements.txt -------------------------------------------------------------------------------- /include/Eigen/SparseQR: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_SPARSEQR_MODULE_H 9 | #define EIGEN_SPARSEQR_MODULE_H 10 | 11 | #include "SparseCore" 12 | #include "OrderingMethods" 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** \defgroup SparseQR_Module SparseQR module 16 | * \brief Provides QR decomposition for sparse matrices 17 | * 18 | * This module provides a simplicial version of the left-looking Sparse QR decomposition. 19 | * The columns of the input matrix should be reordered to limit the fill-in during the 20 | * decomposition. Built-in methods (COLAMD, AMD) or external methods (METIS) can be used to this end. 21 | * See the \link OrderingMethods_Module OrderingMethods\endlink module for the list 22 | * of built-in and external ordering methods. 23 | * 24 | * \code 25 | * #include 26 | * \endcode 27 | * 28 | * 29 | */ 30 | 31 | #include "src/SparseCore/SparseColEtree.h" 32 | #include "src/SparseQR/SparseQR.h" 33 | 34 | #include "src/Core/util/ReenableStupidWarnings.h" 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /include/unsupported/Eigen/CXX11/src/Tensor/TensorGpuHipCudaUndefines.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2014 Benoit Steiner 5 | // Copyright (C) 2018 Deven Desai 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #if defined(EIGEN_CXX11_TENSOR_GPU_HIP_CUDA_DEFINES_H) 12 | 13 | #undef gpuStream_t 14 | #undef gpuDeviceProp_t 15 | #undef gpuError_t 16 | #undef gpuSuccess 17 | #undef gpuErrorNotReady 18 | #undef gpuGetDeviceCount 19 | #undef gpuGetErrorString 20 | #undef gpuGetDeviceProperties 21 | #undef gpuStreamDefault 22 | #undef gpuGetDevice 23 | #undef gpuSetDevice 24 | #undef gpuMalloc 25 | #undef gpuFree 26 | #undef gpuMemsetAsync 27 | #undef gpuMemcpyAsync 28 | #undef gpuMemcpyDeviceToDevice 29 | #undef gpuMemcpyDeviceToHost 30 | #undef gpuMemcpyHostToDevice 31 | #undef gpuStreamQuery 32 | #undef gpuSharedMemConfig 33 | #undef gpuDeviceSetSharedMemConfig 34 | #undef gpuStreamSynchronize 35 | #undef gpuDeviceSynchronize 36 | #undef gpuMemcpy 37 | 38 | #undef EIGEN_CXX11_TENSOR_GPU_HIP_CUDA_DEFINES_H 39 | 40 | #endif // EIGEN_CXX11_TENSOR_GPU_HIP_CUDA_DEFINES_H 41 | -------------------------------------------------------------------------------- /include/unsupported/test/gmres.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2011 Gael Guennebaud 5 | // Copyright (C) 2012 Kolja Brix 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #include "../../test/sparse_solver.h" 12 | #include 13 | 14 | template void test_gmres_T() 15 | { 16 | GMRES, DiagonalPreconditioner > gmres_colmajor_diag; 17 | GMRES, IdentityPreconditioner > gmres_colmajor_I; 18 | GMRES, IncompleteLUT > gmres_colmajor_ilut; 19 | //GMRES, SSORPreconditioner > gmres_colmajor_ssor; 20 | 21 | CALL_SUBTEST( check_sparse_square_solving(gmres_colmajor_diag) ); 22 | // CALL_SUBTEST( check_sparse_square_solving(gmres_colmajor_I) ); 23 | CALL_SUBTEST( check_sparse_square_solving(gmres_colmajor_ilut) ); 24 | //CALL_SUBTEST( check_sparse_square_solving(gmres_colmajor_ssor) ); 25 | } 26 | 27 | EIGEN_DECLARE_TEST(gmres) 28 | { 29 | CALL_SUBTEST_1(test_gmres_T()); 30 | CALL_SUBTEST_2(test_gmres_T >()); 31 | } 32 | -------------------------------------------------------------------------------- /include/unsupported/Eigen/AutoDiff: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2009 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_AUTODIFF_MODULE 11 | #define EIGEN_AUTODIFF_MODULE 12 | 13 | namespace Eigen { 14 | 15 | /** 16 | * \defgroup AutoDiff_Module Auto Diff module 17 | * 18 | * This module features forward automatic differentation via a simple 19 | * templated scalar type wrapper AutoDiffScalar. 20 | * 21 | * Warning : this should NOT be confused with numerical differentiation, which 22 | * is a different method and has its own module in Eigen : \ref NumericalDiff_Module. 23 | * 24 | * \code 25 | * #include 26 | * \endcode 27 | */ 28 | //@{ 29 | 30 | } 31 | #include "../../Eigen/src/Core/util/DisableStupidWarnings.h" 32 | 33 | 34 | #include "src/AutoDiff/AutoDiffScalar.h" 35 | // #include "src/AutoDiff/AutoDiffVector.h" 36 | #include "src/AutoDiff/AutoDiffJacobian.h" 37 | 38 | #include "../../Eigen/src/Core/util/ReenableStupidWarnings.h" 39 | 40 | 41 | 42 | namespace Eigen { 43 | //@} 44 | } 45 | 46 | #endif // EIGEN_AUTODIFF_MODULE 47 | -------------------------------------------------------------------------------- /include/Eigen/SparseCholesky: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2013 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPARSECHOLESKY_MODULE_H 11 | #define EIGEN_SPARSECHOLESKY_MODULE_H 12 | 13 | #include "SparseCore" 14 | #include "OrderingMethods" 15 | 16 | #include "src/Core/util/DisableStupidWarnings.h" 17 | 18 | /** 19 | * \defgroup SparseCholesky_Module SparseCholesky module 20 | * 21 | * This module currently provides two variants of the direct sparse Cholesky decomposition for selfadjoint (hermitian) matrices. 22 | * Those decompositions are accessible via the following classes: 23 | * - SimplicialLLt, 24 | * - SimplicialLDLt 25 | * 26 | * Such problems can also be solved using the ConjugateGradient solver from the IterativeLinearSolvers module. 27 | * 28 | * \code 29 | * #include 30 | * \endcode 31 | */ 32 | 33 | #include "src/SparseCholesky/SimplicialCholesky.h" 34 | #include "src/SparseCholesky/SimplicialCholesky_impl.h" 35 | #include "src/Core/util/ReenableStupidWarnings.h" 36 | 37 | #endif // EIGEN_SPARSECHOLESKY_MODULE_H 38 | -------------------------------------------------------------------------------- /include/Eigen/Cholesky: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_CHOLESKY_MODULE_H 9 | #define EIGEN_CHOLESKY_MODULE_H 10 | 11 | #include "Core" 12 | #include "Jacobi" 13 | 14 | #include "src/Core/util/DisableStupidWarnings.h" 15 | 16 | /** \defgroup Cholesky_Module Cholesky module 17 | * 18 | * 19 | * 20 | * This module provides two variants of the Cholesky decomposition for selfadjoint (hermitian) matrices. 21 | * Those decompositions are also accessible via the following methods: 22 | * - MatrixBase::llt() 23 | * - MatrixBase::ldlt() 24 | * - SelfAdjointView::llt() 25 | * - SelfAdjointView::ldlt() 26 | * 27 | * \code 28 | * #include 29 | * \endcode 30 | */ 31 | 32 | #include "src/Cholesky/LLT.h" 33 | #include "src/Cholesky/LDLT.h" 34 | #ifdef EIGEN_USE_LAPACKE 35 | #ifdef EIGEN_USE_MKL 36 | #include "mkl_lapacke.h" 37 | #else 38 | #include "src/misc/lapacke.h" 39 | #endif 40 | #include "src/Cholesky/LLT_LAPACKE.h" 41 | #endif 42 | 43 | #include "src/Core/util/ReenableStupidWarnings.h" 44 | 45 | #endif // EIGEN_CHOLESKY_MODULE_H 46 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 47 | -------------------------------------------------------------------------------- /include/unsupported/test/dgmres.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2011 Gael Guennebaud 5 | // Copyright (C) 2012 desire Nuentsa 13 | 14 | template void test_dgmres_T() 15 | { 16 | DGMRES, DiagonalPreconditioner > dgmres_colmajor_diag; 17 | DGMRES, IdentityPreconditioner > dgmres_colmajor_I; 18 | DGMRES, IncompleteLUT > dgmres_colmajor_ilut; 19 | //GMRES, SSORPreconditioner > dgmres_colmajor_ssor; 20 | 21 | CALL_SUBTEST( check_sparse_square_solving(dgmres_colmajor_diag) ); 22 | // CALL_SUBTEST( check_sparse_square_solving(dgmres_colmajor_I) ); 23 | CALL_SUBTEST( check_sparse_square_solving(dgmres_colmajor_ilut) ); 24 | //CALL_SUBTEST( check_sparse_square_solving(dgmres_colmajor_ssor) ); 25 | } 26 | 27 | EIGEN_DECLARE_TEST(dgmres) 28 | { 29 | CALL_SUBTEST_1(test_dgmres_T()); 30 | CALL_SUBTEST_2(test_dgmres_T >()); 31 | } 32 | -------------------------------------------------------------------------------- /include/unsupported/Eigen/CXX11/src/ThreadPool/ThreadEnvironment.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2014 Benoit Steiner 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_CXX11_THREADPOOL_THREAD_ENVIRONMENT_H 11 | #define EIGEN_CXX11_THREADPOOL_THREAD_ENVIRONMENT_H 12 | 13 | namespace Eigen { 14 | 15 | struct StlThreadEnvironment { 16 | struct Task { 17 | std::function f; 18 | }; 19 | 20 | // EnvThread constructor must start the thread, 21 | // destructor must join the thread. 22 | class EnvThread { 23 | public: 24 | EnvThread(std::function f) : thr_(std::move(f)) {} 25 | ~EnvThread() { thr_.join(); } 26 | // This function is called when the threadpool is cancelled. 27 | void OnCancel() { } 28 | 29 | private: 30 | std::thread thr_; 31 | }; 32 | 33 | EnvThread* CreateThread(std::function f) { return new EnvThread(std::move(f)); } 34 | Task CreateTask(std::function f) { return Task{std::move(f)}; } 35 | void ExecuteTask(const Task& t) { t.f(); } 36 | }; 37 | 38 | } // namespace Eigen 39 | 40 | #endif // EIGEN_CXX11_THREADPOOL_THREAD_ENVIRONMENT_H 41 | -------------------------------------------------------------------------------- /include/unsupported/Eigen/CXX11/TensorSymmetry: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2013 Christian Seiler 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_CXX11_TENSORSYMMETRY_MODULE 11 | #define EIGEN_CXX11_TENSORSYMMETRY_MODULE 12 | 13 | #include "Tensor" 14 | 15 | #include "../../../Eigen/src/Core/util/DisableStupidWarnings.h" 16 | 17 | #include "src/util/CXX11Meta.h" 18 | 19 | /** \defgroup CXX11_TensorSymmetry_Module Tensor Symmetry Module 20 | * 21 | * This module provides a classes that allow for the definition of 22 | * symmetries w.r.t. tensor indices. 23 | * 24 | * Including this module will implicitly include the Tensor module. 25 | * 26 | * \code 27 | * #include 28 | * \endcode 29 | */ 30 | 31 | #include "src/TensorSymmetry/util/TemplateGroupTheory.h" 32 | #include "src/TensorSymmetry/Symmetry.h" 33 | #include "src/TensorSymmetry/StaticSymmetry.h" 34 | #include "src/TensorSymmetry/DynamicSymmetry.h" 35 | 36 | #include "../../../Eigen/src/Core/util/ReenableStupidWarnings.h" 37 | 38 | #endif // EIGEN_CXX11_TENSORSYMMETRY_MODULE 39 | 40 | /* 41 | * kate: space-indent on; indent-width 2; mixedindent off; indent-mode cstyle; 42 | */ 43 | -------------------------------------------------------------------------------- /include/unsupported/Eigen/LevenbergMarquardt: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Thomas Capricelli 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_LEVENBERGMARQUARDT_MODULE 11 | #define EIGEN_LEVENBERGMARQUARDT_MODULE 12 | 13 | // #include 14 | 15 | #include "../../Eigen/Core" 16 | #include "../../Eigen/Jacobi" 17 | #include "../../Eigen/QR" 18 | #include "NumericalDiff" 19 | 20 | #include "../../Eigen/SparseQR" 21 | 22 | /** 23 | * \defgroup LevenbergMarquardt_Module Levenberg-Marquardt module 24 | * 25 | * \code 26 | * #include 27 | * \endcode 28 | * 29 | * 30 | */ 31 | 32 | #include "../../Eigen/SparseCore" 33 | 34 | #include "../../Eigen/src/Core/util/DisableStupidWarnings.h" 35 | 36 | #ifndef EIGEN_PARSED_BY_DOXYGEN 37 | 38 | #include "src/LevenbergMarquardt/LMqrsolv.h" 39 | #include "src/LevenbergMarquardt/LMcovar.h" 40 | #include "src/LevenbergMarquardt/LMpar.h" 41 | 42 | #endif 43 | 44 | #include "src/LevenbergMarquardt/LevenbergMarquardt.h" 45 | #include "src/LevenbergMarquardt/LMonestep.h" 46 | 47 | #include "../../Eigen/src/Core/util/ReenableStupidWarnings.h" 48 | 49 | #endif // EIGEN_LEVENBERGMARQUARDT_MODULE 50 | -------------------------------------------------------------------------------- /docs/05_run-eng.rst: -------------------------------------------------------------------------------- 1 | VM2D run and processing the results 2 | =================================== 3 | 4 | VM2D run 5 | -------- 6 | 7 | The program is launched from the *working directory*, i.e. a directory containing the files ``problems``, ``defaults``, ``switchers`` and ``mechanics``, as well as folders for specific tasks to be solved. To start simulation, you need to call the command 8 | 9 | ``VM2D`` 10 | 11 | (if necessary, specifying the full path to the compiled executable file; this path can be specified in the system variable ``PATH``) 12 | 13 | 14 | Saving results 15 | -------------- 16 | 17 | Vortex wakes are saved in vtk files in the ``snapshots`` subdirectory, the velocity and pressure fields calculated at the given points --- in the ``velPress`` subdirectory. Both of these folders are located in the task subdirectory and are created automatically. 18 | 19 | Also, information about the loads acting on the airfoil or on each airfoil from the system of airfoils is stored in the task subdirectory. This information is saved in files named ``forces-airfoil-n'', where ``n'' corresponds to the airfoil number in the list from the *airfoil* key in the *task passport* file. These files are saved in two formats: text (without extension) and *csv*. 20 | 21 | If the airfoil is movable, then information about its position is saved to the file ``position-airfoil-n`` also in two formats. 22 | 23 | To view vtk and csv files, *paraview* free open source postprocessor is useful. 24 | -------------------------------------------------------------------------------- /include/unsupported/Eigen/CXX11/src/Tensor/TensorGlobalFunctions.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2016 Eugene Brevdo 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_CXX11_TENSOR_TENSOR_GLOBAL_FUNCTIONS_H 11 | #define EIGEN_CXX11_TENSOR_TENSOR_GLOBAL_FUNCTIONS_H 12 | 13 | namespace Eigen { 14 | 15 | /** \cpp11 \returns an expression of the coefficient-wise betainc(\a x, \a a, \a b) to the given tensors. 16 | * 17 | * This function computes the regularized incomplete beta function (integral). 18 | * 19 | */ 20 | template 21 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const 22 | TensorCwiseTernaryOp, 23 | const ADerived, const BDerived, const XDerived> 24 | betainc(const ADerived& a, const BDerived& b, const XDerived& x) { 25 | return TensorCwiseTernaryOp< 26 | internal::scalar_betainc_op, const ADerived, 27 | const BDerived, const XDerived>( 28 | a, b, x, internal::scalar_betainc_op()); 29 | } 30 | 31 | } // end namespace Eigen 32 | 33 | #endif // EIGEN_CXX11_TENSOR_TENSOR_GLOBAL_FUNCTIONS_H 34 | -------------------------------------------------------------------------------- /include/Eigen/QR: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_QR_MODULE_H 9 | #define EIGEN_QR_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "Cholesky" 14 | #include "Jacobi" 15 | #include "Householder" 16 | 17 | #include "src/Core/util/DisableStupidWarnings.h" 18 | 19 | /** \defgroup QR_Module QR module 20 | * 21 | * 22 | * 23 | * This module provides various QR decompositions 24 | * This module also provides some MatrixBase methods, including: 25 | * - MatrixBase::householderQr() 26 | * - MatrixBase::colPivHouseholderQr() 27 | * - MatrixBase::fullPivHouseholderQr() 28 | * 29 | * \code 30 | * #include 31 | * \endcode 32 | */ 33 | 34 | #include "src/QR/HouseholderQR.h" 35 | #include "src/QR/FullPivHouseholderQR.h" 36 | #include "src/QR/ColPivHouseholderQR.h" 37 | #include "src/QR/CompleteOrthogonalDecomposition.h" 38 | #ifdef EIGEN_USE_LAPACKE 39 | #ifdef EIGEN_USE_MKL 40 | #include "mkl_lapacke.h" 41 | #else 42 | #include "src/misc/lapacke.h" 43 | #endif 44 | #include "src/QR/HouseholderQR_LAPACKE.h" 45 | #include "src/QR/ColPivHouseholderQR_LAPACKE.h" 46 | #endif 47 | 48 | #include "src/Core/util/ReenableStupidWarnings.h" 49 | 50 | #endif // EIGEN_QR_MODULE_H 51 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 52 | -------------------------------------------------------------------------------- /include/Eigen/UmfPackSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_UMFPACKSUPPORT_MODULE_H 9 | #define EIGEN_UMFPACKSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | extern "C" { 16 | #include 17 | } 18 | 19 | /** \ingroup Support_modules 20 | * \defgroup UmfPackSupport_Module UmfPackSupport module 21 | * 22 | * This module provides an interface to the UmfPack library which is part of the suitesparse package. 23 | * It provides the following factorization class: 24 | * - class UmfPackLU: a multifrontal sequential LU factorization. 25 | * 26 | * \code 27 | * #include 28 | * \endcode 29 | * 30 | * In order to use this module, the umfpack headers must be accessible from the include paths, and your binary must be linked to the umfpack library and its dependencies. 31 | * The dependencies depend on how umfpack has been compiled. 32 | * For a cmake based project, you can use our FindUmfPack.cmake module to help you in this task. 33 | * 34 | */ 35 | 36 | #include "src/UmfPackSupport/UmfPackSupport.h" 37 | 38 | #include "src/Core/util/ReenableStupidWarnings.h" 39 | 40 | #endif // EIGEN_UMFPACKSUPPORT_MODULE_H 41 | -------------------------------------------------------------------------------- /docs/05_run.rst: -------------------------------------------------------------------------------- 1 | Запуск VM2D и обработка результатов 2 | =================================== 3 | 4 | Запуск VM2D 5 | ----------- 6 | 7 | Запуск программы осуществляется из *рабочего каталога*, т.е. каталога, содержащего файлы ``problems``, ``defaults``, ``switchers`` и ``mechanics``, а также папки конкретных решаемых задач. Для запуска расчетов необходимо вызвать команду 8 | 9 | ``VM2D`` 10 | 11 | (при необходимости - с указанием полного пути к скомпилированному исполняемому файлу; этот путь можно указать в системной переменной ``PATH``) 12 | 13 | 14 | Сохранение результатов 15 | ---------------------- 16 | 17 | Вихревые следы сохраняются в vtk-файлы в подкаталог ``snapshots``, поля скоростей и давления, вычисленные в заданных точках --- в подкаталог ``velPress``. Обе этих папки располагаются в подкаталоге задачи и создаются автоматически. 18 | 19 | Также в подкаталог задачи сохраняется информация о нагрузках, действующих на обтекаемый профиль или на каждый профиль из системы обтекаемых профилей. Эта информация сохраняется в файлы с именами ``forces-airfoil-n``, где ``n`` соответствует номеру профиля по порядку из их списка, перечисленного в ключе *airfoil* в *паспорте задачи*. Данные файлы сохраняются в двух форматах: текстовом (без расширения) и *csv*. 20 | 21 | Если профиль подвижен, то информация о его положении сохраняется в файл ``position-airfoil-n`` с той же логикой именования файлов, также в двух форматах. 22 | 23 | Для просмотра vtk и csv-файлов удобно использовать свободно распространяемый постпроцессор с открытым исходным кодом *paraview*. 24 | 25 | -------------------------------------------------------------------------------- /src/VMcuda/intersection/lbvh/utility.cuh: -------------------------------------------------------------------------------- 1 | #ifndef LBVH_UTILITY_CUH 2 | #define LBVH_UTILITY_CUH 3 | #include 4 | #include 5 | 6 | namespace lbvh 7 | { 8 | 9 | template struct vector_of; 10 | template<> struct vector_of {using type = float4;}; 11 | template<> struct vector_of {using type = double4;}; 12 | 13 | template 14 | using vector_of_t = typename vector_of::type; 15 | 16 | template struct vector_of2; 17 | template<> struct vector_of2 { using type = float2; }; 18 | template<> struct vector_of2 { using type = double2; }; 19 | 20 | template 21 | using vector_of2_t = typename vector_of2::type; 22 | 23 | 24 | //template struct vector_ofS; 25 | //template<> struct vector_ofS { using type = float2; }; 26 | 27 | //template 28 | //using vector_ofS_t = typename vector_ofS::type; 29 | 30 | 31 | 32 | template 33 | __device__ 34 | inline T infinity() noexcept; 35 | 36 | template<> 37 | __device__ 38 | inline float infinity() noexcept {return CUDART_INF_F;} 39 | template<> 40 | __device__ 41 | inline double infinity() noexcept {return CUDART_INF;} 42 | 43 | 44 | template 45 | struct segment 46 | { 47 | vector_of2_t p1, p2; 48 | }; 49 | 50 | template 51 | inline __host__ __device__ 52 | segment make_segment(vector_of2_t p1_, vector_of2_t p2_) 53 | { 54 | return segment{ p1_, p2_ }; 55 | } 56 | 57 | 58 | } // lbvh 59 | #endif// LBVH_UTILITY_CUH 60 | -------------------------------------------------------------------------------- /include/Eigen/KLUSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_KLUSUPPORT_MODULE_H 9 | #define EIGEN_KLUSUPPORT_MODULE_H 10 | 11 | #include 12 | 13 | #include 14 | 15 | extern "C" { 16 | #include 17 | #include 18 | } 19 | 20 | /** \ingroup Support_modules 21 | * \defgroup KLUSupport_Module KLUSupport module 22 | * 23 | * This module provides an interface to the KLU library which is part of the suitesparse package. 24 | * It provides the following factorization class: 25 | * - class KLU: a sparse LU factorization, well-suited for circuit simulation. 26 | * 27 | * \code 28 | * #include 29 | * \endcode 30 | * 31 | * In order to use this module, the klu and btf headers must be accessible from the include paths, and your binary must be linked to the klu library and its dependencies. 32 | * The dependencies depend on how umfpack has been compiled. 33 | * For a cmake based project, you can use our FindKLU.cmake module to help you in this task. 34 | * 35 | */ 36 | 37 | #include "src/KLUSupport/KLUSupport.h" 38 | 39 | #include 40 | 41 | #endif // EIGEN_KLUSUPPORT_MODULE_H 42 | -------------------------------------------------------------------------------- /include/unsupported/Eigen/SparseExtra: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2009 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPARSE_EXTRA_MODULE_H 11 | #define EIGEN_SPARSE_EXTRA_MODULE_H 12 | 13 | #include "../../Eigen/Sparse" 14 | 15 | #include "../../Eigen/src/Core/util/DisableStupidWarnings.h" 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #ifdef EIGEN_GOOGLEHASH_SUPPORT 26 | #include 27 | #endif 28 | 29 | /** 30 | * \defgroup SparseExtra_Module SparseExtra module 31 | * 32 | * This module contains some experimental features extending the sparse module. 33 | * 34 | * \code 35 | * #include 36 | * \endcode 37 | */ 38 | 39 | 40 | #include "src/SparseExtra/DynamicSparseMatrix.h" 41 | #include "src/SparseExtra/BlockOfDynamicSparseMatrix.h" 42 | #include "src/SparseExtra/RandomSetter.h" 43 | 44 | #include "src/SparseExtra/MarketIO.h" 45 | 46 | #if !defined(_WIN32) 47 | #include 48 | #include "src/SparseExtra/MatrixMarketIterator.h" 49 | #endif 50 | 51 | #include "../../Eigen/src/Core/util/ReenableStupidWarnings.h" 52 | 53 | #endif // EIGEN_SPARSE_EXTRA_MODULE_H 54 | -------------------------------------------------------------------------------- /include/unsupported/Eigen/src/NonLinearOptimization/rwupdt.h: -------------------------------------------------------------------------------- 1 | namespace Eigen { 2 | 3 | namespace internal { 4 | 5 | template 6 | void rwupdt( 7 | Matrix< Scalar, Dynamic, Dynamic > &r, 8 | const Matrix< Scalar, Dynamic, 1> &w, 9 | Matrix< Scalar, Dynamic, 1> &b, 10 | Scalar alpha) 11 | { 12 | typedef DenseIndex Index; 13 | 14 | const Index n = r.cols(); 15 | eigen_assert(r.rows()>=n); 16 | std::vector > givens(n); 17 | 18 | /* Local variables */ 19 | Scalar temp, rowj; 20 | 21 | /* Function Body */ 22 | for (Index j = 0; j < n; ++j) { 23 | rowj = w[j]; 24 | 25 | /* apply the previous transformations to */ 26 | /* r(i,j), i=0,1,...,j-1, and to w(j). */ 27 | for (Index i = 0; i < j; ++i) { 28 | temp = givens[i].c() * r(i,j) + givens[i].s() * rowj; 29 | rowj = -givens[i].s() * r(i,j) + givens[i].c() * rowj; 30 | r(i,j) = temp; 31 | } 32 | 33 | /* determine a givens rotation which eliminates w(j). */ 34 | givens[j].makeGivens(-r(j,j), rowj); 35 | 36 | if (rowj == 0.) 37 | continue; // givens[j] is identity 38 | 39 | /* apply the current transformation to r(j,j), b(j), and alpha. */ 40 | r(j,j) = givens[j].c() * r(j,j) + givens[j].s() * rowj; 41 | temp = givens[j].c() * b[j] + givens[j].s() * alpha; 42 | alpha = -givens[j].s() * b[j] + givens[j].c() * alpha; 43 | b[j] = temp; 44 | } 45 | } 46 | 47 | } // end namespace internal 48 | 49 | } // end namespace Eigen 50 | -------------------------------------------------------------------------------- /include/unsupported/doc/examples/SYCL/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB examples_SRCS "*.cpp") 2 | 3 | set(EIGEN_SYCL ON) 4 | list(APPEND CMAKE_EXE_LINKER_FLAGS -pthread) 5 | if(EIGEN_SYCL_TRISYCL) 6 | set(CMAKE_CXX_STANDARD 14) 7 | set(STD_CXX_FLAG "-std=c++1z") 8 | else(EIGEN_SYCL_TRISYCL) 9 | if(MSVC) 10 | # Set the host and device compilers C++ standard to C++14. On Windows setting this to C++11 11 | # can cause issues with the ComputeCpp device compiler parsing Visual Studio Headers. 12 | set(CMAKE_CXX_STANDARD 14) 13 | list(APPEND COMPUTECPP_USER_FLAGS -DWIN32) 14 | else() 15 | set(CMAKE_CXX_STANDARD 11) 16 | list(APPEND COMPUTECPP_USER_FLAGS -Wall) 17 | endif() 18 | # The following flags are not supported by Clang and can cause warnings 19 | # if used with -Werror so they are removed here. 20 | if(COMPUTECPP_USE_COMPILER_DRIVER) 21 | set(CMAKE_CXX_COMPILER ${ComputeCpp_DEVICE_COMPILER_EXECUTABLE}) 22 | string(REPLACE "-Wlogical-op" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) 23 | string(REPLACE "-Wno-psabi" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) 24 | string(REPLACE "-ansi" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) 25 | endif() 26 | list(APPEND COMPUTECPP_USER_FLAGS 27 | -DEIGEN_NO_ASSERTION_CHECKING=1 28 | -no-serial-memop 29 | -Xclang 30 | -cl-mad-enable) 31 | endif(EIGEN_SYCL_TRISYCL) 32 | 33 | FOREACH(example_src ${examples_SRCS}) 34 | GET_FILENAME_COMPONENT(example ${example_src} NAME_WE) 35 | ei_add_test_internal(${example} example_${example}) 36 | ADD_DEPENDENCIES(unsupported_examples example_${example}) 37 | ENDFOREACH(example_src) 38 | set(EIGEN_SYCL OFF) 39 | -------------------------------------------------------------------------------- /run/defaults: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- VM2D -*-----------------*---------------*\ 2 | | ## ## ## ## #### ##### | | Version 1.12 | 3 | | ## ## ### ### ## ## ## ## | VM2D: Vortex Method | 2024/01/14 | 4 | | ## ## ## # ## ## ## ## | for 2D Flow Simulation *----------------* 5 | | #### ## ## ## ## ## | Open Source Code | 6 | | ## ## ## ###### ##### | https://www.github.com/vortexmethods/VM2D | 7 | | | 8 | | Copyright (C) 2017-2024 I. Marchevsky, K. Sokol, E. Ryatina, A. Kolganova | 9 | *-----------------------------------------------------------------------------* 10 | | File name: defaults | 11 | | Info: Default values for various parameters | 12 | \*---------------------------------------------------------------------------*/ 13 | 14 | angle = 0.0; 15 | scale = 1.0; 16 | basePoint = {0.0, 0.0}; 17 | 18 | linearSystemSolver = linearSystemGauss; 19 | fastGmresTheta = 0.8; 20 | gmresEps = 1e-8; 21 | multipoleOrderGmres = 12; 22 | 23 | velocityComputation = velocityBiotSavart; 24 | 25 | boundaryConditionSatisfaction = boundaryLinearLayerAverage; 26 | saveVtx = text(100); 27 | saveVP = 0; 28 | 29 | mechanicalSystem = mechanicsRigidImmovable; 30 | np = 1; 31 | 32 | initDisplacement = {0.0, 0.0}; 33 | initAngularDisplacement = 0.0; 34 | initVelocity = {0.0, 0.0}; 35 | initAngularVelocity = 0.0; 36 | 37 | airfoilsDir = "../settings/airfoils/"; 38 | wakesDir = "../settings/wakes/"; -------------------------------------------------------------------------------- /include/Eigen/LU: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_LU_MODULE_H 9 | #define EIGEN_LU_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** \defgroup LU_Module LU module 16 | * This module includes %LU decomposition and related notions such as matrix inversion and determinant. 17 | * This module defines the following MatrixBase methods: 18 | * - MatrixBase::inverse() 19 | * - MatrixBase::determinant() 20 | * 21 | * \code 22 | * #include 23 | * \endcode 24 | */ 25 | 26 | #include "src/misc/Kernel.h" 27 | #include "src/misc/Image.h" 28 | #include "src/LU/FullPivLU.h" 29 | #include "src/LU/PartialPivLU.h" 30 | #ifdef EIGEN_USE_LAPACKE 31 | #ifdef EIGEN_USE_MKL 32 | #include "mkl_lapacke.h" 33 | #else 34 | #include "src/misc/lapacke.h" 35 | #endif 36 | #include "src/LU/PartialPivLU_LAPACKE.h" 37 | #endif 38 | #include "src/LU/Determinant.h" 39 | #include "src/LU/InverseImpl.h" 40 | 41 | // Use the SSE optimized version whenever possible. At the moment the 42 | // SSE version doesn't compile when AVX is enabled 43 | #if defined EIGEN_VECTORIZE_SSE && !defined EIGEN_VECTORIZE_AVX 44 | #include "src/LU/arch/Inverse_SSE.h" 45 | #endif 46 | 47 | #include "src/Core/util/ReenableStupidWarnings.h" 48 | 49 | #endif // EIGEN_LU_MODULE_H 50 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 51 | -------------------------------------------------------------------------------- /include/unsupported/Eigen/IterativeSolvers: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2009 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_ITERATIVE_SOLVERS_MODULE_H 11 | #define EIGEN_ITERATIVE_SOLVERS_MODULE_H 12 | 13 | #include "../../Eigen/Sparse" 14 | #include "../../Eigen/Jacobi" 15 | #include "../../Eigen/Householder" 16 | 17 | /** 18 | * \defgroup IterativeSolvers_Module Iterative solvers module 19 | * This module aims to provide various iterative linear and non linear solver algorithms. 20 | * It currently provides: 21 | * - a constrained conjugate gradient 22 | * - a Householder GMRES implementation 23 | * \code 24 | * #include 25 | * \endcode 26 | */ 27 | //@{ 28 | 29 | #include "../../Eigen/src/Core/util/DisableStupidWarnings.h" 30 | 31 | #ifndef EIGEN_MPL2_ONLY 32 | #include "src/IterativeSolvers/IterationController.h" 33 | #include "src/IterativeSolvers/ConstrainedConjGrad.h" 34 | #endif 35 | 36 | #include "src/IterativeSolvers/IncompleteLU.h" 37 | #include "src/IterativeSolvers/GMRES.h" 38 | #include "src/IterativeSolvers/DGMRES.h" 39 | //#include "src/IterativeSolvers/SSORPreconditioner.h" 40 | #include "src/IterativeSolvers/MINRES.h" 41 | 42 | #include "../../Eigen/src/Core/util/ReenableStupidWarnings.h" 43 | 44 | //@} 45 | 46 | #endif // EIGEN_ITERATIVE_SOLVERS_MODULE_H 47 | -------------------------------------------------------------------------------- /include/Eigen/src/Core/util/ReshapedHelper.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2017 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | 11 | #ifndef EIGEN_RESHAPED_HELPER_H 12 | #define EIGEN_RESHAPED_HELPER_H 13 | 14 | namespace Eigen { 15 | 16 | enum AutoSize_t { AutoSize }; 17 | const int AutoOrder = 2; 18 | 19 | namespace internal { 20 | 21 | template 22 | struct get_compiletime_reshape_size { 23 | enum { value = get_fixed_value::value }; 24 | }; 25 | 26 | template 27 | Index get_runtime_reshape_size(SizeType size, Index /*other*/, Index /*total*/) { 28 | return internal::get_runtime_value(size); 29 | } 30 | 31 | template 32 | struct get_compiletime_reshape_size { 33 | enum { 34 | other_size = get_fixed_value::value, 35 | value = (TotalSize==Dynamic || other_size==Dynamic) ? Dynamic : TotalSize / other_size }; 36 | }; 37 | 38 | inline Index get_runtime_reshape_size(AutoSize_t /*size*/, Index other, Index total) { 39 | return total/other; 40 | } 41 | 42 | template 43 | struct get_compiletime_reshape_order { 44 | enum { value = Order == AutoOrder ? Flags & RowMajorBit : Order }; 45 | }; 46 | 47 | } 48 | 49 | } // end namespace Eigen 50 | 51 | #endif // EIGEN_RESHAPED_HELPER_H 52 | -------------------------------------------------------------------------------- /tutorials/tube/pointsVP: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- VM2D -*-----------------*---------------*\ 2 | | ## ## ## ## #### ##### | | Version 1.12 | 3 | | ## ## ### ### ## ## ## ## | VM2D: Vortex Method | 2024/01/14 | 4 | | ## ## ## # ## ## ## ## | for 2D Flow Simulation *----------------* 5 | | #### ## ## ## ## ## | Open Source Code | 6 | | ## ## ## ###### ##### | https://www.github.com/vortexmethods/VM2D | 7 | | | 8 | | Copyright (C) 2017-2024 I. Marchevsky, K. Sokol, E. Ryatina, A. Kolganova | 9 | *-----------------------------------------------------------------------------* 10 | | File name: pointsVelocityPressure | 11 | | Info: Points for velocity and pressure computation (n=42) | 12 | \*---------------------------------------------------------------------------*/ 13 | points = {}; 14 | history = { 15 | {-3.3, 0}, 16 | {-3.1, 0}, 17 | {-2.9, 0}, 18 | {-2.7, 0}, 19 | {-2.5, 0}, 20 | {-2.3, 0}, 21 | {-2.1, 0}, 22 | {-1.9, 0}, 23 | {-1.7, 0}, 24 | {-1.5, 0}, 25 | {-1.3, 0}, 26 | {-1.1, 0}, 27 | {-0.9, 0}, 28 | {-0.7, 0}, 29 | { 0.7, 0}, 30 | { 0.9, 0}, 31 | { 1.1, 0}, 32 | { 1.3, 0}, 33 | { 1.5, 0}, 34 | { 1.7, 0}, 35 | { 1.9, 0}, 36 | { 2.1, 0}, 37 | { 2.3, 0}, 38 | { 2.5, 0}, 39 | { 2.7, 0}, 40 | { 2.9, 0}, 41 | { 3.1, 0}, 42 | { 3.3, 0}, 43 | { 3.5, 0}, 44 | { 3.7, 0}, 45 | { 3.9, 0}, 46 | { 4.1, 0}, 47 | { 4.3, 0}, 48 | { 4.5, 0}, 49 | { 4.7, 0}, 50 | { 4.9, 0}, 51 | { 5.1, 0}, 52 | { 5.3, 0}, 53 | { 5.5, 0}, 54 | { 5.7, 0}, 55 | { 5.9, 0}, 56 | { 6.1, 0} 57 | }; -------------------------------------------------------------------------------- /include/unsupported/test/cxx11_tensor_mixed_indices.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2014 Benoit Steiner 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #include "main.h" 11 | 12 | #include 13 | 14 | 15 | static void test_simple() 16 | { 17 | Tensor vec1(6); 18 | Tensor vec2(6); 19 | 20 | vec1(0) = 4.0; vec2(0) = 0.0; 21 | vec1(1) = 8.0; vec2(1) = 1.0; 22 | vec1(2) = 15.0; vec2(2) = 2.0; 23 | vec1(3) = 16.0; vec2(3) = 3.0; 24 | vec1(4) = 23.0; vec2(4) = 4.0; 25 | vec1(5) = 42.0; vec2(5) = 5.0; 26 | 27 | float data3[6]; 28 | TensorMap> vec3(data3, 6); 29 | vec3 = vec1.sqrt(); 30 | float data4[6]; 31 | TensorMap> vec4(data4, 6); 32 | vec4 = vec2.square(); 33 | 34 | VERIFY_IS_APPROX(vec3(0), sqrtf(4.0)); 35 | VERIFY_IS_APPROX(vec3(1), sqrtf(8.0)); 36 | VERIFY_IS_APPROX(vec3(2), sqrtf(15.0)); 37 | VERIFY_IS_APPROX(vec3(3), sqrtf(16.0)); 38 | VERIFY_IS_APPROX(vec3(4), sqrtf(23.0)); 39 | VERIFY_IS_APPROX(vec3(5), sqrtf(42.0)); 40 | 41 | VERIFY_IS_APPROX(vec4(0), 0.0f); 42 | VERIFY_IS_APPROX(vec4(1), 1.0f); 43 | VERIFY_IS_APPROX(vec4(2), 2.0f * 2.0f); 44 | VERIFY_IS_APPROX(vec4(3), 3.0f * 3.0f); 45 | VERIFY_IS_APPROX(vec4(4), 4.0f * 4.0f); 46 | VERIFY_IS_APPROX(vec4(5), 5.0f * 5.0f); 47 | } 48 | 49 | 50 | EIGEN_DECLARE_TEST(cxx11_tensor_mixed_indices) 51 | { 52 | CALL_SUBTEST(test_simple()); 53 | } 54 | -------------------------------------------------------------------------------- /include/unsupported/test/cxx11_tensor_roundings.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2016 Benoit Steiner 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #include "main.h" 11 | 12 | #include 13 | 14 | 15 | static void test_float_rounding() 16 | { 17 | Tensor ftensor(20,30); 18 | ftensor = ftensor.random() * 100.f; 19 | 20 | Tensor result = ftensor.round(); 21 | 22 | for (int i = 0; i < 20; ++i) { 23 | for (int j = 0; j < 30; ++j) { 24 | VERIFY_IS_EQUAL(result(i,j), numext::round(ftensor(i,j))); 25 | } 26 | } 27 | } 28 | 29 | static void test_float_flooring() 30 | { 31 | Tensor ftensor(20,30); 32 | ftensor = ftensor.random() * 100.f; 33 | 34 | Tensor result = ftensor.floor(); 35 | 36 | for (int i = 0; i < 20; ++i) { 37 | for (int j = 0; j < 30; ++j) { 38 | VERIFY_IS_EQUAL(result(i,j), numext::floor(ftensor(i,j))); 39 | } 40 | } 41 | } 42 | 43 | static void test_float_ceiling() 44 | { 45 | Tensor ftensor(20,30); 46 | ftensor = ftensor.random() * 100.f; 47 | 48 | Tensor result = ftensor.ceil(); 49 | 50 | for (int i = 0; i < 20; ++i) { 51 | for (int j = 0; j < 30; ++j) { 52 | VERIFY_IS_EQUAL(result(i,j), numext::ceil(ftensor(i,j))); 53 | } 54 | } 55 | } 56 | 57 | EIGEN_DECLARE_TEST(cxx11_tensor_roundings) 58 | { 59 | CALL_SUBTEST(test_float_rounding()); 60 | CALL_SUBTEST(test_float_ceiling()); 61 | CALL_SUBTEST(test_float_flooring()); 62 | } 63 | -------------------------------------------------------------------------------- /run/problems: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- VM2D -*-----------------*---------------*\ 2 | | ## ## ## ## #### ##### | | Version 1.12 | 3 | | ## ## ### ### ## ## ## ## | VM2D: Vortex Method | 2024/01/14 | 4 | | ## ## ## # ## ## ## ## | for 2D Flow Simulation *----------------* 5 | | #### ## ## ## ## ## | Open Source Code | 6 | | ## ## ## ###### ##### | https://www.github.com/vortexmethods/VM2D | 7 | | | 8 | | Copyright (C) 2017-2024 I. Marchevsky, K. Sokol, E. Ryatina, A. Kolganova | 9 | *-----------------------------------------------------------------------------* 10 | | File name: problems | 11 | | Info: Problems to be solved by using VM2D | 12 | \*---------------------------------------------------------------------------*/ 13 | problems = { 14 | circle200(), 15 | //blasius(), 16 | //cylPlate(), 17 | //lamb(), 18 | //oscilCircle(sh = {0.0, 0.2}, shw = 0, m = 10.0, J = 0.0, zeta = {0.0, 0.001}, zetaw = 0.001), 19 | //oscilCircle(sh = {0.0, 0.1}, shw = 0, m = 10.0, J = 0.0, zeta = {0.0, 0.001}, zetaw = 0.001), 20 | //oscilCircle(sh = {0.0, 0.02}, shw = 0, m = 10.0, J = 0.0, zeta = {0.0, 0.001}, zetaw = 0.001), 21 | //coupledProblem(sh = {0.0, 0.27}, shw = 0, m = 0.5, J = 0.0, zeta = {0.0, 0.001}, zetaw = 0.001), 22 | //rotor(J=1, tAccel=1.0, wAccel=0.0, externalTorque = 0.0), 23 | //rotor(J=1, tAccel=1.0, wAccel=1.0, externalTorque = 0.0), 24 | //rotor(J=1, tAccel=1.0, wAccel=1.0, externalTorque = 0.2), 25 | //squareGivenLaw(timeAccel = 1.0, initPosition = {0.0, 0.0}, targetAmplitude = {0.2, 0.1}), 26 | //twoCircle(), 27 | } 28 | -------------------------------------------------------------------------------- /run/mechanics: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- VM2D -*-----------------*---------------*\ 2 | | ## ## ## ## #### ##### | | Version 1.12 | 3 | | ## ## ### ### ## ## ## ## | VM2D: Vortex Method | 2024/01/14 | 4 | | ## ## ## # ## ## ## ## | for 2D Flow Simulation *----------------* 5 | | #### ## ## ## ## ## | Open Source Code | 6 | | ## ## ## ###### ##### | https://www.github.com/vortexmethods/VM2D | 7 | | | 8 | | Copyright (C) 2017-2024 I. Marchevsky, K. Sokol, E. Ryatina, A. Kolganova | 9 | *-----------------------------------------------------------------------------* 10 | | File name: mechanics | 11 | | Info: Dictionary with mechanical systems description | 12 | \*---------------------------------------------------------------------------*/ 13 | 14 | mech0 = mechanicsRigidImmovable(); 15 | mech1 = mechanicsRigidGivenLaw(timeAccel = $timeAccel, initPosition = $initPosition, /* targetVelocity = $targetVelocity,*/ targetAmplitude = $targetAmplitude); 16 | mech2 = mechanicsRigidOscillPart(sh=$sh, shw=$shw, m=$m, J=$J, zeta=$zeta, zetaw=$zetaw, initDisplacement=$initDisplacement, initAngularDisplacement=$initAngularDisplacement, initVelocity=$initVelocity, initAngularVelocity=$initAngularVelocity); 17 | //mech2 = mechanicsRigidOscillPart(k=$k, kw=$kw, m=$m, J=$J, c=$c, cw=$cw, initDisplacement=$initDisplacement, initAngularDisplacement=$initAngularDisplacement, initVelocity=$initVelocity, initAngularVelocity=$initAngularVelocity); 18 | 19 | mech3 = mechanicsRigidRotatePart(J=$J, wAccel=$wAccel, tAccel=$tAccel, externalTorque=$externalTorque); 20 | mech4 = mechanicsDeformable(); 21 | -------------------------------------------------------------------------------- /include/Eigen/SVD: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_SVD_MODULE_H 9 | #define EIGEN_SVD_MODULE_H 10 | 11 | #include "QR" 12 | #include "Householder" 13 | #include "Jacobi" 14 | 15 | #include "src/Core/util/DisableStupidWarnings.h" 16 | 17 | /** \defgroup SVD_Module SVD module 18 | * 19 | * 20 | * 21 | * This module provides SVD decomposition for matrices (both real and complex). 22 | * Two decomposition algorithms are provided: 23 | * - JacobiSVD implementing two-sided Jacobi iterations is numerically very accurate, fast for small matrices, but very slow for larger ones. 24 | * - BDCSVD implementing a recursive divide & conquer strategy on top of an upper-bidiagonalization which remains fast for large problems. 25 | * These decompositions are accessible via the respective classes and following MatrixBase methods: 26 | * - MatrixBase::jacobiSvd() 27 | * - MatrixBase::bdcSvd() 28 | * 29 | * \code 30 | * #include 31 | * \endcode 32 | */ 33 | 34 | #include "src/misc/RealSvd2x2.h" 35 | #include "src/SVD/UpperBidiagonalization.h" 36 | #include "src/SVD/SVDBase.h" 37 | #include "src/SVD/JacobiSVD.h" 38 | #include "src/SVD/BDCSVD.h" 39 | #if defined(EIGEN_USE_LAPACKE) && !defined(EIGEN_USE_LAPACKE_STRICT) 40 | #ifdef EIGEN_USE_MKL 41 | #include "mkl_lapacke.h" 42 | #else 43 | #include "src/misc/lapacke.h" 44 | #endif 45 | #include "src/SVD/JacobiSVD_LAPACKE.h" 46 | #endif 47 | 48 | #include "src/Core/util/ReenableStupidWarnings.h" 49 | 50 | #endif // EIGEN_SVD_MODULE_H 51 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 52 | -------------------------------------------------------------------------------- /include/unsupported/test/minres.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2012 Giacomo Po 5 | // Copyright (C) 2011 Gael Guennebaud 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | #include 11 | 12 | #include "../../test/sparse_solver.h" 13 | #include 14 | 15 | template void test_minres_T() 16 | { 17 | // Identity preconditioner 18 | MINRES, Lower, IdentityPreconditioner > minres_colmajor_lower_I; 19 | MINRES, Upper, IdentityPreconditioner > minres_colmajor_upper_I; 20 | 21 | // Diagonal preconditioner 22 | MINRES, Lower, DiagonalPreconditioner > minres_colmajor_lower_diag; 23 | MINRES, Upper, DiagonalPreconditioner > minres_colmajor_upper_diag; 24 | MINRES, Lower|Upper, DiagonalPreconditioner > minres_colmajor_uplo_diag; 25 | 26 | // call tests for SPD matrix 27 | CALL_SUBTEST( check_sparse_spd_solving(minres_colmajor_lower_I) ); 28 | CALL_SUBTEST( check_sparse_spd_solving(minres_colmajor_upper_I) ); 29 | 30 | CALL_SUBTEST( check_sparse_spd_solving(minres_colmajor_lower_diag) ); 31 | CALL_SUBTEST( check_sparse_spd_solving(minres_colmajor_upper_diag) ); 32 | CALL_SUBTEST( check_sparse_spd_solving(minres_colmajor_uplo_diag) ); 33 | 34 | // TO DO: symmetric semi-definite matrix 35 | // TO DO: symmetric indefinite matrix 36 | 37 | } 38 | 39 | EIGEN_DECLARE_TEST(minres) 40 | { 41 | CALL_SUBTEST_1(test_minres_T()); 42 | // CALL_SUBTEST_2(test_minres_T >()); 43 | 44 | } 45 | -------------------------------------------------------------------------------- /include/Eigen/src/Core/SelfCwiseBinaryOp.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009-2010 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SELFCWISEBINARYOP_H 11 | #define EIGEN_SELFCWISEBINARYOP_H 12 | 13 | namespace Eigen { 14 | 15 | // TODO generalize the scalar type of 'other' 16 | 17 | template 18 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase::operator*=(const Scalar& other) 19 | { 20 | internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::mul_assign_op()); 21 | return derived(); 22 | } 23 | 24 | template 25 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& ArrayBase::operator+=(const Scalar& other) 26 | { 27 | internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::add_assign_op()); 28 | return derived(); 29 | } 30 | 31 | template 32 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& ArrayBase::operator-=(const Scalar& other) 33 | { 34 | internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::sub_assign_op()); 35 | return derived(); 36 | } 37 | 38 | template 39 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase::operator/=(const Scalar& other) 40 | { 41 | internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::div_assign_op()); 42 | return derived(); 43 | } 44 | 45 | } // end namespace Eigen 46 | 47 | #endif // EIGEN_SELFCWISEBINARYOP_H 48 | -------------------------------------------------------------------------------- /include/Eigen/src/SparseCore/SparseRedux.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2014 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPARSEREDUX_H 11 | #define EIGEN_SPARSEREDUX_H 12 | 13 | namespace Eigen { 14 | 15 | template 16 | typename internal::traits::Scalar 17 | SparseMatrixBase::sum() const 18 | { 19 | eigen_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix"); 20 | Scalar res(0); 21 | internal::evaluator thisEval(derived()); 22 | for (Index j=0; j::InnerIterator iter(thisEval,j); iter; ++iter) 24 | res += iter.value(); 25 | return res; 26 | } 27 | 28 | template 29 | typename internal::traits >::Scalar 30 | SparseMatrix<_Scalar,_Options,_Index>::sum() const 31 | { 32 | eigen_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix"); 33 | if(this->isCompressed()) 34 | return Matrix::Map(m_data.valuePtr(), m_data.size()).sum(); 35 | else 36 | return Base::sum(); 37 | } 38 | 39 | template 40 | typename internal::traits >::Scalar 41 | SparseVector<_Scalar,_Options,_Index>::sum() const 42 | { 43 | eigen_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix"); 44 | return Matrix::Map(m_data.valuePtr(), m_data.size()).sum(); 45 | } 46 | 47 | } // end namespace Eigen 48 | 49 | #endif // EIGEN_SPARSEREDUX_H 50 | -------------------------------------------------------------------------------- /include/unsupported/Eigen/CXX11/src/ThreadPool/ThreadPoolInterface.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2014 Benoit Steiner 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_CXX11_THREADPOOL_THREAD_POOL_INTERFACE_H 11 | #define EIGEN_CXX11_THREADPOOL_THREAD_POOL_INTERFACE_H 12 | 13 | namespace Eigen { 14 | 15 | // This defines an interface that ThreadPoolDevice can take to use 16 | // custom thread pools underneath. 17 | class ThreadPoolInterface { 18 | public: 19 | // Submits a closure to be run by a thread in the pool. 20 | virtual void Schedule(std::function fn) = 0; 21 | 22 | // Submits a closure to be run by threads in the range [start, end) in the 23 | // pool. 24 | virtual void ScheduleWithHint(std::function fn, int /*start*/, 25 | int /*end*/) { 26 | // Just defer to Schedule in case sub-classes aren't interested in 27 | // overriding this functionality. 28 | Schedule(fn); 29 | } 30 | 31 | // If implemented, stop processing the closures that have been enqueued. 32 | // Currently running closures may still be processed. 33 | // If not implemented, does nothing. 34 | virtual void Cancel() {} 35 | 36 | // Returns the number of threads in the pool. 37 | virtual int NumThreads() const = 0; 38 | 39 | // Returns a logical thread index between 0 and NumThreads() - 1 if called 40 | // from one of the threads in the pool. Returns -1 otherwise. 41 | virtual int CurrentThreadId() const = 0; 42 | 43 | virtual ~ThreadPoolInterface() {} 44 | }; 45 | 46 | } // namespace Eigen 47 | 48 | #endif // EIGEN_CXX11_THREADPOOL_THREAD_POOL_INTERFACE_H 49 | -------------------------------------------------------------------------------- /include/unsupported/test/cxx11_tensor_notification.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2015 Vijay Vasudevan 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #define EIGEN_USE_THREADS 11 | 12 | #include 13 | 14 | #include 15 | #include "main.h" 16 | #include 17 | 18 | static void test_notification_single() 19 | { 20 | ThreadPool thread_pool(1); 21 | 22 | std::atomic counter(0); 23 | Eigen::Notification n; 24 | auto func = [&n, &counter](){ n.Wait(); ++counter;}; 25 | thread_pool.Schedule(func); 26 | EIGEN_SLEEP(1000); 27 | 28 | // The thread should be waiting for the notification. 29 | VERIFY_IS_EQUAL(counter, 0); 30 | 31 | // Unblock the thread 32 | n.Notify(); 33 | 34 | EIGEN_SLEEP(1000); 35 | 36 | // Verify the counter has been incremented 37 | VERIFY_IS_EQUAL(counter, 1); 38 | } 39 | 40 | // Like test_notification_single() but enqueues multiple threads to 41 | // validate that all threads get notified by Notify(). 42 | static void test_notification_multiple() 43 | { 44 | ThreadPool thread_pool(1); 45 | 46 | std::atomic counter(0); 47 | Eigen::Notification n; 48 | auto func = [&n, &counter](){ n.Wait(); ++counter;}; 49 | thread_pool.Schedule(func); 50 | thread_pool.Schedule(func); 51 | thread_pool.Schedule(func); 52 | thread_pool.Schedule(func); 53 | EIGEN_SLEEP(1000); 54 | VERIFY_IS_EQUAL(counter, 0); 55 | n.Notify(); 56 | EIGEN_SLEEP(1000); 57 | VERIFY_IS_EQUAL(counter, 4); 58 | } 59 | 60 | EIGEN_DECLARE_TEST(cxx11_tensor_notification) 61 | { 62 | CALL_SUBTEST(test_notification_single()); 63 | CALL_SUBTEST(test_notification_multiple()); 64 | } 65 | -------------------------------------------------------------------------------- /settings/airfoils/circle20: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- VM2D -*-----------------*---------------*\ 2 | | ## ## ## ## #### ##### | | Version 1.12 | 3 | | ## ## ### ### ## ## ## ## | VM2D: Vortex Method | 2024/01/14 | 4 | | ## ## ## # ## ## ## ## | for 2D Flow Simulation *----------------* 5 | | #### ## ## ## ## ## | Open Source Code | 6 | | ## ## ## ###### ##### | https://www.github.com/vortexmethods/VM2D | 7 | | | 8 | | Copyright (C) 2017-2024 I. Marchevsky, K. Sokol, E. Ryatina, A. Kolganova | 9 | *-----------------------------------------------------------------------------* 10 | | File name: circle20 | 11 | | Info: Circular airfoil (20 panels) | 12 | \*---------------------------------------------------------------------------*/ 13 | 14 | r = { 15 | {0.50000000000000000, 0}, 16 | {0.47552825814757677, 0.15450849718747370}, 17 | {0.40450849718747373, 0.29389262614623657}, 18 | {0.29389262614623651, 0.40450849718747373}, 19 | {0.15450849718747373, 0.47552825814757677}, 20 | {0, 0.50000000000000000}, 21 | {-0.15450849718747378, 0.47552825814757677}, 22 | {-0.29389262614623651, 0.40450849718747373}, 23 | {-0.40450849718747367, 0.29389262614623662}, 24 | {-0.47552825814757677, 0.15450849718747375}, 25 | {-0.50000000000000000, 0}, 26 | {-0.47552825814757677, -0.15450849718747386}, 27 | {-0.40450849718747361, -0.29389262614623668}, 28 | {-0.29389262614623662, -0.40450849718747367}, 29 | {-0.15450849718747378, -0.47552825814757677}, 30 | {0, -0.50000000000000000}, 31 | {0.15450849718747361, -0.47552825814757682}, 32 | {0.29389262614623685, -0.40450849718747350}, 33 | {0.40450849718747367, -0.29389262614623668}, 34 | {0.47552825814757677, -0.15450849718747384} 35 | }; -------------------------------------------------------------------------------- /settings/airfoils/rect01Frolov36: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- VM2D -*-----------------*---------------*\ 2 | | ## ## ## ## #### ##### | | Version 1.12 | 3 | | ## ## ### ### ## ## ## ## | VM2D: Vortex Method | 2024/01/14 | 4 | | ## ## ## # ## ## ## ## | for 2D Flow Simulation *----------------* 5 | | #### ## ## ## ## ## | Open Source Code | 6 | | ## ## ## ###### ##### | https://www.github.com/vortexmethods/VM2D | 7 | | | 8 | | Copyright (C) 2017-2024 I. Marchevsky, K. Sokol, E. Ryatina, A. Kolganova | 9 | *-----------------------------------------------------------------------------* 10 | | File name: rect01Frolov36 | 11 | | Info: rectangular airfoil (0.1 asp.ratio) (36 panels) | 12 | \*---------------------------------------------------------------------------*/ 13 | 14 | r = { 15 | { 0.25 , 0. }, 16 | { 0.25 , 0.025 }, 17 | { 0.21875 , 0.025 }, 18 | { 0.1875 , 0.025 }, 19 | { 0.15625 , 0.025 }, 20 | { 0.125 , 0.025 }, 21 | { 0.09375 , 0.025 }, 22 | { 0.0625 , 0.025 }, 23 | { 0.03125 , 0.025 }, 24 | { 0. , 0.025 }, 25 | { -0.03125 , 0.025 }, 26 | { -0.0625 , 0.025 }, 27 | { -0.09375 , 0.025 }, 28 | { -0.125 , 0.025 }, 29 | { -0.15625 , 0.025 }, 30 | { -0.1875 , 0.025 }, 31 | { -0.21875 , 0.025 }, 32 | { -0.25 , 0.025 }, 33 | { -0.25 , 0. }, 34 | { -0.25 , -0.025 }, 35 | { -0.21875 , -0.025 }, 36 | { -0.1875 , -0.025 }, 37 | { -0.15625 , -0.025 }, 38 | { -0.125 , -0.025 }, 39 | { -0.09375 , -0.025 }, 40 | { -0.0625 , -0.025 }, 41 | { -0.03125 , -0.025 }, 42 | { 0. , -0.025 }, 43 | { 0.03125 , -0.025 }, 44 | { 0.0625 , -0.025 }, 45 | { 0.09375 , -0.025 }, 46 | { 0.125 , -0.025 }, 47 | { 0.15625 , -0.025 }, 48 | { 0.1875 , -0.025 }, 49 | { 0.21875 , -0.025 }, 50 | { 0.25 , -0.025 } 51 | }; -------------------------------------------------------------------------------- /include/unsupported/test/cxx11_tensor_layout_swap.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2014 Benoit Steiner 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #include "main.h" 11 | 12 | #include 13 | 14 | using Eigen::Tensor; 15 | 16 | static void test_simple_swap() 17 | { 18 | Tensor tensor(2,3,7); 19 | tensor.setRandom(); 20 | 21 | Tensor tensor2 = tensor.swap_layout(); 22 | VERIFY_IS_EQUAL(tensor.dimension(0), tensor2.dimension(2)); 23 | VERIFY_IS_EQUAL(tensor.dimension(1), tensor2.dimension(1)); 24 | VERIFY_IS_EQUAL(tensor.dimension(2), tensor2.dimension(0)); 25 | 26 | for (int i = 0; i < 2; ++i) { 27 | for (int j = 0; j < 3; ++j) { 28 | for (int k = 0; k < 7; ++k) { 29 | VERIFY_IS_EQUAL(tensor(i,j,k), tensor2(k,j,i)); 30 | } 31 | } 32 | } 33 | } 34 | 35 | 36 | static void test_swap_as_lvalue() 37 | { 38 | Tensor tensor(2,3,7); 39 | tensor.setRandom(); 40 | 41 | Tensor tensor2(7,3,2); 42 | tensor2.swap_layout() = tensor; 43 | VERIFY_IS_EQUAL(tensor.dimension(0), tensor2.dimension(2)); 44 | VERIFY_IS_EQUAL(tensor.dimension(1), tensor2.dimension(1)); 45 | VERIFY_IS_EQUAL(tensor.dimension(2), tensor2.dimension(0)); 46 | 47 | for (int i = 0; i < 2; ++i) { 48 | for (int j = 0; j < 3; ++j) { 49 | for (int k = 0; k < 7; ++k) { 50 | VERIFY_IS_EQUAL(tensor(i,j,k), tensor2(k,j,i)); 51 | } 52 | } 53 | } 54 | } 55 | 56 | 57 | EIGEN_DECLARE_TEST(cxx11_tensor_layout_swap) 58 | { 59 | CALL_SUBTEST(test_simple_swap()); 60 | CALL_SUBTEST(test_swap_as_lvalue()); 61 | } 62 | -------------------------------------------------------------------------------- /include/unsupported/test/cxx11_tensor_const.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2014 Benoit Steiner 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #include "main.h" 11 | 12 | #include 13 | using Eigen::Tensor; 14 | 15 | 16 | static void test_simple_assign() 17 | { 18 | Tensor random(2,3,7); 19 | random.setRandom(); 20 | 21 | TensorMap > constant(random.data(), 2, 3, 7); 22 | Tensor result(2,3,7); 23 | result = constant; 24 | 25 | for (int i = 0; i < 2; ++i) { 26 | for (int j = 0; j < 3; ++j) { 27 | for (int k = 0; k < 7; ++k) { 28 | VERIFY_IS_EQUAL((result(i,j,k)), random(i,j,k)); 29 | } 30 | } 31 | } 32 | } 33 | 34 | 35 | static void test_assign_of_const_tensor() 36 | { 37 | Tensor random(2,3,7); 38 | random.setRandom(); 39 | 40 | TensorMap > constant1(random.data(), 2, 3, 7); 41 | TensorMap > constant2(random.data(), 2, 3, 7); 42 | const TensorMap > constant3(random.data(), 2, 3, 7); 43 | 44 | Tensor result1 = constant1.chip(0, 2); 45 | Tensor result2 = constant2.chip(0, 2); 46 | Tensor result3 = constant3.chip(0, 2); 47 | 48 | for (int i = 0; i < 2; ++i) { 49 | for (int j = 0; j < 3; ++j) { 50 | VERIFY_IS_EQUAL((result1(i,j)), random(i,j,0)); 51 | VERIFY_IS_EQUAL((result2(i,j)), random(i,j,0)); 52 | VERIFY_IS_EQUAL((result3(i,j)), random(i,j,0)); 53 | } 54 | } 55 | } 56 | 57 | 58 | EIGEN_DECLARE_TEST(cxx11_tensor_const) 59 | { 60 | CALL_SUBTEST(test_simple_assign()); 61 | CALL_SUBTEST(test_assign_of_const_tensor()); 62 | } 63 | -------------------------------------------------------------------------------- /include/Eigen/PaStiXSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_PASTIXSUPPORT_MODULE_H 9 | #define EIGEN_PASTIXSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | extern "C" { 16 | #include 17 | #include 18 | } 19 | 20 | #ifdef complex 21 | #undef complex 22 | #endif 23 | 24 | /** \ingroup Support_modules 25 | * \defgroup PaStiXSupport_Module PaStiXSupport module 26 | * 27 | * This module provides an interface to the PaSTiX library. 28 | * PaSTiX is a general \b supernodal, \b parallel and \b opensource sparse solver. 29 | * It provides the two following main factorization classes: 30 | * - class PastixLLT : a supernodal, parallel LLt Cholesky factorization. 31 | * - class PastixLDLT: a supernodal, parallel LDLt Cholesky factorization. 32 | * - class PastixLU : a supernodal, parallel LU factorization (optimized for a symmetric pattern). 33 | * 34 | * \code 35 | * #include 36 | * \endcode 37 | * 38 | * In order to use this module, the PaSTiX headers must be accessible from the include paths, and your binary must be linked to the PaSTiX library and its dependencies. 39 | * This wrapper resuires PaStiX version 5.x compiled without MPI support. 40 | * The dependencies depend on how PaSTiX has been compiled. 41 | * For a cmake based project, you can use our FindPaSTiX.cmake module to help you in this task. 42 | * 43 | */ 44 | 45 | #include "src/PaStiXSupport/PaStiXSupport.h" 46 | 47 | #include "src/Core/util/ReenableStupidWarnings.h" 48 | 49 | #endif // EIGEN_PASTIXSUPPORT_MODULE_H 50 | -------------------------------------------------------------------------------- /include/Eigen/src/Core/arch/Default/Settings.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2010 Gael Guennebaud 5 | // Copyright (C) 2006-2008 Benoit Jacob 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | 12 | /* All the parameters defined in this file can be specialized in the 13 | * architecture specific files, and/or by the user. 14 | * More to come... */ 15 | 16 | #ifndef EIGEN_DEFAULT_SETTINGS_H 17 | #define EIGEN_DEFAULT_SETTINGS_H 18 | 19 | /** Defines the maximal loop size to enable meta unrolling of loops. 20 | * Note that the value here is expressed in Eigen's own notion of "number of FLOPS", 21 | * it does not correspond to the number of iterations or the number of instructions 22 | */ 23 | #ifndef EIGEN_UNROLLING_LIMIT 24 | #define EIGEN_UNROLLING_LIMIT 110 25 | #endif 26 | 27 | /** Defines the threshold between a "small" and a "large" matrix. 28 | * This threshold is mainly used to select the proper product implementation. 29 | */ 30 | #ifndef EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD 31 | #define EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD 8 32 | #endif 33 | 34 | /** Defines the maximal width of the blocks used in the triangular product and solver 35 | * for vectors (level 2 blas xTRMV and xTRSV). The default is 8. 36 | */ 37 | #ifndef EIGEN_TUNE_TRIANGULAR_PANEL_WIDTH 38 | #define EIGEN_TUNE_TRIANGULAR_PANEL_WIDTH 8 39 | #endif 40 | 41 | 42 | /** Defines the default number of registers available for that architecture. 43 | * Currently it must be 8 or 16. Other values will fail. 44 | */ 45 | #ifndef EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS 46 | #define EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS 8 47 | #endif 48 | 49 | #endif // EIGEN_DEFAULT_SETTINGS_H 50 | -------------------------------------------------------------------------------- /include/Eigen/src/misc/RealSvd2x2.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009-2010 Benoit Jacob 5 | // Copyright (C) 2013-2016 Gael Guennebaud 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_REALSVD2X2_H 12 | #define EIGEN_REALSVD2X2_H 13 | 14 | namespace Eigen { 15 | 16 | namespace internal { 17 | 18 | template 19 | void real_2x2_jacobi_svd(const MatrixType& matrix, Index p, Index q, 20 | JacobiRotation *j_left, 21 | JacobiRotation *j_right) 22 | { 23 | using std::sqrt; 24 | using std::abs; 25 | Matrix m; 26 | m << numext::real(matrix.coeff(p,p)), numext::real(matrix.coeff(p,q)), 27 | numext::real(matrix.coeff(q,p)), numext::real(matrix.coeff(q,q)); 28 | JacobiRotation rot1; 29 | RealScalar t = m.coeff(0,0) + m.coeff(1,1); 30 | RealScalar d = m.coeff(1,0) - m.coeff(0,1); 31 | 32 | if(abs(d) < (std::numeric_limits::min)()) 33 | { 34 | rot1.s() = RealScalar(0); 35 | rot1.c() = RealScalar(1); 36 | } 37 | else 38 | { 39 | // If d!=0, then t/d cannot overflow because the magnitude of the 40 | // entries forming d are not too small compared to the ones forming t. 41 | RealScalar u = t / d; 42 | RealScalar tmp = sqrt(RealScalar(1) + numext::abs2(u)); 43 | rot1.s() = RealScalar(1) / tmp; 44 | rot1.c() = u / tmp; 45 | } 46 | m.applyOnTheLeft(0,1,rot1); 47 | j_right->makeJacobi(m,0,1); 48 | *j_left = rot1 * j_right->transpose(); 49 | } 50 | 51 | } // end namespace internal 52 | 53 | } // end namespace Eigen 54 | 55 | #endif // EIGEN_REALSVD2X2_H 56 | -------------------------------------------------------------------------------- /include/Eigen/SparseLU: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2012 Désiré Nuentsa-Wakam 5 | // Copyright (C) 2012 Gael Guennebaud 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_SPARSELU_MODULE_H 12 | #define EIGEN_SPARSELU_MODULE_H 13 | 14 | #include "SparseCore" 15 | 16 | /** 17 | * \defgroup SparseLU_Module SparseLU module 18 | * This module defines a supernodal factorization of general sparse matrices. 19 | * The code is fully optimized for supernode-panel updates with specialized kernels. 20 | * Please, see the documentation of the SparseLU class for more details. 21 | */ 22 | 23 | // Ordering interface 24 | #include "OrderingMethods" 25 | 26 | #include "src/Core/util/DisableStupidWarnings.h" 27 | 28 | #include "src/SparseLU/SparseLU_gemm_kernel.h" 29 | 30 | #include "src/SparseLU/SparseLU_Structs.h" 31 | #include "src/SparseLU/SparseLU_SupernodalMatrix.h" 32 | #include "src/SparseLU/SparseLUImpl.h" 33 | #include "src/SparseCore/SparseColEtree.h" 34 | #include "src/SparseLU/SparseLU_Memory.h" 35 | #include "src/SparseLU/SparseLU_heap_relax_snode.h" 36 | #include "src/SparseLU/SparseLU_relax_snode.h" 37 | #include "src/SparseLU/SparseLU_pivotL.h" 38 | #include "src/SparseLU/SparseLU_panel_dfs.h" 39 | #include "src/SparseLU/SparseLU_kernel_bmod.h" 40 | #include "src/SparseLU/SparseLU_panel_bmod.h" 41 | #include "src/SparseLU/SparseLU_column_dfs.h" 42 | #include "src/SparseLU/SparseLU_column_bmod.h" 43 | #include "src/SparseLU/SparseLU_copy_to_ucol.h" 44 | #include "src/SparseLU/SparseLU_pruneL.h" 45 | #include "src/SparseLU/SparseLU_Utils.h" 46 | #include "src/SparseLU/SparseLU.h" 47 | 48 | #include "src/Core/util/ReenableStupidWarnings.h" 49 | 50 | #endif // EIGEN_SPARSELU_MODULE_H 51 | -------------------------------------------------------------------------------- /include/unsupported/Eigen/NumericalDiff: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Thomas Capricelli 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_NUMERICALDIFF_MODULE 11 | #define EIGEN_NUMERICALDIFF_MODULE 12 | 13 | #include "../../Eigen/Core" 14 | 15 | namespace Eigen { 16 | 17 | /** 18 | * \defgroup NumericalDiff_Module Numerical differentiation module 19 | * 20 | * \code 21 | * #include 22 | * \endcode 23 | * 24 | * See http://en.wikipedia.org/wiki/Numerical_differentiation 25 | * 26 | * Warning : this should NOT be confused with automatic differentiation, which 27 | * is a different method and has its own module in Eigen : \ref 28 | * AutoDiff_Module. 29 | * 30 | * Currently only "Forward" and "Central" schemes are implemented. Those 31 | * are basic methods, and there exist some more elaborated way of 32 | * computing such approximates. They are implemented using both 33 | * proprietary and free software, and usually requires linking to an 34 | * external library. It is very easy for you to write a functor 35 | * using such software, and the purpose is quite orthogonal to what we 36 | * want to achieve with Eigen. 37 | * 38 | * This is why we will not provide wrappers for every great numerical 39 | * differentiation software that exist, but should rather stick with those 40 | * basic ones, that still are useful for testing. 41 | * 42 | * Also, the \ref NonLinearOptimization_Module needs this in order to 43 | * provide full features compatibility with the original (c)minpack 44 | * package. 45 | * 46 | */ 47 | } 48 | 49 | //@{ 50 | 51 | #include "src/NumericalDiff/NumericalDiff.h" 52 | 53 | //@} 54 | 55 | 56 | #endif // EIGEN_NUMERICALDIFF_MODULE 57 | -------------------------------------------------------------------------------- /settings/airfoils/rectFrolov-c025-n38: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- VM2D -*-----------------*---------------*\ 2 | | ## ## ## ## #### ##### | | Version 1.12 | 3 | | ## ## ### ### ## ## ## ## | VM2D: Vortex Method | 2024/01/14 | 4 | | ## ## ## # ## ## ## ## | for 2D Flow Simulation *----------------* 5 | | #### ## ## ## ## ## | Open Source Code | 6 | | ## ## ## ###### ##### | https://www.github.com/vortexmethods/VM2D | 7 | | | 8 | | Copyright (C) 2017-2024 I. Marchevsky, K. Sokol, E. Ryatina, A. Kolganova | 9 | *-----------------------------------------------------------------------------* 10 | | File name: rectFrolov-c025-n38 | 11 | | Info: rectangular airfoil (0.128 asp.ratio) (38 panels) | 12 | \*---------------------------------------------------------------------------*/ 13 | 14 | r = { 15 | { 0.125 , 0.016 }, 16 | { 0.109375 , 0.016 }, 17 | { 0.09375 , 0.016 }, 18 | { 0.078125 , 0.016 }, 19 | { 0.0625 , 0.016 }, 20 | { 0.046875 , 0.016 }, 21 | { 0.03125 , 0.016 }, 22 | { 0.015625 , 0.016 }, 23 | { 0. , 0.016 }, 24 | { -0.015625 , 0.016 }, 25 | { -0.03125 , 0.016 }, 26 | { -0.046875 , 0.016 }, 27 | { -0.0625 , 0.016 }, 28 | { -0.078125 , 0.016 }, 29 | { -0.09375 , 0.016 }, 30 | { -0.109375 , 0.016 }, 31 | { -0.125 , 0.016 }, 32 | { -0.125 , 0.00533333 }, 33 | { -0.125 , -0.00533333 }, 34 | { -0.125 , -0.016 }, 35 | { -0.109375 , -0.016 }, 36 | { -0.09375 , -0.016 }, 37 | { -0.078125 , -0.016 }, 38 | { -0.0625 , -0.016 }, 39 | { -0.046875 , -0.016 }, 40 | { -0.03125 , -0.016 }, 41 | { -0.015625 , -0.016 }, 42 | { 0. , -0.016 }, 43 | { 0.015625 , -0.016 }, 44 | { 0.03125 , -0.016 }, 45 | { 0.046875 , -0.016 }, 46 | { 0.0625 , -0.016 }, 47 | { 0.078125 , -0.016 }, 48 | { 0.09375 , -0.016 }, 49 | { 0.109375 , -0.016 }, 50 | { 0.125 , -0.016 }, 51 | { 0.125 , -0.00533333 }, 52 | { 0.125 , 0.00533333 } 53 | }; -------------------------------------------------------------------------------- /include/unsupported/doc/examples/EulerAngles.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace Eigen; 5 | 6 | int main() 7 | { 8 | // A common Euler system by many armies around the world, 9 | // where the first one is the azimuth(the angle from the north - 10 | // the same angle that is show in compass) 11 | // and the second one is elevation(the angle from the horizon) 12 | // and the third one is roll(the angle between the horizontal body 13 | // direction and the plane ground surface) 14 | // Keep remembering we're using radian angles here! 15 | typedef EulerSystem<-EULER_Z, EULER_Y, EULER_X> MyArmySystem; 16 | typedef EulerAngles MyArmyAngles; 17 | 18 | MyArmyAngles vehicleAngles( 19 | 3.14/*PI*/ / 2, /* heading to east, notice that this angle is counter-clockwise */ 20 | -0.3, /* going down from a mountain */ 21 | 0.1); /* slightly rolled to the right */ 22 | 23 | // Some Euler angles representation that our plane use. 24 | EulerAnglesZYZd planeAngles(0.78474, 0.5271, -0.513794); 25 | 26 | MyArmyAngles planeAnglesInMyArmyAngles(planeAngles); 27 | 28 | std::cout << "vehicle angles(MyArmy): " << vehicleAngles << std::endl; 29 | std::cout << "plane angles(ZYZ): " << planeAngles << std::endl; 30 | std::cout << "plane angles(MyArmy): " << planeAnglesInMyArmyAngles << std::endl; 31 | 32 | // Now lets rotate the plane a little bit 33 | std::cout << "==========================================================\n"; 34 | std::cout << "rotating plane now!\n"; 35 | std::cout << "==========================================================\n"; 36 | 37 | Quaterniond planeRotated = AngleAxisd(-0.342, Vector3d::UnitY()) * planeAngles; 38 | 39 | planeAngles = planeRotated; 40 | planeAnglesInMyArmyAngles = planeRotated; 41 | 42 | std::cout << "new plane angles(ZYZ): " << planeAngles << std::endl; 43 | std::cout << "new plane angles(MyArmy): " << planeAnglesInMyArmyAngles << std::endl; 44 | 45 | return 0; 46 | } 47 | -------------------------------------------------------------------------------- /include/Eigen/Eigenvalues: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_EIGENVALUES_MODULE_H 9 | #define EIGEN_EIGENVALUES_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "Cholesky" 14 | #include "Jacobi" 15 | #include "Householder" 16 | #include "LU" 17 | #include "Geometry" 18 | 19 | #include "src/Core/util/DisableStupidWarnings.h" 20 | 21 | /** \defgroup Eigenvalues_Module Eigenvalues module 22 | * 23 | * 24 | * 25 | * This module mainly provides various eigenvalue solvers. 26 | * This module also provides some MatrixBase methods, including: 27 | * - MatrixBase::eigenvalues(), 28 | * - MatrixBase::operatorNorm() 29 | * 30 | * \code 31 | * #include 32 | * \endcode 33 | */ 34 | 35 | #include "src/misc/RealSvd2x2.h" 36 | #include "src/Eigenvalues/Tridiagonalization.h" 37 | #include "src/Eigenvalues/RealSchur.h" 38 | #include "src/Eigenvalues/EigenSolver.h" 39 | #include "src/Eigenvalues/SelfAdjointEigenSolver.h" 40 | #include "src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h" 41 | #include "src/Eigenvalues/HessenbergDecomposition.h" 42 | #include "src/Eigenvalues/ComplexSchur.h" 43 | #include "src/Eigenvalues/ComplexEigenSolver.h" 44 | #include "src/Eigenvalues/RealQZ.h" 45 | #include "src/Eigenvalues/GeneralizedEigenSolver.h" 46 | #include "src/Eigenvalues/MatrixBaseEigenvalues.h" 47 | #ifdef EIGEN_USE_LAPACKE 48 | #ifdef EIGEN_USE_MKL 49 | #include "mkl_lapacke.h" 50 | #else 51 | #include "src/misc/lapacke.h" 52 | #endif 53 | #include "src/Eigenvalues/RealSchur_LAPACKE.h" 54 | #include "src/Eigenvalues/ComplexSchur_LAPACKE.h" 55 | #include "src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h" 56 | #endif 57 | 58 | #include "src/Core/util/ReenableStupidWarnings.h" 59 | 60 | #endif // EIGEN_EIGENVALUES_MODULE_H 61 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 62 | -------------------------------------------------------------------------------- /include/unsupported/README.txt: -------------------------------------------------------------------------------- 1 | This directory contains contributions from various users. 2 | They are provided "as is", without any support. Nevertheless, 3 | most of them are subject to be included in Eigen in the future. 4 | 5 | In order to use an unsupported module you have to do either: 6 | 7 | - add the path_to_eigen/unsupported directory to your include path and do: 8 | #include 9 | 10 | - or directly do: 11 | #include 12 | 13 | 14 | If you are interested in contributing to one of them, or have other stuff 15 | you would like to share, feel free to contact us: 16 | http://eigen.tuxfamily.org/index.php?title=Main_Page#Mailing_list 17 | 18 | Any kind of contributions are much appreciated, even very preliminary ones. 19 | However, it: 20 | - must rely on Eigen, 21 | - must be highly related to math, 22 | - should have some general purpose in the sense that it could 23 | potentially become an official Eigen module (or be merged into another one). 24 | 25 | In doubt feel free to contact us. For instance, if your addons is very too specific 26 | but it shows an interesting way of using Eigen, then it could be a nice demo. 27 | 28 | 29 | This directory is organized as follow: 30 | 31 | unsupported/Eigen/ModuleHeader1 32 | unsupported/Eigen/ModuleHeader2 33 | unsupported/Eigen/... 34 | unsupported/Eigen/src/Module1/SourceFile1.h 35 | unsupported/Eigen/src/Module1/SourceFile2.h 36 | unsupported/Eigen/src/Module1/... 37 | unsupported/Eigen/src/Module2/SourceFile1.h 38 | unsupported/Eigen/src/Module2/SourceFile2.h 39 | unsupported/Eigen/src/Module2/... 40 | unsupported/Eigen/src/... 41 | unsupported/doc/snippets/.cpp <- code snippets for the doc 42 | unsupported/doc/examples/.cpp <- examples for the doc 43 | unsupported/doc/TutorialModule1.dox 44 | unsupported/doc/TutorialModule2.dox 45 | unsupported/doc/... 46 | unsupported/test/.cpp <- unit test files 47 | 48 | The documentation is generated at the same time than the main Eigen documentation. 49 | The .html files are generated in: build_dir/doc/html/unsupported/ 50 | 51 | -------------------------------------------------------------------------------- /include/Eigen/CholmodSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_CHOLMODSUPPORT_MODULE_H 9 | #define EIGEN_CHOLMODSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | extern "C" { 16 | #include 17 | } 18 | 19 | /** \ingroup Support_modules 20 | * \defgroup CholmodSupport_Module CholmodSupport module 21 | * 22 | * This module provides an interface to the Cholmod library which is part of the suitesparse package. 23 | * It provides the two following main factorization classes: 24 | * - class CholmodSupernodalLLT: a supernodal LLT Cholesky factorization. 25 | * - class CholmodDecomposiiton: a general L(D)LT Cholesky factorization with automatic or explicit runtime selection of the underlying factorization method (supernodal or simplicial). 26 | * 27 | * For the sake of completeness, this module also propose the two following classes: 28 | * - class CholmodSimplicialLLT 29 | * - class CholmodSimplicialLDLT 30 | * Note that these classes does not bring any particular advantage compared to the built-in 31 | * SimplicialLLT and SimplicialLDLT factorization classes. 32 | * 33 | * \code 34 | * #include 35 | * \endcode 36 | * 37 | * In order to use this module, the cholmod headers must be accessible from the include paths, and your binary must be linked to the cholmod library and its dependencies. 38 | * The dependencies depend on how cholmod has been compiled. 39 | * For a cmake based project, you can use our FindCholmod.cmake module to help you in this task. 40 | * 41 | */ 42 | 43 | #include "src/CholmodSupport/CholmodSupport.h" 44 | 45 | #include "src/Core/util/ReenableStupidWarnings.h" 46 | 47 | #endif // EIGEN_CHOLMODSUPPORT_MODULE_H 48 | 49 | -------------------------------------------------------------------------------- /include/Eigen/src/Core/arch/Default/ConjHelper.h: -------------------------------------------------------------------------------- 1 | 2 | // This file is part of Eigen, a lightweight C++ template library 3 | // for linear algebra. 4 | // 5 | // Copyright (C) 2017 Gael Guennebaud 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_ARCH_CONJ_HELPER_H 12 | #define EIGEN_ARCH_CONJ_HELPER_H 13 | 14 | #define EIGEN_MAKE_CONJ_HELPER_CPLX_REAL(PACKET_CPLX, PACKET_REAL) \ 15 | template<> struct conj_helper { \ 16 | EIGEN_STRONG_INLINE PACKET_CPLX pmadd(const PACKET_REAL& x, const PACKET_CPLX& y, const PACKET_CPLX& c) const \ 17 | { return padd(c, pmul(x,y)); } \ 18 | EIGEN_STRONG_INLINE PACKET_CPLX pmul(const PACKET_REAL& x, const PACKET_CPLX& y) const \ 19 | { return PACKET_CPLX(Eigen::internal::pmul(x, y.v)); } \ 20 | }; \ 21 | \ 22 | template<> struct conj_helper { \ 23 | EIGEN_STRONG_INLINE PACKET_CPLX pmadd(const PACKET_CPLX& x, const PACKET_REAL& y, const PACKET_CPLX& c) const \ 24 | { return padd(c, pmul(x,y)); } \ 25 | EIGEN_STRONG_INLINE PACKET_CPLX pmul(const PACKET_CPLX& x, const PACKET_REAL& y) const \ 26 | { return PACKET_CPLX(Eigen::internal::pmul(x.v, y)); } \ 27 | }; 28 | 29 | #endif // EIGEN_ARCH_CONJ_HELPER_H 30 | -------------------------------------------------------------------------------- /tutorials/lamb/passport: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- VM2D -*-----------------*---------------*\ 2 | | ## ## ## ## #### ##### | | Version 1.12 | 3 | | ## ## ### ### ## ## ## ## | VM2D: Vortex Method | 2024/01/14 | 4 | | ## ## ## # ## ## ## ## | for 2D Flow Simulation *----------------* 5 | | #### ## ## ## ## ## | Open Source Code | 6 | | ## ## ## ###### ##### | https://www.github.com/vortexmethods/VM2D | 7 | | | 8 | | Copyright (C) 2017-2024 I. Marchevsky, K. Sokol, E. Ryatina, A. Kolganova | 9 | *-----------------------------------------------------------------------------* 10 | | File name: passport | 11 | | Info: Parameters of the problem to be solved | 12 | \*---------------------------------------------------------------------------*/ 13 | 14 | //Physical Properties 15 | rho = 1.0; 16 | vInf = {0.0, 0.0}; 17 | vRef = 1.0; 18 | nu = 0.0025; 19 | 20 | //Time Discretization Properties 21 | //timeStart = 0.0; //by default = 0.0 22 | timeStop = 100000.0001; 23 | dt = 0.1; 24 | accelVel = Impulse; //by default = RampLin(0.0) 25 | 26 | saveVtx = binary(200); //by default = 100 27 | saveVp = 0; //by default = 0 28 | nameLength = 5; //by default = 5 29 | 30 | calcCoefficients = true; 31 | 32 | //Wake Discretization Properties 33 | eps = 0.05; 34 | epscol = 0.0; 35 | distFar = 100.0; //by default = 10.0 36 | delta = 5.e-6; //by default = 1.e-5 37 | vortexPerPanel = 1; //by default = 1 38 | maxGamma = 0.0; //by default = 0.0 39 | 40 | //Numerical Schemes 41 | linearSystemSolver = linearSystemGauss; 42 | velocityComputation = velocityBiotSavart; 43 | panelsType = panelsRectilinear; 44 | boundaryConditionSatisfaction = boundaryConstantLayerAverage; 45 | 46 | //Files and parameters 47 | airfoil = { }; 48 | fileWake = { "wake1602x2" }; //by default={} -------------------------------------------------------------------------------- /tutorials/blasius/passport: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- VM2D -*-----------------*---------------*\ 2 | | ## ## ## ## #### ##### | | Version 1.12 | 3 | | ## ## ### ### ## ## ## ## | VM2D: Vortex Method | 2024/01/14 | 4 | | ## ## ## # ## ## ## ## | for 2D Flow Simulation *----------------* 5 | | #### ## ## ## ## ## | Open Source Code | 6 | | ## ## ## ###### ##### | https://www.github.com/vortexmethods/VM2D | 7 | | | 8 | | Copyright (C) 2017-2024 I. Marchevsky, K. Sokol, E. Ryatina, A. Kolganova | 9 | *-----------------------------------------------------------------------------* 10 | | File name: passport | 11 | | Info: Parameters of the problem to be solved | 12 | \*---------------------------------------------------------------------------*/ 13 | 14 | //Physical Properties 15 | rho = 1.0; 16 | vInf = {1.0, 0.0}; 17 | nu = 0.001; 18 | 19 | //Time Discretization Properties 20 | //timeStart = 0.0; //by default = 0.0 21 | timeStop = 50.0001; 22 | dt = 0.00015; 23 | accelVel = RampLin(0.2); //by default = RampLin(0.0) 24 | 25 | saveVtx = binary(100); //by default = 100 26 | saveVp = binary(100); //by default = 0 27 | nameLength = 6; //by default = 5 28 | 29 | //Wake Discretization Properties 30 | eps = 0.0007; 31 | epscol = 0.0005; 32 | distFar = 25.0; //by default = 10.0 33 | delta = 5.e-6; //by default = 1.e-5 34 | vortexPerPanel = 1; //by default = 1 35 | maxGamma = 0.000025; //by default = 0.0 36 | 37 | //Numerical Schemes 38 | linearSystemSolver = linearSystemGauss; 39 | velocityComputation = velocityBiotSavart; 40 | panelsType = panelsRectilinear; 41 | boundaryConditionSatisfaction = boundaryConstantLayerAverage; 42 | 43 | //Files and parameters 44 | airfoil = { "blasius1266"(basePoint = {0.0, 0.0}, mechanicalSystem=mech0) }; 45 | //fileWake = { "OblakoV1000" }; //by default={} -------------------------------------------------------------------------------- /tutorials/rotor/passport: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- VM2D -*-----------------*---------------*\ 2 | | ## ## ## ## #### ##### | | Version 1.12 | 3 | | ## ## ### ### ## ## ## ## | VM2D: Vortex Method | 2024/01/14 | 4 | | ## ## ## # ## ## ## ## | for 2D Flow Simulation *----------------* 5 | | #### ## ## ## ## ## | Open Source Code | 6 | | ## ## ## ###### ##### | https://www.github.com/vortexmethods/VM2D | 7 | | | 8 | | Copyright (C) 2017-2024 I. Marchevsky, K. Sokol, E. Ryatina, A. Kolganova | 9 | *-----------------------------------------------------------------------------* 10 | | File name: passport | 11 | | Info: Parameters of the problem to be solved | 12 | \*---------------------------------------------------------------------------*/ 13 | 14 | //Physical Properties 15 | rho = 1.0; 16 | vInf = {1.0, 0.0}; 17 | nu = 0.0002; 18 | 19 | //Time Discretization Properties 20 | //timeStart = 0.0; //by default = 0.0 21 | timeStop = 400.0001; 22 | dt = 0.005; 23 | accelVel = RampLin(1.0); //by default = RampLin(0.0) 24 | 25 | saveVtx = binary(10); //by default = 100 26 | saveVp = 0; //by default = 0 27 | nameLength = 5; //by default = 5 28 | 29 | //Wake Discretization Properties 30 | eps = 0.004; 31 | epscol = 0.004; 32 | distFar = 20.0; //by default = 10.0 33 | delta = 1.e-6; //by default = 1.e-5 34 | vortexPerPanel = 1; //by default = 1 35 | maxGamma = 0.1; //by default = 0.0 36 | 37 | //Numerical Schemes 38 | linearSystemSolver = linearSystemGauss; 39 | velocityComputation = velocityBiotSavart; 40 | panelsType = panelsRectilinear; 41 | boundaryConditionSatisfaction = boundaryConstantLayerAverage; 42 | 43 | //Files and parameters 44 | airfoil = { "rotor30_742"(basePoint = {0.0, 0.0}, mechanicalSystem=mech3) }; 45 | //fileWake = { "OblakoV1000" }; //by default={} 46 | -------------------------------------------------------------------------------- /tutorials/wingBase/passport: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- VM2D -*-----------------*---------------*\ 2 | | ## ## ## ## #### ##### | | Version 1.12 | 3 | | ## ## ### ### ## ## ## ## | VM2D: Vortex Method | 2024/01/14 | 4 | | ## ## ## # ## ## ## ## | for 2D Flow Simulation *----------------* 5 | | #### ## ## ## ## ## | Open Source Code | 6 | | ## ## ## ###### ##### | https://www.github.com/vortexmethods/VM2D | 7 | | | 8 | | Copyright (C) 2017-2024 I. Marchevsky, K. Sokol, E. Ryatina, A. Kolganova | 9 | *-----------------------------------------------------------------------------* 10 | | File name: passport | 11 | | Info: Parameters of the problem to be solved | 12 | \*---------------------------------------------------------------------------*/ 13 | 14 | //Physical Properties 15 | rho = 1.0; 16 | vInf = {1.0, 0.0}; 17 | nu = 0.0001; 18 | 19 | //Time Discretization Properties 20 | //timeStart = 0.0; //by default = 0.0 21 | timeStop = 0.5001; 22 | dt = 0.001; 23 | accelVel = RampLin(0.1); //by default = RampLin(0.0) 24 | 25 | saveVtx = binary(10); //by default = 100 26 | saveVp = 0; //by default = 0 27 | nameLength = 6; //by default = 5 28 | 29 | //Wake Discretization Properties 30 | eps = 0.008; 31 | epscol = 0.0005; 32 | distFar = 20.0; //by default = 10.0 33 | delta = 1.e-6; //by default = 1.e-5 34 | vortexPerPanel = 3; //by default = 1 35 | maxGamma = 0.0; //by default = 0.0 36 | 37 | //Numerical Schemes 38 | linearSystemSolver = linearSystemGauss; 39 | velocityComputation = velocityBiotSavart; 40 | panelsType = panelsRectilinear; 41 | boundaryConditionSatisfaction = boundaryConstantLayerAverage; 42 | 43 | //Files and parameters 44 | airfoil = { "V12wing400"(basePoint = {0.0, 0.0}, angle=$angle, mechanicalSystem=mech0) }; 45 | //fileWake = { "OblakoV1000" }; //by default={} -------------------------------------------------------------------------------- /tutorials/blasius5k/passport: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- VM2D -*-----------------*---------------*\ 2 | | ## ## ## ## #### ##### | | Version 1.12 | 3 | | ## ## ### ### ## ## ## ## | VM2D: Vortex Method | 2024/01/14 | 4 | | ## ## ## # ## ## ## ## | for 2D Flow Simulation *----------------* 5 | | #### ## ## ## ## ## | Open Source Code | 6 | | ## ## ## ###### ##### | https://www.github.com/vortexmethods/VM2D | 7 | | | 8 | | Copyright (C) 2017-2024 I. Marchevsky, K. Sokol, E. Ryatina, A. Kolganova | 9 | *-----------------------------------------------------------------------------* 10 | | File name: passport | 11 | | Info: Parameters of the problem to be solved | 12 | \*---------------------------------------------------------------------------*/ 13 | 14 | //Physical Properties 15 | rho = 1.0; 16 | vInf = {1.0, 0.0}; 17 | nu = 0.001; 18 | 19 | //Time Discretization Properties 20 | //timeStart = 0.0; //by default = 0.0 21 | timeStop = 50.0001; 22 | dt = 0.0002;// 0.00015; 23 | accelVel = RampLin(0.2); //by default = RampLin(0.0) 24 | 25 | saveVtx = binary(100); //by default = 100 26 | saveVp = binary(100); //by default = 0 27 | nameLength = 6; //by default = 5 28 | 29 | //Wake Discretization Properties 30 | eps = 0.000200; 31 | epscol = 0.000133; 32 | distFar = 25.0; //by default = 10.0 33 | delta = 1.e-7; //by default = 1.e-5 34 | vortexPerPanel = 1; //by default = 1 35 | maxGamma = 0.00004; //by default = 0.0 36 | 37 | //Numerical Schemes 38 | linearSystemSolver = linearSystemGauss; 39 | velocityComputation = velocityBiotSavart; 40 | panelsType = panelsRectilinear; 41 | boundaryConditionSatisfaction = boundaryConstantLayerAverage; 42 | 43 | //Files and parameters 44 | airfoil = { "blasius5088"(basePoint = {0.0, 0.0}, mechanicalSystem=mech0) }; 45 | //fileWake = { "OblakoV1000" }; //by default={} -------------------------------------------------------------------------------- /include/unsupported/Eigen/src/NonLinearOptimization/chkder.h: -------------------------------------------------------------------------------- 1 | #define chkder_log10e 0.43429448190325182765 2 | #define chkder_factor 100. 3 | 4 | namespace Eigen { 5 | 6 | namespace internal { 7 | 8 | template 9 | void chkder( 10 | const Matrix< Scalar, Dynamic, 1 > &x, 11 | const Matrix< Scalar, Dynamic, 1 > &fvec, 12 | const Matrix< Scalar, Dynamic, Dynamic > &fjac, 13 | Matrix< Scalar, Dynamic, 1 > &xp, 14 | const Matrix< Scalar, Dynamic, 1 > &fvecp, 15 | int mode, 16 | Matrix< Scalar, Dynamic, 1 > &err 17 | ) 18 | { 19 | using std::sqrt; 20 | using std::abs; 21 | using std::log; 22 | 23 | typedef DenseIndex Index; 24 | 25 | const Scalar eps = sqrt(NumTraits::epsilon()); 26 | const Scalar epsf = chkder_factor * NumTraits::epsilon(); 27 | const Scalar epslog = chkder_log10e * log(eps); 28 | Scalar temp; 29 | 30 | const Index m = fvec.size(), n = x.size(); 31 | 32 | if (mode != 2) { 33 | /* mode = 1. */ 34 | xp.resize(n); 35 | for (Index j = 0; j < n; ++j) { 36 | temp = eps * abs(x[j]); 37 | if (temp == 0.) 38 | temp = eps; 39 | xp[j] = x[j] + temp; 40 | } 41 | } 42 | else { 43 | /* mode = 2. */ 44 | err.setZero(m); 45 | for (Index j = 0; j < n; ++j) { 46 | temp = abs(x[j]); 47 | if (temp == 0.) 48 | temp = 1.; 49 | err += temp * fjac.col(j); 50 | } 51 | for (Index i = 0; i < m; ++i) { 52 | temp = 1.; 53 | if (fvec[i] != 0. && fvecp[i] != 0. && abs(fvecp[i] - fvec[i]) >= epsf * abs(fvec[i])) 54 | temp = eps * abs((fvecp[i] - fvec[i]) / eps - err[i]) / (abs(fvec[i]) + abs(fvecp[i])); 55 | err[i] = 1.; 56 | if (temp > NumTraits::epsilon() && temp < eps) 57 | err[i] = (chkder_log10e * log(temp) - epslog) / epslog; 58 | if (temp >= eps) 59 | err[i] = 0.; 60 | } 61 | } 62 | } 63 | 64 | } // end namespace internal 65 | 66 | } // end namespace Eigen 67 | -------------------------------------------------------------------------------- /include/Eigen/Geometry: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_GEOMETRY_MODULE_H 9 | #define EIGEN_GEOMETRY_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "SVD" 14 | #include "LU" 15 | #include 16 | 17 | #include "src/Core/util/DisableStupidWarnings.h" 18 | 19 | /** \defgroup Geometry_Module Geometry module 20 | * 21 | * This module provides support for: 22 | * - fixed-size homogeneous transformations 23 | * - translation, scaling, 2D and 3D rotations 24 | * - \link Quaternion quaternions \endlink 25 | * - cross products (\ref MatrixBase::cross, \ref MatrixBase::cross3) 26 | * - orthognal vector generation (\ref MatrixBase::unitOrthogonal) 27 | * - some linear components: \link ParametrizedLine parametrized-lines \endlink and \link Hyperplane hyperplanes \endlink 28 | * - \link AlignedBox axis aligned bounding boxes \endlink 29 | * - \link umeyama least-square transformation fitting \endlink 30 | * 31 | * \code 32 | * #include 33 | * \endcode 34 | */ 35 | 36 | #include "src/Geometry/OrthoMethods.h" 37 | #include "src/Geometry/EulerAngles.h" 38 | 39 | #include "src/Geometry/Homogeneous.h" 40 | #include "src/Geometry/RotationBase.h" 41 | #include "src/Geometry/Rotation2D.h" 42 | #include "src/Geometry/Quaternion.h" 43 | #include "src/Geometry/AngleAxis.h" 44 | #include "src/Geometry/Transform.h" 45 | #include "src/Geometry/Translation.h" 46 | #include "src/Geometry/Scaling.h" 47 | #include "src/Geometry/Hyperplane.h" 48 | #include "src/Geometry/ParametrizedLine.h" 49 | #include "src/Geometry/AlignedBox.h" 50 | #include "src/Geometry/Umeyama.h" 51 | 52 | // Use the SSE optimized version whenever possible. 53 | #if defined EIGEN_VECTORIZE_SSE 54 | #include "src/Geometry/arch/Geometry_SSE.h" 55 | #endif 56 | 57 | #include "src/Core/util/ReenableStupidWarnings.h" 58 | 59 | #endif // EIGEN_GEOMETRY_MODULE_H 60 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 61 | -------------------------------------------------------------------------------- /include/unsupported/test/cxx11_maxsizevector.cpp: -------------------------------------------------------------------------------- 1 | #include "main.h" 2 | 3 | #include // std::exception 4 | 5 | #include 6 | 7 | struct Foo 8 | { 9 | static Index object_count; 10 | static Index object_limit; 11 | EIGEN_ALIGN_TO_BOUNDARY(128) int dummy; 12 | 13 | Foo(int x=0) : dummy(x) 14 | { 15 | #ifdef EIGEN_EXCEPTIONS 16 | // TODO: Is this the correct way to handle this? 17 | if (Foo::object_count > Foo::object_limit) { std::cout << "\nThrow!\n"; throw Foo::Fail(); } 18 | #endif 19 | std::cout << '+'; 20 | ++Foo::object_count; 21 | eigen_assert((internal::UIntPtr(this) & (127)) == 0); 22 | } 23 | Foo(const Foo&) 24 | { 25 | std::cout << 'c'; 26 | ++Foo::object_count; 27 | eigen_assert((internal::UIntPtr(this) & (127)) == 0); 28 | } 29 | 30 | ~Foo() 31 | { 32 | std::cout << '~'; 33 | --Foo::object_count; 34 | } 35 | 36 | class Fail : public std::exception {}; 37 | }; 38 | 39 | Index Foo::object_count = 0; 40 | Index Foo::object_limit = 0; 41 | 42 | 43 | 44 | EIGEN_DECLARE_TEST(cxx11_maxsizevector) 45 | { 46 | typedef MaxSizeVector VectorX; 47 | Foo::object_count = 0; 48 | for(int r = 0; r < g_repeat; r++) { 49 | Index rows = internal::random(3,30); 50 | Foo::object_limit = internal::random(0, rows - 2); 51 | std::cout << "object_limit = " << Foo::object_limit << std::endl; 52 | bool exception_raised = false; 53 | #ifdef EIGEN_EXCEPTIONS 54 | try 55 | { 56 | #endif 57 | std::cout << "\nVectorX m(" << rows << ");\n"; 58 | VectorX vect(rows); 59 | for(int i=0; i EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet2f pexp(const Packet2f& x) 16 | { return pexp_float(x); } 17 | template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet4f pexp(const Packet4f& x) 18 | { return pexp_float(x); } 19 | 20 | template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet2f plog(const Packet2f& x) 21 | { return plog_float(x); } 22 | template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet4f plog(const Packet4f& x) 23 | { return plog_float(x); } 24 | 25 | template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet2f psin(const Packet2f& x) 26 | { return psin_float(x); } 27 | template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet4f psin(const Packet4f& x) 28 | { return psin_float(x); } 29 | 30 | template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet2f pcos(const Packet2f& x) 31 | { return pcos_float(x); } 32 | template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet4f pcos(const Packet4f& x) 33 | { return pcos_float(x); } 34 | 35 | // Hyperbolic Tangent function. 36 | template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet2f ptanh(const Packet2f& x) 37 | { return internal::generic_fast_tanh_float(x); } 38 | template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet4f ptanh(const Packet4f& x) 39 | { return internal::generic_fast_tanh_float(x); } 40 | 41 | } // end namespace internal 42 | 43 | } // end namespace Eigen 44 | 45 | #endif // EIGEN_MATH_FUNCTIONS_NEON_H 46 | -------------------------------------------------------------------------------- /tutorials/coupledProblem/passport: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- VM2D -*-----------------*---------------*\ 2 | | ## ## ## ## #### ##### | | Version 1.12 | 3 | | ## ## ### ### ## ## ## ## | VM2D: Vortex Method | 2024/01/14 | 4 | | ## ## ## # ## ## ## ## | for 2D Flow Simulation *----------------* 5 | | #### ## ## ## ## ## | Open Source Code | 6 | | ## ## ## ###### ##### | https://www.github.com/vortexmethods/VM2D | 7 | | | 8 | | Copyright (C) 2017-2024 I. Marchevsky, K. Sokol, E. Ryatina, A. Kolganova | 9 | *-----------------------------------------------------------------------------* 10 | | File name: passport | 11 | | Info: Parameters of the problem to be solved | 12 | \*---------------------------------------------------------------------------*/ 13 | 14 | //Physical Properties 15 | rho = 1.0; 16 | vInf = {1.0, 0.0}; 17 | nu = 0.004; 18 | 19 | //Time Discretization Properties 20 | //timeStart = 0.0; //by default = 0.0 21 | timeStop = 1000.0001; 22 | dt = 0.005; 23 | accelVel = RampLin(1.0); //by default = RampLin(0.0) 24 | 25 | saveVtx = binary(100); //by default = 100 26 | saveVp = binary(100); //by default = 0 27 | nameLength = 6; //by default = 5 28 | 29 | calcCoefficients = false; 30 | 31 | //Wake Discretization Properties 32 | eps = 0.0075; 33 | epscol = 0.0050; 34 | distFar = 20.0; //by default = 10.0 35 | delta = 5.e-6; //by default = 1.e-5 36 | vortexPerPanel = 1; //by default = 1 37 | maxGamma = 0.0; //by default = 0.0 38 | 39 | //Numerical Schemes 40 | linearSystemSolver = linearSystemGauss; 41 | velocityComputation = velocityBiotSavart; 42 | panelsType = panelsRectilinear; 43 | boundaryConditionSatisfaction = boundaryConstantLayerAverage; 44 | 45 | //Files and parameters 46 | airfoil = { "circle200"(basePoint = {0.0, 0.0}, chord = 1.0, addedMass = {0.785, 0.785}, mechanicalSystem=mech2) }; 47 | //fileWake = { "OblakoV1000" }; //by default={} -------------------------------------------------------------------------------- /include/unsupported/Eigen/src/NonLinearOptimization/covar.h: -------------------------------------------------------------------------------- 1 | namespace Eigen { 2 | 3 | namespace internal { 4 | 5 | template 6 | void covar( 7 | Matrix< Scalar, Dynamic, Dynamic > &r, 8 | const VectorXi &ipvt, 9 | Scalar tol = std::sqrt(NumTraits::epsilon()) ) 10 | { 11 | using std::abs; 12 | typedef DenseIndex Index; 13 | 14 | /* Local variables */ 15 | Index i, j, k, l, ii, jj; 16 | bool sing; 17 | Scalar temp; 18 | 19 | /* Function Body */ 20 | const Index n = r.cols(); 21 | const Scalar tolr = tol * abs(r(0,0)); 22 | Matrix< Scalar, Dynamic, 1 > wa(n); 23 | eigen_assert(ipvt.size()==n); 24 | 25 | /* form the inverse of r in the full upper triangle of r. */ 26 | l = -1; 27 | for (k = 0; k < n; ++k) 28 | if (abs(r(k,k)) > tolr) { 29 | r(k,k) = 1. / r(k,k); 30 | for (j = 0; j <= k-1; ++j) { 31 | temp = r(k,k) * r(j,k); 32 | r(j,k) = 0.; 33 | r.col(k).head(j+1) -= r.col(j).head(j+1) * temp; 34 | } 35 | l = k; 36 | } 37 | 38 | /* form the full upper triangle of the inverse of (r transpose)*r */ 39 | /* in the full upper triangle of r. */ 40 | for (k = 0; k <= l; ++k) { 41 | for (j = 0; j <= k-1; ++j) 42 | r.col(j).head(j+1) += r.col(k).head(j+1) * r(j,k); 43 | r.col(k).head(k+1) *= r(k,k); 44 | } 45 | 46 | /* form the full lower triangle of the covariance matrix */ 47 | /* in the strict lower triangle of r and in wa. */ 48 | for (j = 0; j < n; ++j) { 49 | jj = ipvt[j]; 50 | sing = j > l; 51 | for (i = 0; i <= j; ++i) { 52 | if (sing) 53 | r(i,j) = 0.; 54 | ii = ipvt[i]; 55 | if (ii > jj) 56 | r(ii,jj) = r(i,j); 57 | if (ii < jj) 58 | r(jj,ii) = r(i,j); 59 | } 60 | wa[jj] = r(j,j); 61 | } 62 | 63 | /* symmetrize the covariance matrix in r. */ 64 | r.topLeftCorner(n,n).template triangularView() = r.topLeftCorner(n,n).transpose(); 65 | r.diagonal() = wa; 66 | } 67 | 68 | } // end namespace internal 69 | 70 | } // end namespace Eigen 71 | -------------------------------------------------------------------------------- /include/unsupported/test/cxx11_tensor_sugar.cpp: -------------------------------------------------------------------------------- 1 | #include "main.h" 2 | 3 | #include 4 | 5 | using Eigen::Tensor; 6 | using Eigen::RowMajor; 7 | 8 | static void test_comparison_sugar() { 9 | // we already trust comparisons between tensors, we're simply checking that 10 | // the sugared versions are doing the same thing 11 | Tensor t(6, 7, 5); 12 | 13 | t.setRandom(); 14 | // make sure we have at least one value == 0 15 | t(0,0,0) = 0; 16 | 17 | Tensor b; 18 | 19 | #define TEST_TENSOR_EQUAL(e1, e2) \ 20 | b = ((e1) == (e2)).all(); \ 21 | VERIFY(b()) 22 | 23 | #define TEST_OP(op) TEST_TENSOR_EQUAL(t op 0, t op t.constant(0)) 24 | 25 | TEST_OP(==); 26 | TEST_OP(!=); 27 | TEST_OP(<=); 28 | TEST_OP(>=); 29 | TEST_OP(<); 30 | TEST_OP(>); 31 | #undef TEST_OP 32 | #undef TEST_TENSOR_EQUAL 33 | } 34 | 35 | 36 | static void test_scalar_sugar_add_mul() { 37 | Tensor A(6, 7, 5); 38 | Tensor B(6, 7, 5); 39 | A.setRandom(); 40 | B.setRandom(); 41 | 42 | const float alpha = 0.43f; 43 | const float beta = 0.21f; 44 | const float gamma = 0.14f; 45 | 46 | Tensor R = A.constant(gamma) + A * A.constant(alpha) + B * B.constant(beta); 47 | Tensor S = A * alpha + B * beta + gamma; 48 | Tensor T = gamma + alpha * A + beta * B; 49 | 50 | for (int i = 0; i < 6*7*5; ++i) { 51 | VERIFY_IS_APPROX(R(i), S(i)); 52 | VERIFY_IS_APPROX(R(i), T(i)); 53 | } 54 | } 55 | 56 | static void test_scalar_sugar_sub_div() { 57 | Tensor A(6, 7, 5); 58 | Tensor B(6, 7, 5); 59 | A.setRandom(); 60 | B.setRandom(); 61 | 62 | const float alpha = 0.43f; 63 | const float beta = 0.21f; 64 | const float gamma = 0.14f; 65 | const float delta = 0.32f; 66 | 67 | Tensor R = A.constant(gamma) - A / A.constant(alpha) 68 | - B.constant(beta) / B - A.constant(delta); 69 | Tensor S = gamma - A / alpha - beta / B - delta; 70 | 71 | for (int i = 0; i < 6*7*5; ++i) { 72 | VERIFY_IS_APPROX(R(i), S(i)); 73 | } 74 | } 75 | 76 | EIGEN_DECLARE_TEST(cxx11_tensor_sugar) 77 | { 78 | CALL_SUBTEST(test_comparison_sugar()); 79 | CALL_SUBTEST(test_scalar_sugar_add_mul()); 80 | CALL_SUBTEST(test_scalar_sugar_sub_div()); 81 | } 82 | -------------------------------------------------------------------------------- /include/Eigen/IterativeLinearSolvers: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_ITERATIVELINEARSOLVERS_MODULE_H 9 | #define EIGEN_ITERATIVELINEARSOLVERS_MODULE_H 10 | 11 | #include "SparseCore" 12 | #include "OrderingMethods" 13 | 14 | #include "src/Core/util/DisableStupidWarnings.h" 15 | 16 | /** 17 | * \defgroup IterativeLinearSolvers_Module IterativeLinearSolvers module 18 | * 19 | * This module currently provides iterative methods to solve problems of the form \c A \c x = \c b, where \c A is a squared matrix, usually very large and sparse. 20 | * Those solvers are accessible via the following classes: 21 | * - ConjugateGradient for selfadjoint (hermitian) matrices, 22 | * - LeastSquaresConjugateGradient for rectangular least-square problems, 23 | * - BiCGSTAB for general square matrices. 24 | * 25 | * These iterative solvers are associated with some preconditioners: 26 | * - IdentityPreconditioner - not really useful 27 | * - DiagonalPreconditioner - also called Jacobi preconditioner, work very well on diagonal dominant matrices. 28 | * - IncompleteLUT - incomplete LU factorization with dual thresholding 29 | * 30 | * Such problems can also be solved using the direct sparse decomposition modules: SparseCholesky, CholmodSupport, UmfPackSupport, SuperLUSupport. 31 | * 32 | \code 33 | #include 34 | \endcode 35 | */ 36 | 37 | #include "src/IterativeLinearSolvers/SolveWithGuess.h" 38 | #include "src/IterativeLinearSolvers/IterativeSolverBase.h" 39 | #include "src/IterativeLinearSolvers/BasicPreconditioners.h" 40 | #include "src/IterativeLinearSolvers/ConjugateGradient.h" 41 | #include "src/IterativeLinearSolvers/LeastSquareConjugateGradient.h" 42 | #include "src/IterativeLinearSolvers/BiCGSTAB.h" 43 | #include "src/IterativeLinearSolvers/IncompleteLUT.h" 44 | #include "src/IterativeLinearSolvers/IncompleteCholesky.h" 45 | 46 | #include "src/Core/util/ReenableStupidWarnings.h" 47 | 48 | #endif // EIGEN_ITERATIVELINEARSOLVERS_MODULE_H 49 | -------------------------------------------------------------------------------- /include/unsupported/test/cxx11_tensor_move.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2017 Viktor Csomor 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #include "main.h" 11 | 12 | #include 13 | #include 14 | 15 | using Eigen::Tensor; 16 | using Eigen::RowMajor; 17 | 18 | static void calc_indices(int i, int& x, int& y, int& z) 19 | { 20 | x = i / 4; 21 | y = (i % 4) / 2; 22 | z = i % 2; 23 | } 24 | 25 | static void test_move() 26 | { 27 | int x; 28 | int y; 29 | int z; 30 | 31 | Tensor tensor1(2, 2, 2); 32 | Tensor tensor2(2, 2, 2); 33 | 34 | for (int i = 0; i < 8; i++) 35 | { 36 | calc_indices(i, x, y, z); 37 | tensor1(x,y,z) = i; 38 | tensor2(x,y,z) = 2 * i; 39 | } 40 | 41 | // Invokes the move constructor. 42 | Tensor moved_tensor1 = std::move(tensor1); 43 | Tensor moved_tensor2 = std::move(tensor2); 44 | 45 | VERIFY_IS_EQUAL(tensor1.size(), 0); 46 | VERIFY_IS_EQUAL(tensor2.size(), 0); 47 | 48 | for (int i = 0; i < 8; i++) 49 | { 50 | calc_indices(i, x, y, z); 51 | VERIFY_IS_EQUAL(moved_tensor1(x,y,z), i); 52 | VERIFY_IS_EQUAL(moved_tensor2(x,y,z), 2 * i); 53 | } 54 | 55 | Tensor moved_tensor3(2,2,2); 56 | Tensor moved_tensor4(2,2,2); 57 | 58 | moved_tensor3.setZero(); 59 | moved_tensor4.setZero(); 60 | 61 | // Invokes the move assignment operator. 62 | moved_tensor3 = std::move(moved_tensor1); 63 | moved_tensor4 = std::move(moved_tensor2); 64 | 65 | VERIFY_IS_EQUAL(moved_tensor1.size(), 8); 66 | VERIFY_IS_EQUAL(moved_tensor2.size(), 8); 67 | 68 | for (int i = 0; i < 8; i++) 69 | { 70 | calc_indices(i, x, y, z); 71 | VERIFY_IS_EQUAL(moved_tensor1(x,y,z), 0); 72 | VERIFY_IS_EQUAL(moved_tensor2(x,y,z), 0); 73 | VERIFY_IS_EQUAL(moved_tensor3(x,y,z), i); 74 | VERIFY_IS_EQUAL(moved_tensor4(x,y,z), 2 * i); 75 | } 76 | } 77 | 78 | EIGEN_DECLARE_TEST(cxx11_tensor_move) 79 | { 80 | CALL_SUBTEST(test_move()); 81 | } 82 | -------------------------------------------------------------------------------- /include/unsupported/doc/examples/BVH_Example.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace Eigen; 6 | typedef AlignedBox Box2d; 7 | 8 | namespace Eigen { 9 | Box2d bounding_box(const Vector2d &v) { return Box2d(v, v); } //compute the bounding box of a single point 10 | } 11 | 12 | struct PointPointMinimizer //how to compute squared distances between points and rectangles 13 | { 14 | PointPointMinimizer() : calls(0) {} 15 | typedef double Scalar; 16 | 17 | double minimumOnVolumeVolume(const Box2d &r1, const Box2d &r2) { ++calls; return r1.squaredExteriorDistance(r2); } 18 | double minimumOnVolumeObject(const Box2d &r, const Vector2d &v) { ++calls; return r.squaredExteriorDistance(v); } 19 | double minimumOnObjectVolume(const Vector2d &v, const Box2d &r) { ++calls; return r.squaredExteriorDistance(v); } 20 | double minimumOnObjectObject(const Vector2d &v1, const Vector2d &v2) { ++calls; return (v1 - v2).squaredNorm(); } 21 | 22 | int calls; 23 | }; 24 | 25 | int main() 26 | { 27 | typedef std::vector > StdVectorOfVector2d; 28 | StdVectorOfVector2d redPoints, bluePoints; 29 | for(int i = 0; i < 100; ++i) { //initialize random set of red points and blue points 30 | redPoints.push_back(Vector2d::Random()); 31 | bluePoints.push_back(Vector2d::Random()); 32 | } 33 | 34 | PointPointMinimizer minimizer; 35 | double minDistSq = std::numeric_limits::max(); 36 | 37 | //brute force to find closest red-blue pair 38 | for(int i = 0; i < (int)redPoints.size(); ++i) 39 | for(int j = 0; j < (int)bluePoints.size(); ++j) 40 | minDistSq = std::min(minDistSq, minimizer.minimumOnObjectObject(redPoints[i], bluePoints[j])); 41 | std::cout << "Brute force distance = " << sqrt(minDistSq) << ", calls = " << minimizer.calls << std::endl; 42 | 43 | //using BVH to find closest red-blue pair 44 | minimizer.calls = 0; 45 | KdBVH redTree(redPoints.begin(), redPoints.end()), blueTree(bluePoints.begin(), bluePoints.end()); //construct the trees 46 | minDistSq = BVMinimize(redTree, blueTree, minimizer); //actual BVH minimization call 47 | std::cout << "BVH distance = " << sqrt(minDistSq) << ", calls = " << minimizer.calls << std::endl; 48 | 49 | return 0; 50 | } 51 | -------------------------------------------------------------------------------- /tutorials/twoCircle/passport: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- VM2D -*-----------------*---------------*\ 2 | | ## ## ## ## #### ##### | | Version 1.12 | 3 | | ## ## ### ### ## ## ## ## | VM2D: Vortex Method | 2024/01/14 | 4 | | ## ## ## # ## ## ## ## | for 2D Flow Simulation *----------------* 5 | | #### ## ## ## ## ## | Open Source Code | 6 | | ## ## ## ###### ##### | https://www.github.com/vortexmethods/VM2D | 7 | | | 8 | | Copyright (C) 2017-2024 I. Marchevsky, K. Sokol, E. Ryatina, A. Kolganova | 9 | *-----------------------------------------------------------------------------* 10 | | File name: passport | 11 | | Info: Parameters of the problem to be solved | 12 | \*---------------------------------------------------------------------------*/ 13 | 14 | //Physical Properties 15 | rho = 1.0; 16 | vInf = {1.0, 0.0}; 17 | nu = 0.005; 18 | 19 | //Time Discretization Properties 20 | //timeStart = 0.0; //by default = 0.0 21 | timeStop = 300.0001; 22 | dt = 0.005; 23 | accelVel = RampLin(1.0); //by default = RampLin(0.0) 24 | 25 | saveVtx = binary(100); //by default = 100 26 | saveVp = binary(100); //by default = 0 27 | nameLength = 5; //by default = 5 28 | 29 | calcCoefficients = true; 30 | 31 | //Wake Discretization Properties 32 | eps = 0.0075; 33 | epscol = 0.0050; 34 | distFar = 20.0; //by default = 10.0 35 | delta = 5.e-6; //by default = 1.e-5 36 | vortexPerPanel = 1; //by default = 1 37 | maxGamma = 0.0; //by default = 0.0 38 | 39 | //Numerical Schemes 40 | 41 | //Numerical Schemes 42 | linearSystemSolver = linearSystemGauss; 43 | velocityComputation = velocityBiotSavart; 44 | panelsType = panelsRectilinear; 45 | boundaryConditionSatisfaction = boundaryConstantLayerAverage; 46 | 47 | //Files and parameters 48 | airfoil = { "circle200"(basePoint = {0.0, 0.0}, chord = 1.0, mechanicalSystem=mech0), 49 | "circle200"(basePoint = {-2.0, -1.0}, chord = 1.0, mechanicalSystem=mech0) }; 50 | //fileWake = { "OblakoV1000" }; //by default={} -------------------------------------------------------------------------------- /tutorials/tube/passport: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- VM2D -*-----------------*---------------*\ 2 | | ## ## ## ## #### ##### | | Version 1.12 | 3 | | ## ## ### ### ## ## ## ## | VM2D: Vortex Method | 2024/01/14 | 4 | | ## ## ## # ## ## ## ## | for 2D Flow Simulation *----------------* 5 | | #### ## ## ## ## ## | Open Source Code | 6 | | ## ## ## ###### ##### | https://www.github.com/vortexmethods/VM2D | 7 | | | 8 | | Copyright (C) 2017-2024 I. Marchevsky, K. Sokol, E. Ryatina, A. Kolganova | 9 | *-----------------------------------------------------------------------------* 10 | | File name: passport | 11 | | Info: Parameters of the problem to be solved | 12 | \*---------------------------------------------------------------------------*/ 13 | 14 | //Physical Properties 15 | rho = 1.0; 16 | vInf = {0.0, 0.0}; 17 | vRef = 1.0; 18 | nu = 0.003333333; 19 | 20 | //Time Discretization Properties 21 | //timeStart = 0.0; //by default = 0.0 22 | timeStop = 250.0001; 23 | dt = 0.004; 24 | accelVel = RampLin(1.0); //by default = RampLin(0.0) 25 | 26 | saveVtx = 10; //by default = 100 27 | saveVp = 100; //by default = 0 28 | nameLength = 5; //by default = 5 29 | 30 | //Wake Discretization Properties 31 | eps = 0.0075; 32 | epscol = 0.0050; 33 | distFar = 20.0; //by default = 10.0 34 | delta = 5.e-6; //by default = 1.e-5 35 | vortexPerPanel = 1; //by default = 1 36 | maxGamma = 0.0; //by default = 0.0 37 | 38 | //Numerical Schemes 39 | linearSystemSolver = linearSystemGauss; 40 | velocityComputation = velocityBiotSavart; 41 | panelsType = panelsRectilinear; 42 | boundaryConditionSatisfaction = boundaryConstantLayerAverage; 43 | 44 | //Files and parameters 45 | airfoil = { 46 | "tube1384"(basePoint = {0.0, 0.0}, inverse = true, mechanicalSystem=mech0), 47 | "circle200"(basePoint = {0.0, 0.0}, mechanicalSystem=mech0) }; 48 | //fileWake = { "OblakoV1000" }; //by default={} 49 | fileSource = { "sources" }; //by default={} -------------------------------------------------------------------------------- /tutorials/cylPlate/passport: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- VM2D -*-----------------*---------------*\ 2 | | ## ## ## ## #### ##### | | Version 1.12 | 3 | | ## ## ### ### ## ## ## ## | VM2D: Vortex Method | 2024/01/14 | 4 | | ## ## ## # ## ## ## ## | for 2D Flow Simulation *----------------* 5 | | #### ## ## ## ## ## | Open Source Code | 6 | | ## ## ## ###### ##### | https://www.github.com/vortexmethods/VM2D | 7 | | | 8 | | Copyright (C) 2017-2024 I. Marchevsky, K. Sokol, E. Ryatina, A. Kolganova | 9 | *-----------------------------------------------------------------------------* 10 | | File name: passport | 11 | | Info: Parameters of the problem to be solved | 12 | \*---------------------------------------------------------------------------*/ 13 | 14 | //Physical Properties 15 | rho = 1.0; 16 | vInf = {1.0, 0.0}; 17 | nu = 0.005; 18 | 19 | //Time Discretization Properties 20 | //timeStart = 0.0; //by default = 0.0 21 | timeStop = 100.0001; 22 | dt = 0.01; 23 | accelVel = RampLin(1.0); //by default = RampLin(0.0) 24 | 25 | saveVtx = binary(50); //by default = 100 26 | saveVp = binary(50); //by default = 0 27 | nameLength = 5; //by default = 5 28 | 29 | //Wake Discretization Properties 30 | eps = 0.03; 31 | epscol = 0.02; 32 | distFar = 20.0; //by default = 10.0 33 | delta = 5.e-6; //by default = 1.e-5 34 | vortexPerPanel = 1; //by default = 1 35 | maxGamma = 4e-3; //by default = 0.0 36 | 37 | //Numerical Schemes 38 | linearSystemSolver = linearSystemGauss; //linearSystemGauss is only available now 39 | velocityComputation = velocityBiotSavart; //velocityBiotSavart is only available now 40 | panelsType = panelsRectilinear; 41 | boundaryConditionSatisfaction = boundaryConstantLayerAverage; 42 | 43 | //Files and parameters 44 | airfoil = { "circle100"(basePoint = {0.0, 0.0}, mechanicalSystem=mech0), 45 | "rect01Frolov36"(basePoint = {-1.1, 0.2}, 46 | angle = -60, mechanicalSystem=mech0) }; 47 | //fileWake = { "OblakoV1000" }; //by default={} -------------------------------------------------------------------------------- /include/unsupported/test/cxx11_tensor_comparisons.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2014 Benoit Steiner 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #include "main.h" 11 | 12 | #include 13 | 14 | using Eigen::Tensor; 15 | using Eigen::RowMajor; 16 | 17 | static void test_orderings() 18 | { 19 | Tensor mat1(2,3,7); 20 | Tensor mat2(2,3,7); 21 | Tensor lt(2,3,7); 22 | Tensor le(2,3,7); 23 | Tensor gt(2,3,7); 24 | Tensor ge(2,3,7); 25 | 26 | mat1.setRandom(); 27 | mat2.setRandom(); 28 | 29 | lt = mat1 < mat2; 30 | le = mat1 <= mat2; 31 | gt = mat1 > mat2; 32 | ge = mat1 >= mat2; 33 | 34 | for (int i = 0; i < 2; ++i) { 35 | for (int j = 0; j < 3; ++j) { 36 | for (int k = 0; k < 7; ++k) { 37 | VERIFY_IS_EQUAL(lt(i,j,k), mat1(i,j,k) < mat2(i,j,k)); 38 | VERIFY_IS_EQUAL(le(i,j,k), mat1(i,j,k) <= mat2(i,j,k)); 39 | VERIFY_IS_EQUAL(gt(i,j,k), mat1(i,j,k) > mat2(i,j,k)); 40 | VERIFY_IS_EQUAL(ge(i,j,k), mat1(i,j,k) >= mat2(i,j,k)); 41 | } 42 | } 43 | } 44 | } 45 | 46 | 47 | static void test_equality() 48 | { 49 | Tensor mat1(2,3,7); 50 | Tensor mat2(2,3,7); 51 | 52 | mat1.setRandom(); 53 | mat2.setRandom(); 54 | for (int i = 0; i < 2; ++i) { 55 | for (int j = 0; j < 3; ++j) { 56 | for (int k = 0; k < 7; ++k) { 57 | if (internal::random()) { 58 | mat2(i,j,k) = mat1(i,j,k); 59 | } 60 | } 61 | } 62 | } 63 | 64 | Tensor eq(2,3,7); 65 | Tensor ne(2,3,7); 66 | eq = (mat1 == mat2); 67 | ne = (mat1 != mat2); 68 | 69 | for (int i = 0; i < 2; ++i) { 70 | for (int j = 0; j < 3; ++j) { 71 | for (int k = 0; k < 7; ++k) { 72 | VERIFY_IS_EQUAL(eq(i,j,k), mat1(i,j,k) == mat2(i,j,k)); 73 | VERIFY_IS_EQUAL(ne(i,j,k), mat1(i,j,k) != mat2(i,j,k)); 74 | } 75 | } 76 | } 77 | } 78 | 79 | 80 | EIGEN_DECLARE_TEST(cxx11_tensor_comparisons) 81 | { 82 | CALL_SUBTEST(test_orderings()); 83 | CALL_SUBTEST(test_equality()); 84 | } 85 | -------------------------------------------------------------------------------- /src/VMcuda/operations/types.cuh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef TYPES_CUH_ 4 | #define TYPES_CUH_ 5 | 6 | #define CALCinDOUBLE 7 | 8 | #include "Point2D.h" 9 | #include "Vortex2D.h" 10 | 11 | namespace BHcu 12 | { 13 | typedef double real; 14 | #define real2 double2 15 | #define real3 double3 16 | #define make_real2(x,y) make_double2(x,y) 17 | #define realmax max 18 | #define realmin min 19 | #define realPoint Point2D 20 | #define realVortex Vortex2D 21 | #define floatPoint Point2Df 22 | #define intPair long long 23 | 24 | 25 | //////////////////////////////////////////////////////////////////////////////////////// 26 | struct CUDApointersPoints 27 | { 28 | realPoint* maxrl, * minrl; //габаритный прямоугольник 29 | 30 | int* MmortonCodesKeyUnsortl; 31 | int* MmortonCodesKeyl; 32 | 33 | int* MmortonCodesIdxUnsortl; //0 1 2 3 ... nbodies-1 34 | int* MmortonCodesIdxl; 35 | }; 36 | 37 | struct CUDApointers 38 | { 39 | /// ПРОКОММЕНТИРОВАННАЯ ЧАСТЬ 40 | //без буквы "l" на конце - на host, 41 | //c буквой "l" на конце - на device 42 | 43 | int* massl; //массы (единица для точечного вихря, число вихрей для ячейки) 44 | 45 | realPoint* maxrl, * minrl; //габаритный прямоугольник 46 | realPoint* momsl; //мультипольные моменты всех ячеек; хранятся в виде , <для второй ячейки> ... 47 | realPoint* El; //к-ты локальных разложений 48 | 49 | //For Morton tree 50 | int* MmortonCodesKeyUnsortl; 51 | int* MmortonCodesKeyl; 52 | 53 | int* MmortonCodesIdxUnsortl; //0 1 2 3 ... nbodies-1 54 | int* MmortonCodesIdxl; 55 | 56 | int* MlevelUnsortl; 57 | int* MlevelSortl; 58 | 59 | int* MindexUnsortl; //0 1 2 3 ... nbodies-2 60 | int* MindexSortl; 61 | int* MindexSortTl; 62 | 63 | realPoint* Mposl; //Положения внутренних узлов в дерева Карраса 64 | realPoint* Mlowerl; //Левый нижний угол ячейки 65 | realPoint* Mupperl; //Правый верхний угол ячейки 66 | 67 | int* Mparentl; //Номер ячейки-родителя 68 | intPair* Mchildl; //Потомки внутренних ячеек 69 | intPair* Mrangel; //Диапазон частиц во внутренней ячейке 70 | }; 71 | } 72 | 73 | 74 | #endif -------------------------------------------------------------------------------- /include/unsupported/test/matrix_functions.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009-2011 Jitse Niesen 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #include "main.h" 11 | #include 12 | 13 | // For complex matrices, any matrix is fine. 14 | template::Scalar>::IsComplex> 15 | struct processTriangularMatrix 16 | { 17 | static void run(MatrixType&, MatrixType&, const MatrixType&) 18 | { } 19 | }; 20 | 21 | // For real matrices, make sure none of the eigenvalues are negative. 22 | template 23 | struct processTriangularMatrix 24 | { 25 | static void run(MatrixType& m, MatrixType& T, const MatrixType& U) 26 | { 27 | const Index size = m.cols(); 28 | 29 | for (Index i=0; i < size; ++i) { 30 | if (i == size - 1 || T.coeff(i+1,i) == 0) 31 | T.coeffRef(i,i) = std::abs(T.coeff(i,i)); 32 | else 33 | ++i; 34 | } 35 | m = U * T * U.transpose(); 36 | } 37 | }; 38 | 39 | template ::Scalar>::IsComplex> 40 | struct generateTestMatrix; 41 | 42 | template 43 | struct generateTestMatrix 44 | { 45 | static void run(MatrixType& result, typename MatrixType::Index size) 46 | { 47 | result = MatrixType::Random(size, size); 48 | RealSchur schur(result); 49 | MatrixType T = schur.matrixT(); 50 | processTriangularMatrix::run(result, T, schur.matrixU()); 51 | } 52 | }; 53 | 54 | template 55 | struct generateTestMatrix 56 | { 57 | static void run(MatrixType& result, typename MatrixType::Index size) 58 | { 59 | result = MatrixType::Random(size, size); 60 | } 61 | }; 62 | 63 | template 64 | typename Derived::RealScalar relerr(const MatrixBase& A, const MatrixBase& B) 65 | { 66 | return std::sqrt((A - B).cwiseAbs2().sum() / (std::min)(A.cwiseAbs2().sum(), B.cwiseAbs2().sum())); 67 | } 68 | -------------------------------------------------------------------------------- /include/Eigen/src/SparseLU/SparseLU_Utils.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2012 Désiré Nuentsa-Wakam 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | 11 | #ifndef EIGEN_SPARSELU_UTILS_H 12 | #define EIGEN_SPARSELU_UTILS_H 13 | 14 | namespace Eigen { 15 | namespace internal { 16 | 17 | /** 18 | * \brief Count Nonzero elements in the factors 19 | */ 20 | template 21 | void SparseLUImpl::countnz(const Index n, Index& nnzL, Index& nnzU, GlobalLU_t& glu) 22 | { 23 | nnzL = 0; 24 | nnzU = (glu.xusub)(n); 25 | Index nsuper = (glu.supno)(n); 26 | Index jlen; 27 | Index i, j, fsupc; 28 | if (n <= 0 ) return; 29 | // For each supernode 30 | for (i = 0; i <= nsuper; i++) 31 | { 32 | fsupc = glu.xsup(i); 33 | jlen = glu.xlsub(fsupc+1) - glu.xlsub(fsupc); 34 | 35 | for (j = fsupc; j < glu.xsup(i+1); j++) 36 | { 37 | nnzL += jlen; 38 | nnzU += j - fsupc + 1; 39 | jlen--; 40 | } 41 | } 42 | } 43 | 44 | /** 45 | * \brief Fix up the data storage lsub for L-subscripts. 46 | * 47 | * It removes the subscripts sets for structural pruning, 48 | * and applies permutation to the remaining subscripts 49 | * 50 | */ 51 | template 52 | void SparseLUImpl::fixupL(const Index n, const IndexVector& perm_r, GlobalLU_t& glu) 53 | { 54 | Index fsupc, i, j, k, jstart; 55 | 56 | StorageIndex nextl = 0; 57 | Index nsuper = (glu.supno)(n); 58 | 59 | // For each supernode 60 | for (i = 0; i <= nsuper; i++) 61 | { 62 | fsupc = glu.xsup(i); 63 | jstart = glu.xlsub(fsupc); 64 | glu.xlsub(fsupc) = nextl; 65 | for (j = jstart; j < glu.xlsub(fsupc + 1); j++) 66 | { 67 | glu.lsub(nextl) = perm_r(glu.lsub(j)); // Now indexed into P*A 68 | nextl++; 69 | } 70 | for (k = fsupc+1; k < glu.xsup(i+1); k++) 71 | glu.xlsub(k) = nextl; // other columns in supernode i 72 | } 73 | 74 | glu.xlsub(n) = nextl; 75 | } 76 | 77 | } // end namespace internal 78 | 79 | } // end namespace Eigen 80 | #endif // EIGEN_SPARSELU_UTILS_H 81 | -------------------------------------------------------------------------------- /include/unsupported/Eigen/CXX11/src/ThreadPool/Barrier.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2018 Rasmus Munk Larsen 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | // Barrier is an object that allows one or more threads to wait until 11 | // Notify has been called a specified number of times. 12 | 13 | #ifndef EIGEN_CXX11_THREADPOOL_BARRIER_H 14 | #define EIGEN_CXX11_THREADPOOL_BARRIER_H 15 | 16 | namespace Eigen { 17 | 18 | class Barrier { 19 | public: 20 | Barrier(unsigned int count) : state_(count << 1), notified_(false) { 21 | eigen_plain_assert(((count << 1) >> 1) == count); 22 | } 23 | ~Barrier() { eigen_plain_assert((state_ >> 1) == 0); } 24 | 25 | void Notify() { 26 | unsigned int v = state_.fetch_sub(2, std::memory_order_acq_rel) - 2; 27 | if (v != 1) { 28 | // Clear the lowest bit (waiter flag) and check that the original state 29 | // value was not zero. If it was zero, it means that notify was called 30 | // more times than the original count. 31 | eigen_plain_assert(((v + 2) & ~1) != 0); 32 | return; // either count has not dropped to 0, or waiter is not waiting 33 | } 34 | std::unique_lock l(mu_); 35 | eigen_plain_assert(!notified_); 36 | notified_ = true; 37 | cv_.notify_all(); 38 | } 39 | 40 | void Wait() { 41 | unsigned int v = state_.fetch_or(1, std::memory_order_acq_rel); 42 | if ((v >> 1) == 0) return; 43 | std::unique_lock l(mu_); 44 | while (!notified_) { 45 | cv_.wait(l); 46 | } 47 | } 48 | 49 | private: 50 | std::mutex mu_; 51 | std::condition_variable cv_; 52 | std::atomic state_; // low bit is waiter flag 53 | bool notified_; 54 | }; 55 | 56 | // Notification is an object that allows a user to to wait for another 57 | // thread to signal a notification that an event has occurred. 58 | // 59 | // Multiple threads can wait on the same Notification object, 60 | // but only one caller must call Notify() on the object. 61 | struct Notification : Barrier { 62 | Notification() : Barrier(1){}; 63 | }; 64 | 65 | } // namespace Eigen 66 | 67 | #endif // EIGEN_CXX11_THREADPOOL_BARRIER_H 68 | --------------------------------------------------------------------------------