|
[Sponsors] |
February 20, 2021, 00:55 |
eigenValues of volTensorField
|
#1 |
Senior Member
Join Date: Jun 2016
Posts: 102
Rep Power: 10 |
Hello all,
I'm trying to calculate the eigenvalues & eigenvectors of a volTensorField (not a volSymmTensorField) in OF v2012 but got the following error when compiling: Code:
error: no matching function for call to 'eigenValues' volVectorField eig(eigenValues(C)); ^~~~~~~~~~~ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/tensor.H:68:17: note: candidate function not viable: no known conversion from 'Foam::volTensorField' (aka 'GeometricField<Tensor<double>, fvPatchField, Foam::volMesh>') to 'const Foam::tensor' (aka 'const Tensor<double>') for 1st argument Vector<complex> eigenValues(const tensor& T); ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/symmTensor.H:69:8: note: candidate function not viable: no known conversion from 'Foam::volTensorField' (aka 'GeometricField<Tensor<double>, fvPatchField, Foam::volMesh>') to 'const Foam::symmTensor' (aka 'const SymmTensor<double>') for 1st argument vector eigenValues(const symmTensor& T); ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/dimensionedTensor.H:67:19: note: candidate function not viable: no known conversion from 'Foam::volTensorField' (aka 'GeometricField<Tensor<double>, fvPatchField, Foam::volMesh>') to 'const Foam::dimensionedSymmTensor' (aka 'const dimensioned<SymmTensor<double> >') for 1st argument dimensionedVector eigenValues(const dimensionedSymmTensor&); ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/tensorField.H:194:36: note: candidate function not viable: no known conversion from 'Foam::volTensorField' (aka 'GeometricField<Tensor<double>, fvPatchField, Foam::volMesh>') to 'const UList<Foam::symmTensor>' (aka 'const UList<SymmTensor<double> >') for 1st argument UNARY_FUNCTION(vector, symmTensor, eigenValues) ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/FieldFunctionsM.H:40:24: note: expanded from macro 'UNARY_FUNCTION' tmp<Field<ReturnType>> Func(const UList<Type1>& f); \ ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/tensorField.H:194:36: note: candidate function not viable: no known conversion from 'Foam::volTensorField' (aka 'GeometricField<Tensor<double>, fvPatchField, Foam::volMesh>') to 'const tmp<Field<Foam::symmTensor> >' (aka 'const tmp<Field<SymmTensor<double> > >') for 1st argument /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/FieldFunctionsM.H:42:24: note: expanded from macro 'UNARY_FUNCTION' tmp<Field<ReturnType>> Func(const tmp<Field<Type1>>& tf); ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/DimensionedTensorField.C:53:36: note: candidate template ignored: could not match 'DimensionedField' against 'GeometricField' UNARY_FUNCTION(vector, symmTensor, eigenValues, transform) ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/DimensionedTensorField.C:53:36: note: candidate template ignored: could not match 'tmp' against 'GeometricField' /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/tensorFieldField.C:221:36: note: candidate template ignored: could not match 'FieldField' against 'GeometricField' UNARY_FUNCTION(vector, symmTensor, eigenValues) ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/tensorFieldField.C:221:36: note: candidate template ignored: could not match 'tmp' against 'GeometricField' /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/GeometricTensorField.C:271:36: note: candidate template ignored: could not match 'Foam::SymmTensor<double>' against 'Foam::Tensor<double>' UNARY_FUNCTION(vector, symmTensor, eigenValues, transform) ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/GeometricTensorField.C:271:36: note: candidate template ignored: could not match 'tmp' against 'GeometricField' /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/tensorFieldField.C:221:36: note: candidate function template not viable: requires 2 arguments, but 1 was provided UNARY_FUNCTION(vector, symmTensor, eigenValues) ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/GeometricTensorField.C:271:36: note: candidate function template not viable: requires 2 arguments, but 1 was provided UNARY_FUNCTION(vector, symmTensor, eigenValues, transform) ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/tensorField.H:194:36: note: candidate function not viable: requires 2 arguments, but 1 was provided UNARY_FUNCTION(vector, symmTensor, eigenValues) ^ Anyone could help me with this? Thanks. |
|
February 20, 2021, 11:56 |
|
#2 |
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13 |
OpenFOAM v2012 returns eigendecomposition output as a `complex` base type rather than `scalar` type for a given tensor field: like NumPy or Matlab does, because the eigendecomposition of a tensor is guaranteed to be in `complex` space.
With the previous versions (pre v1912), and with the openfoam.org, you can still get `scalar` eigendecomposition output from a given tensor - IMHO, doesn't make sense if one does serious work on eigendecompositions. If you are certain about that you will have `scalar` eigendecomposition output, it is certain that your tensor is actually a symmetric one - so please consider to change the input operand type from a tensor to a symmetric tensor with which you can certainly get `scalar` eigendecomposition output.
__________________
The OpenFOAM community is the biggest contributor to OpenFOAM: User guide/Wiki-1/Wiki-2/Code guide/Code Wiki/Journal Nilsson/Guerrero/Holzinger/Holzmann/Nagy/Santos/Nozaki/Jasak/Primer Governance Bugs/Features: OpenFOAM (ESI-OpenCFD-Trademark) Bugs/Features: FOAM-Extend (Wikki-FSB) Bugs: OpenFOAM.org How to create a MWE New: Forkable OpenFOAM mirror |
|
February 20, 2021, 12:26 |
|
#3 | |
Senior Member
Join Date: Jun 2016
Posts: 102
Rep Power: 10 |
Quote:
Now I'm having another issue. Code:
volSymmTensorField C(tau_*lambda_/etaP_+symmTensor::one); volVectorField eig(eigenValues(C)); volTensorField R(eigenVectors(C,eig)); Code:
error: no matching function for call to 'eigenVectors' volTensorField R(eigenVectors(C,eig)); ^~~~~~~~~~~~ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/tensor.H:94:17: note: candidate function not viable: no known conversion from 'Foam::volSymmTensorField' (aka 'GeometricField<SymmTensor<double>, fvPatchField, Foam::volMesh>') to 'const Foam::tensor' (aka 'const Tensor<double>') for 1st argument Tensor<complex> eigenVectors ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/symmTensor.H:95:8: note: candidate function not viable: no known conversion from 'Foam::volSymmTensorField' (aka 'GeometricField<SymmTensor<double>, fvPatchField, Foam::volMesh>') to 'const Foam::symmTensor' (aka 'const SymmTensor<double>') for 1st argument tensor eigenVectors ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/tensorField.H:195:36: note: candidate function not viable: no known conversion from 'Foam::volSymmTensorField' (aka 'GeometricField<SymmTensor<double>, fvPatchField, Foam::volMesh>') to 'Field<Foam::tensor> &' (aka 'Field<Tensor<double> > &') for 1st argument UNARY_FUNCTION(tensor, symmTensor, eigenVectors) ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/FieldFunctionsM.H:38:6: note: expanded from macro 'UNARY_FUNCTION' void Func(Field<ReturnType>& res, const UList<Type1>& f); \ ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/tensorFieldField.C:222:40: note: candidate template ignored: could not match 'FieldField' against 'GeometricField' UNARY_FUNCTION(symmTensor, symmTensor, eigenVectors) ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/GeometricTensorField.C:272:40: note: candidate template ignored: could not match 'Foam::SymmTensor<double>' against 'Foam::Vector<double>' UNARY_FUNCTION(symmTensor, symmTensor, eigenVectors, sign) ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/DimensionedTensorField.C:54:40: note: candidate function template not viable: requires single argument 'df1', but 2 arguments were provided UNARY_FUNCTION(symmTensor, symmTensor, eigenVectors, sign) ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/DimensionedTensorField.C:54:40: note: candidate function template not viable: requires single argument 'tdf1', but 2 arguments were provided /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/tensorFieldField.C:222:40: note: candidate function template not viable: requires single argument 'f', but 2 arguments were provided UNARY_FUNCTION(symmTensor, symmTensor, eigenVectors) ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/tensorFieldField.C:222:40: note: candidate function template not viable: requires single argument 'tf', but 2 arguments were provided /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/GeometricTensorField.C:272:40: note: candidate function template not viable: requires single argument 'gf1', but 2 arguments were provided UNARY_FUNCTION(symmTensor, symmTensor, eigenVectors, sign) ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/GeometricTensorField.C:272:40: note: candidate function template not viable: requires single argument 'tgf1', but 2 arguments were provided /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/tensor.H:106:17: note: candidate function not viable: requires single argument 'T', but 2 arguments were provided Tensor<complex> eigenVectors(const tensor& T); ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/symmTensor.H:107:8: note: candidate function not viable: requires single argument 'T', but 2 arguments were provided tensor eigenVectors(const symmTensor& T); ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/dimensionedTensor.H:68:19: note: candidate function not viable: requires 1 argument, but 2 were provided dimensionedTensor eigenVectors(const dimensionedSymmTensor&); ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/tensorField.H:195:36: note: candidate function not viable: requires single argument 'f', but 2 arguments were provided UNARY_FUNCTION(tensor, symmTensor, eigenVectors) ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/tensorField.H:195:36: note: candidate function not viable: requires single argument 'tf', but 2 arguments were provided |
||
February 20, 2021, 13:41 |
|
#4 |
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13 |
May be `volTensorField R(eigenVectors(C));` with a single argument?
irrelevant bonus: EigenMatrix class and `Test-EigenMatrix.C`.
__________________
The OpenFOAM community is the biggest contributor to OpenFOAM: User guide/Wiki-1/Wiki-2/Code guide/Code Wiki/Journal Nilsson/Guerrero/Holzinger/Holzmann/Nagy/Santos/Nozaki/Jasak/Primer Governance Bugs/Features: OpenFOAM (ESI-OpenCFD-Trademark) Bugs/Features: FOAM-Extend (Wikki-FSB) Bugs: OpenFOAM.org How to create a MWE New: Forkable OpenFOAM mirror |
|
February 20, 2021, 13:49 |
|
#5 | |
Senior Member
Join Date: Jun 2016
Posts: 102
Rep Power: 10 |
Quote:
Code:
error: no matching constructor for initialization of 'Foam::volTensorField' (aka 'GeometricField<Tensor<double>, fvPatchField, Foam::volMesh>') volTensorField R(eigenVectors(C)); ^ ~~~~~~~~~~~~~~~ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/GeometricField.H:402:9: note: candidate constructor not viable: no known conversion from 'tmp<GeometricField<Foam::symmTensor, fvPatchField, Foam::volMesh> >' (aka 'tmp<GeometricField<SymmTensor<double>, fvPatchField, Foam::volMesh> >') to 'const GeometricField<Foam::Tensor<double>, fvPatchField, Foam::volMesh>' for 1st argument GeometricField ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/GeometricField.H:408:9: note: candidate constructor not viable: no known conversion from 'tmp<GeometricField<Foam::symmTensor, [2 * ...]>>' to 'const tmp<GeometricField<Foam::Tensor<double>, [2 * ...]>>' for 1st argument GeometricField ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/GeometricField.H:414:9: note: candidate constructor not viable: requires 2 arguments, but 1 was provided GeometricField ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/GeometricField.H:421:9: note: candidate constructor not viable: requires 2 arguments, but 1 was provided GeometricField ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/GeometricField.H:428:9: note: candidate constructor not viable: requires 2 arguments, but 1 was provided GeometricField ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/GeometricField.H:435:9: note: candidate constructor not viable: requires 2 arguments, but 1 was provided GeometricField ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/GeometricField.H:348:9: note: candidate constructor not viable: requires 3 arguments, but 1 was provided GeometricField ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/GeometricField.H:386:9: note: candidate constructor not viable: requires at least 2 arguments, but 1 was provided GeometricField ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/GeometricField.H:394:9: note: candidate constructor not viable: requires 3 arguments, but 1 was provided GeometricField ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/GeometricField.H:442:9: note: candidate constructor not viable: requires 3 arguments, but 1 was provided GeometricField ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/GeometricField.H:304:9: note: candidate constructor not viable: requires at least 3 arguments, but 1 was provided GeometricField ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/GeometricField.H:327:9: note: candidate constructor not viable: requires at least 3 arguments, but 1 was provided GeometricField ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/GeometricField.H:451:9: note: candidate constructor not viable: requires 4 arguments, but 1 was provided GeometricField ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/GeometricField.H:460:9: note: candidate constructor not viable: requires at least 3 arguments, but 1 was provided GeometricField ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/GeometricField.H:469:9: note: candidate constructor not viable: requires at least 3 arguments, but 1 was provided GeometricField ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/GeometricField.H:315:9: note: candidate constructor not viable: requires at least 4 arguments, but 1 was provided GeometricField ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/GeometricField.H:338:9: note: candidate constructor not viable: requires at least 4 arguments, but 1 was provided GeometricField ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/GeometricField.H:356:9: note: candidate constructor not viable: requires at least 4 arguments, but 1 was provided GeometricField ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/GeometricField.H:366:9: note: candidate constructor not viable: requires at least 4 arguments, but 1 was provided GeometricField ^ /Users/gux215/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/GeometricField.H:376:9: note: candidate constructor not viable: requires 5 arguments, but 1 was provided GeometricField ^ |
||
February 20, 2021, 14:14 |
|
#6 |
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13 |
sorry.. there must be something I miss.. may be computing each component of volTensorField in a for loop?
will try to have a look at the matter in the near future after sitting in front of a computer (always promising, but couldn't realise them due to insufficient time - so please don't consider this a promise.) if the issue hurts a lot, please open a bug ticket in develop.openfoam.com
__________________
The OpenFOAM community is the biggest contributor to OpenFOAM: User guide/Wiki-1/Wiki-2/Code guide/Code Wiki/Journal Nilsson/Guerrero/Holzinger/Holzmann/Nagy/Santos/Nozaki/Jasak/Primer Governance Bugs/Features: OpenFOAM (ESI-OpenCFD-Trademark) Bugs/Features: FOAM-Extend (Wikki-FSB) Bugs: OpenFOAM.org How to create a MWE New: Forkable OpenFOAM mirror |
|
February 20, 2021, 21:41 |
|
#7 | |
Senior Member
Join Date: Jun 2016
Posts: 102
Rep Power: 10 |
Quote:
|
||
February 26, 2021, 15:57 |
|
#8 |
New Member
Mattia Fabrizio Ciarlatani
Join Date: May 2020
Posts: 7
Rep Power: 6 |
Hey Xuegy,
If I understood your question well, a not elegant but functional solution (more of a temporary solution) to convert volSymmTensor to volTensor would be to add a volTensorField to your variables and then fill it cell by cell with something like Code:
A.component(0) = A_symm.component(0); A.component(1) = A_symm.component(1); A.component(2) = A_symm.component(2); A.component(3) = A_symm.component(1); A.component(4) = A_symm.component(3); A.component(5) = A_symm.component(4); A.component(6) = A_symm.component(2); A.component(7) = A_symm.component(4); A.component(8) = A_symm.component(5); |
|
February 26, 2021, 17:46 |
|
#9 |
Senior Member
Join Date: Jun 2016
Posts: 102
Rep Power: 10 |
Quote:
https://develop.openfoam.com/Develop.../-/issues/2011 The alternative solution would be using forall but it should be done directly. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Floating Point Exception with complex eigenvalues | gaolbert | OpenFOAM Programming & Development | 0 | July 20, 2017 06:37 |
complex eigenvalues detected for tensor | thegauravonline | OpenFOAM Pre-Processing | 3 | January 14, 2017 06:18 |
Problem with complex eigenvalues detected for symmTensor | tbao | OpenFOAM | 3 | November 3, 2016 10:24 |
flux limiter involving tensor : How to use fvc::flux() with volTensorField ? | Cyp | OpenFOAM Programming & Development | 2 | January 21, 2011 05:36 |
magnitudes of eigenvalues VS stiffness | atit | Main CFD Forum | 1 | July 28, 2000 13:14 |