Welcome! Log In Create A New Profile


Wrong return type of symmetricTensorProduct

Posted by swang251swang251  
Wrong return type of symmetricTensorProduct
April 06, 2018 06:29PM
Hi everyone,

I met a problem with the data processor wrapper symmetricTensorProduct, which calculates the tensor product of a vector with itself (u_iu_j).

There seem to be some problems with the function and here are my revisions.

First, for the 3D vector, the function should return a 3*3 matrix, so the return type of the function should be
Language: C++
auto_ptr<MultiTensorField3D<T, SymmetricTensorImpl<T,nDim>::n>>
instead of
Language: C++
std::auto_ptr<MultiTensorField3D<T,nDim> >

We might need to modify both the declaration and the definitions for different overloads:
    [*] line 2123 and line 2126 in File src/dataProcessors/dataAnalysisWrapper3D.h
    [*] line 4854 and line 4863 in File src/dataProcessors/dataAnalysisWrapper3D.hh

In addition, around the line 4857-4858 of the file src/dataProcessors/dataAnalysisWrapper3D.hh, for the function
Language: C++
std::auto_ptr< MultiTensorField3D<T,SymmetricTensorImpl<T,nDim>::n> > symmetricTensorProduct( MultiTensorField3D<T,nDim>& A, Box3D domain) { std::auto_ptr<MultiTensorField3D<T,SymmetricTensorImpl<T,nDim>::n> > result = generateMultiTensorField<T,SymmetricTensorImpl<T,nDim>::n>(A,domain); symmetricTensorProduct(A, *result, domain); return result; }
the template parameter for the function generateMultiTensorField should be <T, SymmetricTensorImpl<T,nDim>::n>> instead of <T,nDim>

Hope this could help in case anyone met the same problem.

With best,
Re: Wrong return type of symmetricTensorProduct
April 16, 2018 11:35AM
Dear Song,

Thank you very much for this bug fix. It will be included in the next Palabos release.

Best Regards,
Sorry, you do not have permission to post/reply in this forum.