# An error occurs when I want to access the mesh information directly

**URL:** <https://precice.discourse.group/t/an-error-occurs-when-i-want-to-access-the-mesh-information-directly/1386>\
**Category:** Using preCICE\
**Tags:** immersed-boundary, direct-mesh-access, fortran\
**Created:** [April 24, 2023, 5:35am UTC](https://precice.discourse.group/t/an-error-occurs-when-i-want-to-access-the-mesh-information-directly/1386 "2023-04-24T05:35:52Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![wufanxiaozi](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/wufanxiaozi/32/1643_2.png) [@wufanxiaozi](https://precice.discourse.group/u/wufanxiaozi)\
**Post date:** [April 24, 2023, 5:35am UTC](https://precice.discourse.group/t/an-error-occurs-when-i-want-to-access-the-mesh-information-directly/1386/1 "2023-04-24T05:35:52Z")

</div>

I want a fluid solver coupled to a solid solver for the Immersed Boundary Method. According to the official suggestion, I want to use this subroutine “precicef\_get\_mesh\_vertices\_and\_IDs()” to get the vertex coordinates of the solid mesh, but I can’t find him when compiling. I saw that this function is still in the experimental stage and may be changed later, but I am using the latest version of precice, who can tell me whether this function has changed?  
what should I do ? Can everyone help me!

by  
wufan

---

<div class="post-metadata">

**Author:** ![wufanxiaozi](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/wufanxiaozi/32/1643_2.png) [@wufanxiaozi](https://precice.discourse.group/u/wufanxiaozi)\
**Post date:** [April 24, 2023, 5:55am UTC](https://precice.discourse.group/t/an-error-occurs-when-i-want-to-access-the-mesh-information-directly/1386/2 "2023-04-24T05:55:15Z")

</div>

No error is reported for other precice’s subroutine used, but when using this function，I received an error “undefined reference to `precicef\_get\_mesh\_vertices\_and\_ids\_'”

---

<div class="post-metadata">

**Author:** ![DavidSCN](https://avatars.discourse-cdn.com/v4/letter/d/c37758/32.png) [@DavidSCN](https://precice.discourse.group/u/DavidSCN)\
**Post date:** [April 24, 2023, 7:01am UTC](https://precice.discourse.group/t/an-error-occurs-when-i-want-to-access-the-mesh-information-directly/1386/3 "2023-04-24T07:01:45Z")

</div>

I guess your selected capitalization is wrong.

This version should work

> <https://github.com/precice/precice/blob/fded29bfb7e07e3b945cc21c3838434354b4750c/extras/bindings/fortran/include/precice/SolverInterfaceFortran.hpp#L824-L828>

You can find out about such things on our doxygen page:

[https://precice.org/doxygen/main/SolverInterfaceFortran\_8hpp.html](https://precice.org/doxygen/main/SolverInterfaceFortran_8hpp.html)

I agree that having all caps `IDs` in this function name is inconsistent with the remaining API, we should probably change this part, thanks!

---

<div class="post-metadata">

**Author:** ![wufanxiaozi](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/wufanxiaozi/32/1643_2.png) [@wufanxiaozi](https://precice.discourse.group/u/wufanxiaozi)\
**Post date:** [April 24, 2023, 7:25am UTC](https://precice.discourse.group/t/an-error-occurs-when-i-want-to-access-the-mesh-information-directly/1386/4 "2023-04-24T07:25:08Z")

</div>

Very happy with your reply, but it is case insensitive in Fortran. At the same time, I also changed to lowercase, and also reported this error

---

<div class="post-metadata">

**Author:** ![wufanxiaozi](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/wufanxiaozi/32/1643_2.png) [@wufanxiaozi](https://precice.discourse.group/u/wufanxiaozi)\
**Post date:** [April 24, 2023, 7:40am UTC](https://precice.discourse.group/t/an-error-occurs-when-i-want-to-access-the-mesh-information-directly/1386/5 "2023-04-24T07:40:42Z")

</div>

This is my code

 ![image](https://global.discourse-cdn.com/free1/uploads/precice/original/2X/e/efdec5925de6761e1593e723731e867570441da3.png)  
and this is the error  
 ![image](https://global.discourse-cdn.com/free1/uploads/precice/original/2X/5/5108b87e119c2c35411accf67da3b4bf14ec1340.png)

---

<div class="post-metadata">

**Author:** ![DavidSCN](https://avatars.discourse-cdn.com/v4/letter/d/c37758/32.png) [@DavidSCN](https://precice.discourse.group/u/DavidSCN)\
**Post date:** [April 24, 2023, 7:44am UTC](https://precice.discourse.group/t/an-error-occurs-when-i-want-to-access-the-mesh-information-directly/1386/6 "2023-04-24T07:44:50Z")

</div>

Yes, you are right, the error message would also look different then. How did you install preCICE?

---

<div class="post-metadata">

**Author:** ![wufanxiaozi](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/wufanxiaozi/32/1643_2.png) [@wufanxiaozi](https://precice.discourse.group/u/wufanxiaozi)\
**Post date:** [April 24, 2023, 8:04am UTC](https://precice.discourse.group/t/an-error-occurs-when-i-want-to-access-the-mesh-information-directly/1386/7 "2023-04-24T08:04:23Z")

</div>

Thank you DavidSCN, I compiled and installed the source code on the supercomputing machine. The quickstart and Perpendicular flap in the tutorial can be run, and I can also successfully run the calculation examples in the provided Fortran binding.

---

<div class="post-metadata">

**Author:** ![wufanxiaozi](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/wufanxiaozi/32/1643_2.png) [@wufanxiaozi](https://precice.discourse.group/u/wufanxiaozi)\
**Post date:** [April 24, 2023, 8:33am UTC](https://precice.discourse.group/t/an-error-occurs-when-i-want-to-access-the-mesh-information-directly/1386/8 "2023-04-24T08:33:39Z")

</div>

Thank you David,Just now I compiled successfully, I don’t know where I modified, but it did succeed, thank you for your help. I also want to ask you a question, if I want to get the position of the solid mesh in the time loop, should I call the subroutine “precicef\_get\_mesh\_vertices\_and\_IDs” in the time loop?

---

<div class="post-metadata">

**Author:** ![DavidSCN](https://avatars.discourse-cdn.com/v4/letter/d/c37758/32.png) [@DavidSCN](https://precice.discourse.group/u/DavidSCN)\
**Post date:** [April 24, 2023, 9:41am UTC](https://precice.discourse.group/t/an-error-occurs-when-i-want-to-access-the-mesh-information-directly/1386/9 "2023-04-24T09:41:41Z")

</div>

> [@wufanxiaozi](#):
>
> should I call the subroutine “precicef\_get\_mesh\_vertices\_and\_IDs” in the time loop?

No, once before the time loop starts is sufficient, the meshes don’t change throughout the simulation.

---

<div class="post-metadata">

**Author:** ![wufanxiaozi](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/wufanxiaozi/32/1643_2.png) [@wufanxiaozi](https://precice.discourse.group/u/wufanxiaozi)\
**Post date:** [April 24, 2023, 10:37am UTC](https://precice.discourse.group/t/an-error-occurs-when-i-want-to-access-the-mesh-information-directly/1386/10 "2023-04-24T10:37:40Z")

</div>

so，what should I do if I want to get solid mesh when the solid mesh deformed in time loop？

---

<div class="post-metadata">

**Author:** ![wufanxiaozi](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/wufanxiaozi/32/1643_2.png) [@wufanxiaozi](https://precice.discourse.group/u/wufanxiaozi)\
**Post date:** [April 24, 2023, 1:59pm UTC](https://precice.discourse.group/t/an-error-occurs-when-i-want-to-access-the-mesh-information-directly/1386/11 "2023-04-24T13:59:29Z")

</div>

I have a new problem, I set it up according to the tutorial, but when I use subrountine “precicef\_get\_mesh\_id(SolidMeshName, SolidMeshID)”, I get such an error message "preCICE:ERROR: The given Mesh ID “12395504” is unknown to preCICE .” Solid solver I used rigid\_body\_solver.cpp in quickstart, and modified it. I released the solid code and configuration files  
fluid solver:

 ![image](https://global.discourse-cdn.com/free1/uploads/precice/original/2X/b/b0de1a8315def4896a34b60feb7f1ba711d0dcfe.png)  
solid solver:  
 ![image](https://global.discourse-cdn.com/free1/uploads/precice/original/2X/2/2971a0012edb8ae289cc12ebeb2ebdd927f0c1ae.png)  
precice-config.xml  
 ![image](https://global.discourse-cdn.com/free1/uploads/precice/original/2X/e/efbeb59f897be89d8f63ca55668e97f8d1fb09e3.png)

error:

 ![image](https://global.discourse-cdn.com/free1/uploads/precice/original/2X/0/0d5ff2eac570d0345991f894fb1eb8e4f524813a.png)

---

<div class="post-metadata">

**Author:** ![wufanxiaozi](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/wufanxiaozi/32/1643_2.png) [@wufanxiaozi](https://precice.discourse.group/u/wufanxiaozi)\
**Post date:** [April 26, 2023, 6:41am UTC](https://precice.discourse.group/t/an-error-occurs-when-i-want-to-access-the-mesh-information-directly/1386/12 "2023-04-26T06:41:47Z")

</div>

I further pinned down the error on this line of code

> CALL precicef\_set\_mesh\_access\_region(SolidMeshID, boundingBox)

The error is “The given Mesh ID XXXX is unknown to preCICE”  
Even if I change the code to  
` CALL precicef_set_mesh_access_region(0, boundingBox)`  
still the same error.

---

<div class="post-metadata">

**Author:** ![wufanxiaozi](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/wufanxiaozi/32/1643_2.png) [@wufanxiaozi](https://precice.discourse.group/u/wufanxiaozi)\
**Post date:** [April 26, 2023, 6:45am UTC](https://precice.discourse.group/t/an-error-occurs-when-i-want-to-access-the-mesh-information-directly/1386/13 "2023-04-26T06:45:49Z")

</div>

I don’t know whether this command is necessary if I want to use “direct access to received meshes”.  
When I comment out this line of code, initialization succeeds.

[https://precice.org/couple-your-code-direct-access.html](https://precice.org/couple-your-code-direct-access.html)
