CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [cfMesh] Compiling cfMesh with OpenFOAM 4.x (https://www.cfd-online.com/Forums/openfoam-community-contributions/178535-compiling-cfmesh-openfoam-4-x.html)

dkokron October 4, 2016 15:47

Compiling cfMesh with OpenFOAM 4.x
 
Quote:

Originally Posted by wyldckat (Post 613095)
If you're looking for the source code of cfMesh (the non-Pro version), it's still available here: https://sourceforge.net/projects/cfmesh/ - according to their tweets, they updated it recently for OpenFOAM 4.0, it's on the "development" branch.

Following up on Bruno's suggestion that cfMesh has been updated to work with OpenFOAM-4.x, I installed the development release.
Code:

git clone git://git.code.sf.net/p/cfmesh/code cfmesh
and tried to build it against my installation of OpenFOAM-4.x. I'm using the Intel-2017.0.098 compiler on a Fedora-24 system.

Here's the compile time error.

Code:

icpc -std=c++11 -fp-trap=common -fp-model precise -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -diag-disable 327,654,1125,2289,2304,11062,11074,11076 -O3  -DNoRepository -I../../meshLibrary/lnInclude -I/home/dkokron/OpenFOAM/OpenFOAM-4.x/src/triSurface/lnInclude -I/home/dkokron/OpenFOAM/OpenFOAM-4.x/src/meshTools/lnInclude -I/home/dkokron/OpenFOAM/OpenFOAM-4.x/src/edgeMesh/lnInclude -IlnInclude -I. -I/home/dkokron/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude -I/home/dkokron/OpenFOAM/OpenFOAM-4.x/src/OSspecific/POSIX/lnInclude  -fPIC -c FLMAToSurface.C -o Make/linux64IccDPInt32Opt/FLMAToSurface.o
../../meshLibrary/lnInclude/DynListI.H(42): error #373: "void Foam::UList<T>::operator=(const Foam::UList<T> &) [with T=Foam::label={int32_t={int}}]" (declared at line 93 of "/home/dkokron/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/UList.H") is inaccessible
          this->UList<T>::operator=(UList<T>(newData, s));
                          ^
          detected during:
            instantiation of "void Foam::DynList<T, staticSize>::allocateSize(Foam::label={int32_t={int}}) [with T=Foam::label={int32_t={int}}, staticSize=16]" at line 214
            instantiation of "void Foam::DynList<T, staticSize>::append(const T &) [with T=Foam::label={int32_t={int}}, staticSize=16]" at line 98 of "../../meshLibrary/lnInclude/triSurfPointsI.H"

[ Moderator note: moved these three 3 posts from thread that the quote refers to, as well as added the quote for continuity sake and added code markers to the output. This thread is now ready for discussion on how to compile cfMesh with OpenFOAM 4.x ]

wyldckat October 9, 2016 15:58

Quick answer: You need to checkout the "development" branch. Complete list of commands:
Code:

git clone git://git.code.sf.net/p/cfmesh/code cfmesh
cd cfmesh
git checkout development
export WM_NCOMPPROCS=4
time ./Allwmake > log.make 2>&1


dkokron October 10, 2016 13:53

I confirmed that the 'development' branch does indeed build and run under 4.x. I also confirmed essentially zero-diff output for one of my geometries compared with cfMesh-1.1.1 built against OF-3.0+.

Thanks again Bruno.

wyldckat October 11, 2016 16:26

Just a quick note: They have released cfMesh 1.2.1 recently: https://twitter.com/CFieldsHR/status/785774036206755840
Quote:

#cfMesh now adapted to the latest version of OpenFOAM 4.0 and foam-extend-4.0
Download link: https://sourceforge.net/projects/cfmesh/files/v1.1.2/

misklach April 6, 2017 06:43

Hello I've successfully compiled cfMesh-v1.1.2 with OpenFOAM-4.1 and it works very well.

However when I try to mesh something with a smaller cell size I get this error

Code:

Create time

Setting root cube size and refinement parameters
Root box (-16.4988893 -17.6854167 -15.189) (16.2691107 15.0825833 17.579)
Requested cell size corresponds to octree level 10
Refining boundary
Refining boundary boxes to the given size


--> FOAM FATAL ERROR:
Negative size requested.

    From function template<class T, Foam::label Offset>
inline void Foam::LongList<T, Offset>::allocateSize(const label)
    in file lnInclude/LongListI.H at line 73.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::error::abort() at ??:?
#2  Foam::meshOctreeCube::findLeaves(Foam::LongList<Foam::meshOctreeCube*, 19>&) const at ??:?
#3  Foam::meshOctreeCube::findLeaves(Foam::LongList<Foam::meshOctreeCube*, 19>&) const at ??:?
#4  Foam::meshOctreeCube::findLeaves(Foam::LongList<Foam::meshOctreeCube*, 19>&) const at ??:?
#5  Foam::meshOctreeCube::findLeaves(Foam::LongList<Foam::meshOctreeCube*, 19>&) const at ??:?


I thought I had too many cells so I tried to compile cfMesh against OpenFOAM-4.1 with WM_LABEL_SIZE=64

Unfortunately I get this compilation error

Code:

lnInclude/DynListI.H: In instantiation of ‘Foam::DynList<T, staticSize>::DynList(const ListType&) [with ListType = int; T = long int; long int staticSize = 16l]’:
lnInclude/helperFunctionsTopologyManipulationI.H:491:34:  required from here
lnInclude/DynListI.H:195:15: error: request for member ‘size’ in ‘l’, which is of non-class type ‘const int’
    setSize(l.size());
            ~~^~~~
lnInclude/DynListI.H:197:32: error: subscripted value is neither array nor pointer
        this->operator[](i) = l[i];
                              ~^
lnInclude/DynListI.H: In instantiation of ‘Foam::DynList<T, staticSize>::DynList(const ListType&) [with ListType = int; T = Foam::Vector2D<double>; long int staticSize = 6l]’:
lnInclude/helperFunctionsGeometryQueriesI.H:1059:37:  required from here
lnInclude/DynListI.H:195:15: error: request for member ‘size’ in ‘l’, which is of non-class type ‘const int’
    setSize(l.size());
            ~~^~~~
lnInclude/DynListI.H:197:32: error: subscripted value is neither array nor pointer
        this->operator[](i) = l[i];
                              ~^
make: *** [Make/linux64Gcc62DPInt64Opt/utilities/meshes/polyMeshGenModifier/polyMeshGenModifierAddBufferCells.o] Error 1

Do you know how to fix this?
Thank you
Giampaolo

berny.tuegs August 17, 2017 21:18

OpenFOAM-dev not compiling due to metaDict_
 
1 Attachment(s)
*Edit* I have gone further along in the compilation. The original problem was metaDict_
Here is the list of steps I encountered and what I did to combat them:
1. metaDict_ not declared. Added "IOdictionary.H to polyMeshGen.H
2. The annoying tautology warning can be removed by changing ms.type_ != ms.type_ to ms.type != type_ in meshSubsetI.H
3. edgeMesh has been incorporated into meshTools in OF5 and dev. I did an in-place replacement of -ledgeMesh with nothing
4. Pstream::blocking and Pstream::scheduled have been replaced by Pstream::commsTypes::blocking and Pstream::commsTypes::scheduled - I replaced these
5. My foam compilation was done with WM_LABEL_SIZE=64. This seems to kill the compilation as it can't recognise a list in these circumstances (see Giampalo's error)
6. Set the WM_LABEL_SIZE to 32, meshLibrary compiles, but errors occur straight away once we try and build the executables. I saw the approach proposed by laurent in thread 160757 but that has since changed.

I am thinking of going back to LABEL_SIZE of 64 and trying to sort out the problem there.
I now have heaps more problems after this. First errors start at first program in the rank: cartesian2DMesh. See error message attached.


Any help would be greatly appreciated.

shildenbrand October 9, 2017 03:12

Compilation of cfMesh works
 
Quote:

Originally Posted by berny.tuegs (Post 661094)
*Edit* I have gone further along in the compilation. The original problem was metaDict_
Here is the list of steps I encountered and what I did to combat them:
1. metaDict_ not declared. Added "IOdictionary.H to polyMeshGen.H

3. edgeMesh has been incorporated into meshTools in OF5 and dev. I did an in-place replacement of -ledgeMesh with nothing
4. Pstream::blocking and Pstream::scheduled have been replaced by Pstream::commsTypes::blocking and Pstream::commsTypes::scheduled - I replaced these

Following your proposed steps 1,3 and 4 cfMesh compiles now with OF-dev.

Henning86 November 2, 2017 16:12

Openfoam v1706 will compile with:

Quote:

git checkout port-v1606+

student666 November 6, 2017 23:29

Quote:

Originally Posted by shildenbrand (Post 666957)
Following your proposed steps 1,3 and 4 cfMesh compiles now with OF-dev.

Please, can you give more details how to perform following instructions?...I'm not so skilled at linux compilation.

Quote:

I did an in-place replacement of -ledgeMesh with nothing
and

Quote:

Pstream::blocking and Pstream::scheduled have been replaced by Pstream::commsTypes::blocking and Pstream::commsTypes::scheduled - I replaced these
Thanks

student666 November 8, 2017 17:34

I was able to partially compile the library, by fixing point 1 adding to:

../meshLibrary/lnInclude/polyMeshGen.H

Code:

#include "polyMeshGenCells.H"
#include "dictionary.H"
#include "IOdictionary.H"

and using the following command:

Code:

find ./ -exec sed -i -e 's/Pstream::blocking/Pstream::commsTypes::blocking/' {} \;
Code:

find ./ -exec sed -i -e 's/Pstream::scheduled/Pstream::commsTypes::scheduled/' {} \;
now I'm stuck with the following:
Code:

utilities/smoothers/geometry/meshOptimizer/tetMeshOptimisation/tetMeshOptimisation.C:505:67: error: no matching function for call to ‘eigenVector(Foam::symmTensor&, const double&)’
                            vector normal1 = eigenVector(nt, ev[1]);

Code:

utilities/smoothers/geometry/meshOptimizer/tetMeshOptimisation/tetMeshOptimisation.C:498:66: error: no matching function for call to ‘eigenVector(Foam::symmTensor&, const double&)’
                            vector normal = eigenVector(nt, ev[2]);

can someone help me to fix this issue?!?

Thanks a lot

I'm compiling on Linux Mint 18.2 with openfoam-dev (last update)

student666 November 10, 2017 15:03

Hi,

please can somebody helps me with this issue?
Code:

utilities/smoothers/geometry/meshOptimizer/tetMeshOptimisation/tetMeshOptimisation.C:507:67: error: no matching function for call to ‘eigenVector(Foam::symmTensor&, const double&)’
                            vector normal2 = eigenVector(nt, ev[2]);
                                                                  ^
In file included from /opt/openfoam-dev/src/OpenFOAM/lnInclude/fieldTypes.H:38:0,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/flipOp.H:40,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/mapDistributeBaseTemplates.C:29,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/mapDistributeBase.H:489,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/FieldMapper.H:35,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/Field.C:26,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/Field.H:408,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/labelField.H:39,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/primitiveFields.H:37,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/pointField.H:36,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/boundBox.H:35,
                from utilities/smoothers/geometry/meshOptimizer/tetMeshOptimisation/tetMeshOptimisation.H:40,
                from utilities/smoothers/geometry/meshOptimizer/tetMeshOptimisation/tetMeshOptimisation.C:29:
/opt/openfoam-dev/src/OpenFOAM/lnInclude/tensor.H:54:8: note: candidate: Foam::vector Foam::eigenVector(const tensor&, Foam::scalar, const vector&, const vector&)
 vector eigenVector

Thanks in advance.

Regards

shildenbrand November 13, 2017 05:16

I downloaded the latest version in git today and now the source compiles without any modifications from the source.

student666 November 13, 2017 13:30

Are you using ubuntu and opebfoam-dev?

student666 November 13, 2017 16:15

1 Attachment(s)
Hi,

I can't understand, but I'm not able to run the compilation on LinuxMint 18.2.
I used

Code:

git clone git://git.code.sf.net/p/cfmesh/code cfmesh-code
but It seems that same version has been downloaded as for same errors occurs.

After fixing point 1,3,4, and ./Allwmake, I got this

Code:

wmakeLnInclude: linking include files to ./lnInclude
could not open file foamTime.H for source file utilities/workflowControls/workflowControls.C due to No such file or directory
could not open file foamTime.H for source file utilities/dataConversion/foamToFPMA/fpmaMesh.C due to No such file or directory
could not open file foamTime.H for source file utilities/dataConversion/foamToFPMA/writeMeshFPMA.C due to No such file or directory
could not open file foamTime.H for source file voronoiMesh/voronoiMeshGenerator/voronoiMeshGenerator.C due to No such file or directory
could not open file foamTime.H for source file voronoiMesh/voronoiMeshExtractor/voronoiMeshExtractorCreateMesh.C due to No such file or directory
could not open file foamTime.H for source file voronoiMesh/voronoiMeshExtractor
...
...
...
...

and that's the error

Code:

utilities/smoothers/geometry/meshOptimizer/tetMeshOptimisation/tetMeshOptimisation.C: In member function ‘void Foam::tetMeshOptimisation::optimiseBoundaryVolumeOptimizer(Foam::label, bool)’:
utilities/smoothers/geometry/meshOptimizer/tetMeshOptimisation/tetMeshOptimisation.C:498:66: error: no matching function for call to ‘eigenVector(Foam::symmTensor&, const double&)’
                            vector normal = eigenVector(nt, ev[2]);
                                                                  ^
In file included from /opt/openfoam-dev/src/OpenFOAM/lnInclude/fieldTypes.H:38:0,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/flipOp.H:40,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/mapDistributeBaseTemplates.C:29,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/mapDistributeBase.H:489,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/FieldMapper.H:35,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/Field.C:26,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/Field.H:408,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/labelField.H:39,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/primitiveFields.H:37,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/pointField.H:36,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/boundBox.H:35,
                from utilities/smoothers/geometry/meshOptimizer/tetMeshOptimisation/tetMeshOptimisation.H:40,
                from utilities/smoothers/geometry/meshOptimizer/tetMeshOptimisation/tetMeshOptimisation.C:29:
/opt/openfoam-dev/src/OpenFOAM/lnInclude/tensor.H:54:8: note: candidate: Foam::vector Foam::eigenVector(const tensor&, Foam::scalar, const vector&, const vector&)
 vector eigenVector
        ^
/opt/openfoam-dev/src/OpenFOAM/lnInclude/tensor.H:54:8: note:  candidate expects 4 arguments, 2 provided
/opt/openfoam-dev/src/OpenFOAM/lnInclude/tensor.H:65:8: note: candidate: Foam::vector Foam::eigenVector(const symmTensor&, Foam::scalar, const vector&, const vector&)
 vector eigenVector
        ^
/opt/openfoam-dev/src/OpenFOAM/lnInclude/tensor.H:65:8: note:  candidate expects 4 arguments, 2 provided
utilities/smoothers/geometry/meshOptimizer/tetMeshOptimisation/tetMeshOptimisation.C:505:67: error: no matching function for call to ‘eigenVector(Foam::symmTensor&, const double&)’
                            vector normal1 = eigenVector(nt, ev[1]);
                                                                  ^
In file included from /opt/openfoam-dev/src/OpenFOAM/lnInclude/fieldTypes.H:38:0,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/flipOp.H:40,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/mapDistributeBaseTemplates.C:29,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/mapDistributeBase.H:489,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/FieldMapper.H:35,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/Field.C:26,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/Field.H:408,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/labelField.H:39,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/primitiveFields.H:37,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/pointField.H:36,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/boundBox.H:35,
                from utilities/smoothers/geometry/meshOptimizer/tetMeshOptimisation/tetMeshOptimisation.H:40,
                from utilities/smoothers/geometry/meshOptimizer/tetMeshOptimisation/tetMeshOptimisation.C:29:
/opt/openfoam-dev/src/OpenFOAM/lnInclude/tensor.H:54:8: note: candidate: Foam::vector Foam::eigenVector(const tensor&, Foam::scalar, const vector&, const vector&)
 vector eigenVector
        ^
/opt/openfoam-dev/src/OpenFOAM/lnInclude/tensor.H:54:8: note:  candidate expects 4 arguments, 2 provided
/opt/openfoam-dev/src/OpenFOAM/lnInclude/tensor.H:65:8: note: candidate: Foam::vector Foam::eigenVector(const symmTensor&, Foam::scalar, const vector&, const vector&)
 vector eigenVector
        ^
/opt/openfoam-dev/src/OpenFOAM/lnInclude/tensor.H:65:8: note:  candidate expects 4 arguments, 2 provided
utilities/smoothers/geometry/meshOptimizer/tetMeshOptimisation/tetMeshOptimisation.C:507:67: error: no matching function for call to ‘eigenVector(Foam::symmTensor&, const double&)’
                            vector normal2 = eigenVector(nt, ev[2]);
                                                                  ^
In file included from /opt/openfoam-dev/src/OpenFOAM/lnInclude/fieldTypes.H:38:0,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/flipOp.H:40,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/mapDistributeBaseTemplates.C:29,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/mapDistributeBase.H:489,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/FieldMapper.H:35,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/Field.C:26,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/Field.H:408,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/labelField.H:39,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/primitiveFields.H:37,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/pointField.H:36,
                from /opt/openfoam-dev/src/OpenFOAM/lnInclude/boundBox.H:35,
                from utilities/smoothers/geometry/meshOptimizer/tetMeshOptimisation/tetMeshOptimisation.H:40,
                from utilities/smoothers/geometry/meshOptimizer/tetMeshOptimisation/tetMeshOptimisation.C:29:
/opt/openfoam-dev/src/OpenFOAM/lnInclude/tensor.H:54:8: note: candidate: Foam::vector Foam::eigenVector(const tensor&, Foam::scalar, const vector&, const vector&)
 vector eigenVector
        ^
/opt/openfoam-dev/src/OpenFOAM/lnInclude/tensor.H:54:8: note:  candidate expects 4 arguments, 2 provided
/opt/openfoam-dev/src/OpenFOAM/lnInclude/tensor.H:65:8: note: candidate: Foam::vector Foam::eigenVector(const symmTensor&, Foam::scalar, const vector&, const vector&)
 vector eigenVector
        ^
/opt/openfoam-dev/src/OpenFOAM/lnInclude/tensor.H:65:8: note:  candidate expects 4 arguments, 2 provided
make: *** [Make/linux64GccDPInt32Opt/utilities/smoothers/geometry/meshOptimizer/tetMeshOptimisation/tetMeshOptimisation.o] Error 1
could not open file foamTime.H for source file cartesian2DMesh.C due to No such file or directory
/usr/bin/ld: cannot find -ledgeMesh
/usr/bin/ld: cannot find -lmeshLibrary
collect2: error: ld returned 1 exit status
make[1]: *** [/home/michele/OpenFOAM/michele-dev/platforms/linux64GccDPInt32Opt/bin/cartesian2DMesh] Error 1
make: *** [cartesian2DMesh] Error 2
/usr/bin/ld: cannot find -ledgeMesh
/usr/bin/ld: cannot find -lmeshLibrary
collect2: error: ld returned 1 exit status
make[1]: *** [/home/michele/OpenFOAM/michele-dev/platforms/linux64GccDPInt32Opt/bin/checkSurfaceMesh] Error 1
make: *** [checkSurfaceMesh] Error 2

I attach even the log file of my compilation

shildenbrand November 14, 2017 02:51

You need to get the development branch, see post #2

Code:

git checkout development

student666 November 14, 2017 14:24



Thank you very much,

As the post from Bruno is 1-year old, I thought it was "old"

Regards.


yambanshee August 15, 2018 11:26

Quote:

Originally Posted by student666 (Post 670944)
I was able to partially compile the library, by fixing point 1 adding to:

../meshLibrary/lnInclude/polyMeshGen.H

Code:

#include "polyMeshGenCells.H"
#include "dictionary.H"
#include "IOdictionary.H"

and using the following command:

Code:

find ./ -exec sed -i -e 's/Pstream::blocking/Pstream::commsTypes::blocking/' {} \;
Code:

find ./ -exec sed -i -e 's/Pstream::scheduled/Pstream::commsTypes::scheduled/' {} \;
now I'm stuck with the following:
Code:

utilities/smoothers/geometry/meshOptimizer/tetMeshOptimisation/tetMeshOptimisation.C:505:67: error: no matching function for call to ‘eigenVector(Foam::symmTensor&, const double&)’
                            vector normal1 = eigenVector(nt, ev[1]);

Code:

utilities/smoothers/geometry/meshOptimizer/tetMeshOptimisation/tetMeshOptimisation.C:498:66: error: no matching function for call to ‘eigenVector(Foam::symmTensor&, const double&)’
                            vector normal = eigenVector(nt, ev[2]);

can someone help me to fix this issue?!?

Thanks a lot

I'm compiling on Linux Mint 18.2 with openfoam-dev (last update)


also getting this issue. Did you manage to solve it?


All times are GMT -4. The time now is 02:37.