请教:第三代涡识别方法Liutex的代码在linux中运行的问题
-
@五好青年 http://www.jhydrodynamics.com/en/download-of-liutex-code/
是这个代码么?我对liutex的计算方法不熟悉。但肯定是代码里面什么地方某个算法卡住了。
-
这种期刊的代码可以直接找通讯作者交流类似的技术问题。
-
https://www.cfd-china.com/topic/3499 在这里面有一个
获取某个函数的计算时间
,你可以放在代码里面看看哪里的计算时间比较长,卡在哪里了。
-
-
@李东岳
目前我将cavity算例改成三维,三个方向网格相同,试算了后进行Liutex后处理。记录如下:
30^3网格 单核,Liutex处理时间:4s
35^3网格 单核,Liutex处理时间:14s
40^3网格 单核,Liutex处理时间:60s
45^3网格 单核,单核,Liutex处理时间:131s
50^3网格 Liutex处理时间:327s
55^3网格 单核,浮点溢出
58^3网格 单核,浮点溢出
60^3网格 单核,浮点溢出
70^3网格 单核,浮点溢出
80^3网格 4核并行后处理,报错300万网格以前的算例,扩大机器内存,单核处理3天了,还没出结果
-
#include <chrono> auto start = std::chrono::steady_clock::now(); // Functions here auto end = std::chrono::steady_clock::now(); auto diff = end - start; Info<< "Calculation using " << std::chrono::duration <double, std::milli> (diff).count() << " ms" << endl;
你可以用上段代码测试哪个函数运行时间比较长
-
@yhdthu
您好
我尝试往OF官网版本上移植,提示了一些报错,主要有:error: ‘complex’ was not declared in this scope
经过很久的折腾,发现您可能参考tensor.C文件来修改的,并且我对比了OpenFOAM低版本的tensor.C来逐个修改报错,但是始终没能解决。
可否帮忙帮忙编一个低版本的,或者给一些修改的思路
感谢dyfluid@dyfluid:~/postVersion$ wclean dyfluid@dyfluid:~/postVersion$ wmake Making dependency list for source file Liutex.C SOURCE=Liutex.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/home/dyfluid/OpenFOAM/OpenFOAM-2.4.x/src/finiteVolume/lnInclude -I/home/dyfluid/OpenFOAM/OpenFOAM-2.4.x/src/meshTools/lnInclude -IlnInclude -I. -I/home/dyfluid/OpenFOAM/OpenFOAM-2.4.x/src/OpenFOAM/lnInclude -I/home/dyfluid/OpenFOAM/OpenFOAM-2.4.x/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/Liutex.o Liutex.C: In function ‘Foam::vector getZdEVec(const tensor&)’: Liutex.C:44:18: error: ‘complex’ was not declared in this scope const Vector<complex> EVals(eigenValues(T)); ^ Liutex.C:44:25: error: template argument 1 is invalid const Vector<complex> EVals(eigenValues(T)); ^ Liutex.C:44:47: error: cannot convert ‘Foam::vector {aka Foam::Vector<double>}’ to ‘const int’ in initialization const Vector<complex> EVals(eigenValues(T)); ^ Liutex.C:46:25: error: type/value mismatch at argument 1 in template parameter list for ‘template<class Cmpt> class Foam::Vector’ const Vector<complex> standardBasis1(Zero, pTraits<complex>::one, Zero); ^ Liutex.C:46:25: note: expected a type, got ‘complex’ Liutex.C:46:42: error: ‘Zero’ was not declared in this scope const Vector<complex> standardBasis1(Zero, pTraits<complex>::one, Zero); ^ Liutex.C:46:63: error: type/value mismatch at argument 1 in template parameter list for ‘template<class PrimitiveType> class Foam::pTraits’ const Vector<complex> standardBasis1(Zero, pTraits<complex>::one, Zero); ^ Liutex.C:46:63: note: expected a type, got ‘complex’ Liutex.C:46:75: error: expression list treated as compound expression in initializer [-fpermissive] const Vector<complex> standardBasis1(Zero, pTraits<complex>::one, Zero); ^ Liutex.C:47:25: error: type/value mismatch at argument 1 in template parameter list for ‘template<class Cmpt> class Foam::Vector’ const Vector<complex> standardBasis2(Zero, Zero, pTraits<complex>::one); ^ Liutex.C:47:25: note: expected a type, got ‘complex’ Liutex.C:47:69: error: type/value mismatch at argument 1 in template parameter list for ‘template<class PrimitiveType> class Foam::pTraits’ const Vector<complex> standardBasis2(Zero, Zero, pTraits<complex>::one); ^ Liutex.C:47:69: note: expected a type, got ‘complex’ Liutex.C:47:75: error: expression list treated as compound expression in initializer [-fpermissive] const Vector<complex> standardBasis2(Zero, Zero, pTraits<complex>::one); ^ Liutex.C:48:25: error: type/value mismatch at argument 1 in template parameter list for ‘template<class Cmpt> class Foam::Vector’ const Vector<complex> EVec ^ Liutex.C:48:25: note: expected a type, got ‘complex’ Liutex.C:50:30: error: request for member ‘x’ in ‘EVals’, which is of non-class type ‘const int’ eigenVector(T, EVals.x(), standardBasis1, standardBasis2) ^ Liutex.C:53:23: error: request for member ‘x’ in ‘EVec’, which is of non-class type ‘const int’ vector EVecR(EVec.x().real(), EVec.y().real(), EVec.z().real()); ^ Liutex.C:53:40: error: request for member ‘y’ in ‘EVec’, which is of non-class type ‘const int’ vector EVecR(EVec.x().real(), EVec.y().real(), EVec.z().real()); ^ Liutex.C:53:57: error: request for member ‘z’ in ‘EVec’, which is of non-class type ‘const int’ vector EVecR(EVec.x().real(), EVec.y().real(), EVec.z().real()); ^ Liutex.C: In function ‘Foam::tensor rotation(const vector&)’: Liutex.C:62:14: error: ‘Zero’ was not declared in this scope tensor q(Zero); ^ Liutex.C: In function ‘Foam::vector liutex(const tensor&, const vector&)’: Liutex.C:100:19: error: ‘Zero’ was not declared in this scope vector liutex(Zero); ^ Liutex.C: In function ‘int main(int, char**)’: Liutex.C:156:48: error: ‘Zero’ was not declared in this scope dimensionedVector("zero", dimless, Zero) ^ Liutex.C:158:39: error: ‘Foam::volVectorField {aka class Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>}’ has no member named ‘primitiveFieldRef’ vectorField& iLiutex = Liutex.primitiveFieldRef(); ^ Liutex.C:174:43: error: ‘Foam::volTensorField {aka class Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh>}’ has no member named ‘primitiveField’ const tensorField& iGradU = gradU.primitiveField(); ^ Liutex.dep:674: recipe for target 'Make/linux64GccDPOpt/Liutex.o' failed make: *** [Make/linux64GccDPOpt/Liutex.o] Error 1 dyfluid@dyfluid:~/postVersion$