Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with newer med library version #3

Open
robertodavia opened this issue Apr 3, 2020 · 6 comments
Open

Compatibility with newer med library version #3

robertodavia opened this issue Apr 3, 2020 · 6 comments

Comments

@robertodavia
Copy link

Hello,
first of all I want to thank you for the usefull application you built.
As it is the application works fine with OpenFOAM 7.0 and med 3.3.1. In order to make it work with a newer version of med, namely 4.0.0, some modifications should be made.

  • Inside the MEDmesh class, the type of input parameter medfileid, for each write function, should be changed from const int to const med_idt, otherwise the application crashes since its value is converted to 0, losing the information about the mesh file.

Thank you,
Roberto Da Vià

@niuniuaba
Copy link

@robertodavia

Hi Roberto, I am glad that someone is still on this because I have been struggling with building it for a while now. When I tried to build it with MED 4.0.0 I got an error:

checkMeshMoving.H:20:20: error: ‘class Foam::IOobject’ has no member named ‘headerOk’

Dig into cpp.openfoam.org and looked through IOobject.H I found that headerOK() have changed to typeHeaderOk() in OpenFOAM 6.0 (also in 7.0 actually). So I change headerOk() to typeHeaderOk() in checkMeshMoving.H file and build again but got another error:

checkMeshMoving.H:20:33: error: no matching function for call to ‘Foam::IOobject::typeHeaderOk()’

You mentioned you got it work fine in OpenFOAM 7.0 so I will appreciate if you can give some tip.

Thank you and best regards,

niuniuaba

@robertodavia
Copy link
Author

@niuniuaba
Hi Niuniuaba, I faced the same problem with the typeHeaderOk() function but I wasn't able to solve it. As a partial solution, since I am not using moving meshes, I just commented the code part relative to the moving mesh.
I will try again to overcome the issue.
Best regard,
Roberto

@niuniuaba
Copy link

niuniuaba commented May 9, 2020

@robertodavia
Hi Robeto,

just commented the code part relative to the moving mesh

That works for me. You really save my day, thank you so much!

When it comes to typeHeaderOk, I did some research and found that the point is the way to call this function. Take a look at file IOobjectTemplates.C where the function is defined you will find that typeHeaderOk is a template function and it should be called in a form like
typeHeaderOk<class_name>(true)
As it is supposed to check the header of a points file I guess I should put class_name to vectorField hear. After modified the relative code in checkMeshMoving.H file to
if (io.typeHeaderOk<vectorField>(true))
the code compiled successfully. I haven't checked it on a moving mesh yet (coz I don't have to deal with them in my work) but it works as expected on non-moving mesh for me so far.

Best regards,
niuniuaba

@mortbauer
Copy link
Owner

Hey, sorry for not responding so far,
I'm actually not working with med or salome or openfoam anymore, so please do not expect any work from my side on this. Feel free to fork or do whatever you like with it, but I won't be of any help for the foreseeable future.

@robertodavia
Copy link
Author

@mortbauer
Dear Martin,
I'm sorry that you don't work anymore with med, salome and foam since you did a great work by developing the foamMeshToMED converter. Thank you again.
If @niuniuaba agrees, we could fork the project and keep it updated, maybe trying to make it work with the main versions of OpenFOAM, i.e. OpenFOAM 7.0, OpenFOAM v1912 and Foam-Extend 4.1.
I think that it would be a very useful work.
Best regards,
Roberto

@niuniuaba
Copy link

@robertodavia

Hi Roberto, feel free to fork a repository if you can. I am afraid that it is far beyond my capability. I can read some code but I never write any piece of them in any programming language so far.

Best regards,
niuniuaba

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants