# General Discussion

**URL:** https://community.freefem.org/c/general-discussion/7.md?page=15

[Latest](https://community.freefem.org/latest.md) · [Categories](https://community.freefem.org/categories.md)

**Page:** 16

---

## [Using gmsh to draw mesh and import it into FreeFem results in an error](https://community.freefem.org/t/using-gmsh-to-draw-mesh-and-import-it-into-freefem-results-in-an-error/3539)

<div class="topic-metadata">

**Author:** [@yongheng](https://community.freefem.org/u/yongheng)\
**Replies:** 4\
**Last updated:** [October 10, 2024, 9:21am UTC](https://community.freefem.org/t/using-gmsh-to-draw-mesh-and-import-it-into-freefem-results-in-an-error/3539 "2024-10-10T09:21:40Z")

</div>

Hello, I am a newcomer to using FreeFem. I would like to know why when I export my 3D mesh, which I drew in Gmsh, in the （.msh） format, and I choose ASCII 2 with the other two options unchecked, the result in FreeFem onl…

---

## [Communication between meshes](https://community.freefem.org/t/communication-between-meshes/837)

<div class="topic-metadata">

**Author:** [@marcodeba](https://community.freefem.org/u/marcodeba)\
**Replies:** 5\
**Last updated:** [October 9, 2024, 10:33am UTC](https://community.freefem.org/t/communication-between-meshes/837 "2024-10-09T10:33:06Z")

</div>

Hi everybody! I am approaching the solution of a magnetostatic problem with two different meshing strategies and one of them is not working properly having apparently “no communication” between the mesh components. The…

---

## [How to fix and apply a load to an arbitrary point](https://community.freefem.org/t/how-to-fix-and-apply-a-load-to-an-arbitrary-point/3521)

<div class="topic-metadata">

**Author:** [@Trueo](https://community.freefem.org/u/Trueo)\
**Replies:** 2\
**Last updated:** [October 9, 2024, 6:41am UTC](https://community.freefem.org/t/how-to-fix-and-apply-a-load-to-an-arbitrary-point/3521 "2024-10-09T06:41:09Z")

</div>

Hello. In a 2-dimensional beam problem Set the displacement of any point to 0. I apply a load to an arbitrary point. I would like to calculate the strain energy and displacement in this case. Is it possible to selec…

---

## [Problem solving Navier Stokes equations with Newton method](https://community.freefem.org/t/problem-solving-navier-stokes-equations-with-newton-method/3538)

<div class="topic-metadata">

**Author:** [@SusannaM](https://community.freefem.org/u/SusannaM)\
**Replies:** 1\
**Last updated:** [October 8, 2024, 12:42pm UTC](https://community.freefem.org/t/problem-solving-navier-stokes-equations-with-newton-method/3538 "2024-10-08T12:42:14Z")

</div>

Hi, i am trying to solve NS equation with Newton method in a 3D cubic domain with non zero value of the y-component of the velocity at the inflow boundary. The problem I have is that the velocity is almost not updating …

---

## [When building a cube with Gmsh, surface labels are automatically added](https://community.freefem.org/t/when-building-a-cube-with-gmsh-surface-labels-are-automatically-added/3534)

<div class="topic-metadata">

**Author:** [@yongheng](https://community.freefem.org/u/yongheng)\
**Replies:** 0\
**Last updated:** [October 6, 2024, 3:23am UTC](https://community.freefem.org/t/when-building-a-cube-with-gmsh-surface-labels-are-automatically-added/3534 "2024-10-06T03:23:28Z")

</div>

Hi all, When I was trying to create a mesh in Gmsh, while defining a cube, it automatically added a surface label that I already had, which is also in the Surface Loop(29) = {167, 169, 170, 171,176,1,2,3,4,5,6,7,8,9,10,…

---

## [Simple problem related to \`macro\` keyword](https://community.freefem.org/t/simple-problem-related-to-macro-keyword/3530)

<div class="topic-metadata">

**Author:** [@jna1g18](https://community.freefem.org/u/jna1g18)\
**Replies:** 3\
**Last updated:** [October 4, 2024, 12:03pm UTC](https://community.freefem.org/t/simple-problem-related-to-macro-keyword/3530 "2024-10-04T12:03:39Z")

</div>

Hi all, I’m trying to use the macro keyword to include some functions into my weak form (just to tidy up my code and to make mistakes less likely when typing). However, when playing around with the macro keyword, I ran i…

---

## [Recommendation reminder](https://community.freefem.org/t/recommendation-reminder/3529)

<div class="topic-metadata">

**Author:** [@lassounon](https://community.freefem.org/u/lassounon)\
**Replies:** 0\
**Last updated:** [October 3, 2024, 2:42pm UTC](https://community.freefem.org/t/recommendation-reminder/3529 "2024-10-03T14:42:58Z")

</div>

Hello everyone. If you use FreeFem++ in your work, please cite it in your papers. You can use the BibTeX below @article{MR3043640, AUTHOR = {Hecht, F.}, TITLE = {New development in FreeFem++}, JOURNAL = {J. Numer. M…

---

## [Related to unfitted mesh generation in FreeFEM](https://community.freefem.org/t/related-to-unfitted-mesh-generation-in-freefem/3528)

<div class="topic-metadata">

**Author:** [@89273166](https://community.freefem.org/u/89273166)\
**Replies:** 0\
**Last updated:** [October 3, 2024, 9:46am UTC](https://community.freefem.org/t/related-to-unfitted-mesh-generation-in-freefem/3528 "2024-10-03T09:46:03Z")

</div>

Respected Sir/ma’am, May I know how to generate unfitted mesh(non-body fitted mesh) in FreeFEM++ ? Any small suggestion is appreciated. Thank you.

---

## [Problem vs varf](https://community.freefem.org/t/problem-vs-varf/3525)

<div class="topic-metadata">

**Author:** [@PierreAntonetti](https://community.freefem.org/u/PierreAntonetti)\
**Replies:** 3\
**Last updated:** [September 30, 2024, 2:51pm UTC](https://community.freefem.org/t/problem-vs-varf/3525 "2024-09-30T14:51:46Z")

</div>

Hello I’m facing a problem I can’t understand when using varf instead of problem. Here a very sample script which solve the poisson equation using adpatation. The script works with problem but crash after the first ad…

---

## [Mixed problems involving 2D meshes and 1D lineic meshes](https://community.freefem.org/t/mixed-problems-involving-2d-meshes-and-1d-lineic-meshes/594)

<div class="topic-metadata">

**Author:** [@david.fabre](https://community.freefem.org/u/david.fabre)\
**Replies:** 5\
**Last updated:** [September 30, 2024, 5:38am UTC](https://community.freefem.org/t/mixed-problems-involving-2d-meshes-and-1d-lineic-meshes/594 "2024-09-30T05:38:48Z")

</div>

Dear all We are experimenting with the newly introduced 1d lineic meshes. We have cases where we have to build matrix block where variable is lineic and test function is surfacic or vice versa. The first situation wo…

---

## [Error encountered when constructing the stiffness matrix with PETSc](https://community.freefem.org/t/error-encountered-when-constructing-the-stiffness-matrix-with-petsc/3509)

<div class="topic-metadata">

**Author:** [@yongheng](https://community.freefem.org/u/yongheng)\
**Replies:** 11\
**Last updated:** [September 27, 2024, 5:00am UTC](https://community.freefem.org/t/error-encountered-when-constructing-the-stiffness-matrix-with-petsc/3509 "2024-09-27T05:00:46Z")

</div>

Why do I encounter an error at A = laplace(W1, W1); when executing the following PETSc parallel code, but the problem disappears when I remove rhoe? Additionally, I experience the same issue when I set rhoe to 1. I’m not…

---

## [Vornoi tessellations](https://community.freefem.org/t/vornoi-tessellations/3523)

<div class="topic-metadata">

**Author:** [@Joujou](https://community.freefem.org/u/Joujou)\
**Replies:** 0\
**Last updated:** [September 26, 2024, 10:37am UTC](https://community.freefem.org/t/vornoi-tessellations/3523 "2024-09-26T10:37:00Z")

</div>

Hi everyone, I’m working on a crystal plasticity simulation for a polycrystal and need to generate a Voronoi tessellation. Does anyone know how I can create Voronoi diagrams using FreeFEM++? Thanks for any advice or su…

---

## [The mesh imported from Gmsh into FreeFem++](https://community.freefem.org/t/the-mesh-imported-from-gmsh-into-freefem/3522)

<div class="topic-metadata">

**Author:** [@yongheng](https://community.freefem.org/u/yongheng)\
**Replies:** 0\
**Last updated:** [September 26, 2024, 7:55am UTC](https://community.freefem.org/t/the-mesh-imported-from-gmsh-into-freefem/3522 "2024-09-26T07:55:42Z")

</div>

“Why is it that the mesh I imported from Gmsh only manages to draw two surfaces, and when I use petsc for parallel processing, I get an error on line 106 with mpirank 0 / 2: Assertion fail: (ie == nbe) in file msh3.cpp?” …

---

## [Plot not working ubuntu 24.04](https://community.freefem.org/t/plot-not-working-ubuntu-24-04/3511)

<div class="topic-metadata">

**Author:** [@rcabrales](https://community.freefem.org/u/rcabrales)\
**Replies:** 2\
**Last updated:** [September 25, 2024, 12:59pm UTC](https://community.freefem.org/t/plot-not-working-ubuntu-24-04/3511 "2024-09-25T12:59:39Z")

</div>

Hello everyone, recently I update from ubuntu 22.04 to ubuntu 24.04 and the plot is not working, can i get some advice please. Kind regards Roberto Cabrales

---

## [SNES with Finite Difference Jacobian Approximations](https://community.freefem.org/t/snes-with-finite-difference-jacobian-approximations/3520)

<div class="topic-metadata">

**Author:** [@stergopilot](https://community.freefem.org/u/stergopilot)\
**Replies:** 0\
**Last updated:** [September 25, 2024, 12:26pm UTC](https://community.freefem.org/t/snes-with-finite-difference-jacobian-approximations/3520 "2024-09-25T12:26:29Z")

</div>

Dear all, I was wondering if we could use SNES to solve nonlinear PDEs with Finite Difference Jacobian Approximations. Are there any examples? It is not easy to compute Jacobian matrices analytically in my simulation. …

---

## [The phenomenon of taking a long time to create a matrix](https://community.freefem.org/t/the-phenomenon-of-taking-a-long-time-to-create-a-matrix/3502)

<div class="topic-metadata">

**Author:** [@yongheng](https://community.freefem.org/u/yongheng)\
**Replies:** 4\
**Last updated:** [September 23, 2024, 8:01pm UTC](https://community.freefem.org/t/the-phenomenon-of-taking-a-long-time-to-create-a-matrix/3502 "2024-09-23T20:01:12Z")

</div>

“When I use the PETSc database in FreeFem++ and encounter a long duration with the function call ‘MatCreate(Vh,A,P1)’, which shows ‘partition of unity build (in 3.259087e+03)’, is this a normal phenomenon?”

---

## [Error: div by 0](https://community.freefem.org/t/error-div-by-0/3508)

<div class="topic-metadata">

**Author:** [@yongheng](https://community.freefem.org/u/yongheng)\
**Replies:** 0\
**Last updated:** [September 21, 2024, 7:43am UTC](https://community.freefem.org/t/error-div-by-0/3508 "2024-09-21T07:43:58Z")

</div>

When I use A=Laplace(Vh,Vh); , I encounter a “Div by 0” error. Why is this happening? I am using a relatively complex mesh; could it be the cause of my mesh?

---

## [Crash During buildmesh Execution: Failure of try-catch and Impact of Additional Boundary](https://community.freefem.org/t/crash-during-buildmesh-execution-failure-of-try-catch-and-impact-of-additional-boundary/3491)

<div class="topic-metadata">

**Author:** [@MariamiMamgo](https://community.freefem.org/u/MariamiMamgo)\
**Replies:** 2\
**Last updated:** [September 20, 2024, 3:16pm UTC](https://community.freefem.org/t/crash-during-buildmesh-execution-failure-of-try-catch-and-impact-of-additional-boundary/3491 "2024-09-20T15:16:03Z")

</div>

Hello, I am experiencing an issue with my code, which I have attached for reference. The code consistently crashes during the execution of the buildmesh command. I tried to use the try-catch block, but it couldn’t catch…

---

## [How to define curvature on the boundary](https://community.freefem.org/t/how-to-define-curvature-on-the-boundary/3504)

<div class="topic-metadata">

**Author:** [@amirayh](https://community.freefem.org/u/amirayh)\
**Replies:** 0\
**Last updated:** [September 20, 2024, 1:48pm UTC](https://community.freefem.org/t/how-to-define-curvature-on-the-boundary/3504 "2024-09-20T13:48:13Z")

</div>

Hello, I have the following code in FreeFEM to compute the curvature on the boundary: Vh H = curvature(Th, 2); I know that H = div(n) where n is the normal of the boundary. However, I would like to better understand h…

---

## [The algorithm of distance](https://community.freefem.org/t/the-algorithm-of-distance/3501)

<div class="topic-metadata">

**Author:** [@wei](https://community.freefem.org/u/wei)\
**Replies:** 0\
**Last updated:** [September 20, 2024, 1:46pm UTC](https://community.freefem.org/t/the-algorithm-of-distance/3501 "2024-09-20T13:46:44Z")

</div>

Hello! Would please tell me the specific algorithm of “distance” in Freefem++?

---

## [Recommend a server](https://community.freefem.org/t/recommend-a-server/3495)

<div class="topic-metadata">

**Author:** [@weixj](https://community.freefem.org/u/weixj)\
**Replies:** 1\
**Last updated:** [September 20, 2024, 3:47am UTC](https://community.freefem.org/t/recommend-a-server/3495 "2024-09-20T03:47:03Z")

</div>

Hello everyone, I am currently using freefem++ to complete a 3D numerical simulation experiment, but I found that the 3D code requires a lot of memory to run, otherwise it will report an error. I don’t know how to use pa…

---

## [Formulation mixte sur FreeFem](https://community.freefem.org/t/formulation-mixte-sur-freefem/3488)

<div class="topic-metadata">

**Author:** [@daniel](https://community.freefem.org/u/daniel)\
**Replies:** 7\
**Last updated:** [September 18, 2024, 12:13pm UTC](https://community.freefem.org/t/formulation-mixte-sur-freefem/3488 "2024-09-18T12:13:06Z")

</div>

Bonjour les doyens, j’ai un sous sur comment procéder pour résoudre un problème de formulation mixte issu d’un problème de contrôle optimal d’une EPD linéaire. Cette formulation mixte dépend de deux variables que je cher…

---

## [BuildMesh Error](https://community.freefem.org/t/buildmesh-error/3485)

<div class="topic-metadata">

**Author:** [@MariamiMamgo](https://community.freefem.org/u/MariamiMamgo)\
**Replies:** 0\
**Last updated:** [September 13, 2024, 6:22am UTC](https://community.freefem.org/t/buildmesh-error/3485 "2024-09-13T06:22:21Z")

</div>

Hello, I’m encountering a problem when using the buildmesh function in FreeFem++, which is causing a bug during execution. Additionally, I tried to use a try-catch block to handle the error, but it doesn’t seem to work …

---

## [Try catch block](https://community.freefem.org/t/try-catch-block/3483)

<div class="topic-metadata">

**Author:** [@MariamiMamgo](https://community.freefem.org/u/MariamiMamgo)\
**Replies:** 0\
**Last updated:** [September 12, 2024, 8:08pm UTC](https://community.freefem.org/t/try-catch-block/3483 "2024-09-12T20:08:12Z")

</div>

Hello, I am currently attempting to implement a try-catch block. While it has worked in some instances, I am encountering an issue where it now causes the program to crash immediately. Could you provide any suggestions …

---

## [FSI problem with two fluids and a solid](https://community.freefem.org/t/fsi-problem-with-two-fluids-and-a-solid/3465)

<div class="topic-metadata">

**Author:** [@zoumpou](https://community.freefem.org/u/zoumpou)\
**Replies:** 1\
**Last updated:** [September 9, 2024, 10:04am UTC](https://community.freefem.org/t/fsi-problem-with-two-fluids-and-a-solid/3465 "2024-09-09T10:04:23Z")

</div>

// Load necessary FreeFem++ libraries load "msh3" load "medit" macro dimension 2() //EOM // Parameters real E = 20000; real sigma = 0.29; real gravity = -9.81; real coef = 0.2; real uMax= 10; real D=3; real rho = 1; rea…

---

## [Bug in saving vector field to txt?](https://community.freefem.org/t/bug-in-saving-vector-field-to-txt/3467)

<div class="topic-metadata">

**Author:** [@edmondztt](https://community.freefem.org/u/edmondztt)\
**Replies:** 4\
**Last updated:** [September 5, 2024, 6:20pm UTC](https://community.freefem.org/t/bug-in-saving-vector-field-to-txt/3467 "2024-09-05T18:20:20Z")

</div>

Hi, I’m trying to save the 2D vector field from Stokes problem. However, no matter how I do it u2 and u1 are exactly the same. Weirdly, plot(u1) and plot(u2) still show correctly different values. Here is my script: in…

---

## [Matrix-vector multiplication in weak formulation](https://community.freefem.org/t/matrix-vector-multiplication-in-weak-formulation/449)

<div class="topic-metadata">

**Author:** [@andryr](https://community.freefem.org/u/andryr)\
**Replies:** 51\
**Last updated:** [September 5, 2024, 1:03pm UTC](https://community.freefem.org/t/matrix-vector-multiplication-in-weak-formulation/449 "2024-09-05T13:03:51Z")

</div>

Hello everyone I am having issues trying to solve a problem that has a matrix-vector product in its weak formulation. I defined a macro epsilon as follows : macro epsilon(u1, u2) \[dx(u1), dy(u2), dy(u1)+dx(u2)\] // a…

---

## [Classes in FreeFEM++](https://community.freefem.org/t/classes-in-freefem/3464)

<div class="topic-metadata">

**Author:** [@MariamiMamgo](https://community.freefem.org/u/MariamiMamgo)\
**Replies:** 3\
**Last updated:** [September 5, 2024, 8:34am UTC](https://community.freefem.org/t/classes-in-freefem/3464 "2024-09-05T08:34:30Z")

</div>

Hello, I am new to FreeFEM++ and would like to organize my code using object-oriented principles by defining classes. Is there a mechanism within FreeFEM++ that supports the implementation of classes, or are there altern…

---

## [The Bearing lubrication problem code](https://community.freefem.org/t/the-bearing-lubrication-problem-code/3452)

<div class="topic-metadata">

**Author:** [@ozil101](https://community.freefem.org/u/ozil101)\
**Replies:** 1\
**Last updated:** [September 4, 2024, 9:34am UTC](https://community.freefem.org/t/the-bearing-lubrication-problem-code/3452 "2024-09-04T09:34:20Z")

</div>

Hi dear respected esteemed Profs. @fb77 and @frederichecht. I hope you all are doing well and enjoying a good time. My apologies for multiple inconvenience in posts. I am looking for a code that solve unsteady NSEs in …

---

## [Help with preconditionner](https://community.freefem.org/t/help-with-preconditionner/3462)

<div class="topic-metadata">

**Author:** [@Edgard](https://community.freefem.org/u/Edgard)\
**Replies:** 4\
**Last updated:** [September 3, 2024, 5:08am UTC](https://community.freefem.org/t/help-with-preconditionner/3462 "2024-09-03T05:08:12Z")

</div>

could someone help to use a preconditionner LU and solver GMRES on this three problems: problem Larva(L,v) = int2d(Th2D)(Lv/dt) - int2d(Th2D)(Lantv/dt) + int2d(Th2D)(DifLGrad(L)'Grad(v)) + int2d(Th2D)((velxdx(L) + ve…

[Previous page](https://community.freefem.org/c/general-discussion/7.md?page=14)

[Next page](https://community.freefem.org/c/general-discussion/7.md?page=16)
