CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   New dynamic mesh rule with symbol lookup error (https://www.cfd-online.com/Forums/openfoam-programming-development/193771-new-dynamic-mesh-rule-symbol-lookup-error.html)

Joe Wang October 2, 2017 22:42

New dynamic mesh rule with symbol lookup error (Solved)
 
Hi, Foamers,
I just touched the openfoam programing. I tried to create a new dynamic mesh rule but came across difficulties at the first step.

The development is based on OpenFOAM-extend-4.0.
I tried the followings:
1. I created myMovingBodyTopoFvMesh based on movingBodyFvMesh without any changes but the name and successfully complied (wmake libso) it. I added dynamicFvMeshLibs ("libmyMovingBodyTopoFvMesh.so") to constant/dynamicMeshDict of the case in tutorial and it ran well.

2. Then I created a new meshmotion rule, i.e. mylinearOscillation based on linearOscillation, and successfully compiled (wmake libso) it (no errors show up). Then I changed the linearOscillation to mylinearOscillation in the constant/dynamicMeshDict of the tutorial. But the new mylinearOscillation was not recognized.

3. To solve the problem in 2, I tried the following:
1) I copied the whole solidBodyMotion folder, which contains the linearOscillation folder, as mysolidBodyMotion. I renamed every folders and files and did relevant changes in the Make/files and options. Then they were compiled (wmake libso) successfully.
2) I updated solidBodyMotionFunction with mysolidBodyMotionFunction in the myMovingBodyTopoFvMesh files. I also changed relevant files, including the directory in Make/options. myMovingBodyTopoFvMesh was successfully compiled (wmake libso) then.
3) I made relevant changes in the constant/dynamicMeshDict and ran the tutorial. It gave an error: icoDyMSimpleFoam: symbol lookup error: /home/civil/foam/civil-4.0/lib/linux64GccDPOpt/libmyMovingBodyTopoFvMesh.so: undefined symbol: _ZN4Foam25mysolidBodyMotionFunction3NewERKNS_10dic tionaryERKNS_4TimeE

Does anyone know how to fix it? Really appreciate.

BTW, when I changed the Make/options file, I know how to change the EXE_INC part. But how about the LIB_LIBS part?
When I made the following changes:
EXE_INC = \
-I$(WM_PROJECT_USER_DIR)/src/dynamicMesh/meshMotion/mysolidBodyMotion/lnInclude
LIB_LIBS = \
-lmysolidBodyMotion
the LIB_LIBS change was not recognized. I'm not sure if it's the key problem. But I also noticed I can even delete the LIB_LIBS part and the compilation still worked.

It was really hard for me. Hope anyone could offer me some advice. Thanks.

Joe

Joe Wang October 24, 2017 21:09

I solved this problem by changing the Make/options file like
LIB_LIBS = \
-L $(FOAM_USER_LIBBIN) \
-lmysolidBodyMotion
and then it could be corrected built.


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