View Issue Details

IDProjectCategoryView StatusLast Update
0003851OpenFOAMBugpublic2022-06-24 11:38
Reporterdeo Assigned Tohenry  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformGNU/LinuxOSOtherOS Version(please specify)
Fixed in Versiondev 
Summary0003851: Implementation of operator=(diagTensor) missing in Tensor class?
Description    tensor test;
    test = diagTensor(1,2,3);

fails to compile:

/software/OpenFOAM/OpenFOAM-9/src/OpenFOAM/lnInclude/Tensor.H:208:21: warning: inline function ‘void Foam::Tensor<Cmpt>::operator=(const Foam::DiagTensor<Cmpt>&) [with Cmpt = double]’ used but never defined
         inline void operator=(const DiagTensor<Cmpt>&);
                     ^~~~~~~~
and:

undefined reference to `Foam::Tensor<double>::operator=(Foam::DiagTensor<double> const&)'
collect2: error: ld returned 1 exit status
make: *** [/software/OpenFOAM/OpenFOAM-9/wmake/makefiles/general:154: build/Test-hexaScalar] Error 1

Implementation is indeed missing from TensorI.H.
TagsNo tags attached.

Activities

cgoessni

2022-06-24 10:24

reporter   ~0012647

I don't think that you can use the constructor of diagTensor like that. Try with New/new.

deo

2022-06-24 10:40

reporter   ~0012648

Why not? And why would it work with symmTensor then?

    tensor test;
    diagTensor test2(1,2,3);
    symmTensor test3(1,2,3,4,5,6);

    test = test2; // Fails to compile
    test = test3; // Compiles

    test = diagTensor(1,2,3); // Fails to compile
    test = symmTensor(1,2,3,4,5,6); // Compiles

Again, I think the implementation of operator=(diagTensor) is missing from the Tensor class.

cgoessni

2022-06-24 11:03

reporter   ~0012649

Then please ignore my comment, my C++ is a bit rusty.

henry

2022-06-24 11:38

manager   ~0012651

Resolved by commit 2628dfe679ffee0f2613073b0dfba428875f3b59

Issue History

Date Modified Username Field Change
2022-06-24 08:51 deo New Issue
2022-06-24 10:24 cgoessni Note Added: 0012647
2022-06-24 10:40 deo Note Added: 0012648
2022-06-24 11:03 cgoessni Note Added: 0012649
2022-06-24 11:38 henry Assigned To => henry
2022-06-24 11:38 henry Status new => resolved
2022-06-24 11:38 henry Resolution open => fixed
2022-06-24 11:38 henry Fixed in Version => dev
2022-06-24 11:38 henry Note Added: 0012651