# General Discussion

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

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

**Page:** 11

---

## [Do we have a vectorized random number generator?](https://community.freefem.org/t/do-we-have-a-vectorized-random-number-generator/1779)

<div class="topic-metadata">

**Author:** [@Jade](https://community.freefem.org/u/Jade)\
**Replies:** 8\
**Last updated:** [March 26, 2025, 2:47pm UTC](https://community.freefem.org/t/do-we-have-a-vectorized-random-number-generator/1779 "2025-03-26T14:47:35Z")

</div>

For my model problem I need a P0 function with Gaussian random values on each triangle. So I use the code: fespace Nh(Th, P0); Nh dW; for (int j=0; j\<Th.nt; ++j) { dw\[\]\[j\] = gslrangaussian(ffrng, 1.0); } This is i…

---

## [Importing Gmsh Mesh into FreeFem++](https://community.freefem.org/t/importing-gmsh-mesh-into-freefem/3819)

<div class="topic-metadata">

**Author:** [@goutham2023](https://community.freefem.org/u/goutham2023)\
**Replies:** 1\
**Last updated:** [March 26, 2025, 12:30pm UTC](https://community.freefem.org/t/importing-gmsh-mesh-into-freefem/3819 "2025-03-26T12:30:18Z")

</div>

Dear FreeFem Team, I am encountering difficulties importing a mesh file from Gmsh into FreeFem++. I have attached a pdf file containing .msh file, which was exported in ASCII Version 4 format. I also attempted exporti…

---

## [Getting errors in adaptive finite element FF++ code of Heat equation](https://community.freefem.org/t/getting-errors-in-adaptive-finite-element-ff-code-of-heat-equation/3814)

<div class="topic-metadata">

**Author:** [@Monirul25](https://community.freefem.org/u/Monirul25)\
**Replies:** 1\
**Last updated:** [March 26, 2025, 8:12am UTC](https://community.freefem.org/t/getting-errors-in-adaptive-finite-element-ff-code-of-heat-equation/3814 "2025-03-26T08:12:35Z")

</div>

Dear all experts, i am getting errors in adaptive finite element FF++ code of Heat equation. Here, is my code\> Heat\_adapt.edp (5.5 KB) Here, is the error\> Error in the def of sub domain 0 form border 4/4: Bad se…

---

## [Domain dependent parameter](https://community.freefem.org/t/domain-dependent-parameter/3817)

<div class="topic-metadata">

**Author:** [@Hemanta822](https://community.freefem.org/u/Hemanta822)\
**Replies:** 2\
**Last updated:** [March 21, 2025, 5:19pm UTC](https://community.freefem.org/t/domain-dependent-parameter/3817 "2025-03-21T17:19:14Z")

</div>

Hi All, I was trying to impose domain dependent parameter. I have domain \[0,2\]\\times\[0,2\] and a subdomain \[0,1\]\\times\[0,1\]. I want to use nu = 20 in my subdomain (INCLUDING BOUNDARY WHERE x = 1 or y = 1) and use nu = 10 …

---

## [Poiseuille Flow Test with Extra Stress Tensor: Fatal error in Convect (R2) operator: loop =\> velocity too high ? or NaN F. Hecht](https://community.freefem.org/t/poiseuille-flow-test-with-extra-stress-tensor-fatal-error-in-convect-r2-operator-loop-velocity-too-high-or-nan-f-hecht/3810)

<div class="topic-metadata">

**Author:** [@ozil101](https://community.freefem.org/u/ozil101)\
**Replies:** 2\
**Last updated:** [March 17, 2025, 8:28pm UTC](https://community.freefem.org/t/poiseuille-flow-test-with-extra-stress-tensor-fatal-error-in-convect-r2-operator-loop-velocity-too-high-or-nan-f-hecht/3810 "2025-03-17T20:28:37Z")

</div>

Dear respected Prof @fb77 thank you so much for the enormous help you give on this platform for all of us. Here again I face some issue with my code for Poiseuille Flow Test as following: I am solving micropolarpolar fl…

---

## [Applying Torque or Moment Forces in Elasticity PDEs in FreeFEM](https://community.freefem.org/t/applying-torque-or-moment-forces-in-elasticity-pdes-in-freefem/3813)

<div class="topic-metadata">

**Author:** [@zcwang6](https://community.freefem.org/u/zcwang6)\
**Replies:** 0\
**Last updated:** [March 17, 2025, 4:36pm UTC](https://community.freefem.org/t/applying-torque-or-moment-forces-in-elasticity-pdes-in-freefem/3813 "2025-03-17T16:36:48Z")

</div>

Dear FreeFEM Team, I hope you are doing well. I am currently working on solving elasticity PDEs in FreeFEM and would like to understand how to apply torque (moment force) within the formulation. Specifically, I am look…

---

## [Boundary condition setup issues in parallel computing](https://community.freefem.org/t/boundary-condition-setup-issues-in-parallel-computing/3799)

<div class="topic-metadata">

**Author:** [@DieyuRin](https://community.freefem.org/u/DieyuRin)\
**Replies:** 3\
**Last updated:** [March 14, 2025, 9:06am UTC](https://community.freefem.org/t/boundary-condition-setup-issues-in-parallel-computing/3799 "2025-03-14T09:06:56Z")

</div>

I am attempting to use a parallel approach for Picard iteration to solve lid-driven cavity flow, but the program runs correctly with a single core and produces errors when using multiple cores. I suspect it may be an iss…

---

## [Undesired elements inside the region during meshing](https://community.freefem.org/t/undesired-elements-inside-the-region-during-meshing/3789)

<div class="topic-metadata">

**Author:** [@elluc20](https://community.freefem.org/u/elluc20)\
**Replies:** 7\
**Last updated:** [March 13, 2025, 10:58am UTC](https://community.freefem.org/t/undesired-elements-inside-the-region-during-meshing/3789 "2025-03-13T10:58:10Z")

</div>

Dear all, I’m having trouble with meshing. I’m trying to mesh a region that has a hole inside, but instead, I’m getting elements in yellow within that region. I want no elements in that area. How can I fix this? int…

---

## [SLEPc convergence and error](https://community.freefem.org/t/slepc-convergence-and-error/1617)

<div class="topic-metadata">

**Author:** [@aszaboa](https://community.freefem.org/u/aszaboa)\
**Replies:** 20\
**Last updated:** [March 12, 2025, 8:05pm UTC](https://community.freefem.org/t/slepc-convergence-and-error/1617 "2025-03-12T20:05:20Z")

</div>

Dear FreeFem users, I am using FreeFem to solve Polynomial EVP with SLEPc PEPSolve. When I use the option -pep\_monitor\_all, the program displays more eigenvalues than the converged ones. As an example, when running the…

---

## [Position d'une plaque](https://community.freefem.org/t/position-dune-plaque/3797)

<div class="topic-metadata">

**Author:** [@aweni](https://community.freefem.org/u/aweni)\
**Replies:** 0\
**Last updated:** [March 8, 2025, 8:08am UTC](https://community.freefem.org/t/position-dune-plaque/3797 "2025-03-08T08:08:46Z")

</div>

Bonjour à tous. Je voudrais savoir comment avoir des données qui permettent de représenter en animation les différentes positions d’une plaque . Merci d’avance.

---

## [Error in a nonlinear simulation in parallel, using domain decomposition](https://community.freefem.org/t/error-in-a-nonlinear-simulation-in-parallel-using-domain-decomposition/3791)

<div class="topic-metadata">

**Author:** [@clayrc](https://community.freefem.org/u/clayrc)\
**Replies:** 10\
**Last updated:** [March 6, 2025, 7:56pm UTC](https://community.freefem.org/t/error-in-a-nonlinear-simulation-in-parallel-using-domain-decomposition/3791 "2025-03-06T19:56:36Z")

</div>

I am solving a nonlinear unsteady hygro-thermal model with non-homogenous boundary condition using the “macro\_ddm.idp” framework. The PDE are given in Exploring Historical Perspectives in Building Hygrothermal Models: …

---

## [Importing Mesh from COMSOL](https://community.freefem.org/t/importing-mesh-from-comsol/2968)

<div class="topic-metadata">

**Author:** [@MehranK1](https://community.freefem.org/u/MehranK1)\
**Replies:** 11\
**Last updated:** [March 5, 2025, 4:12pm UTC](https://community.freefem.org/t/importing-mesh-from-comsol/2968 "2025-03-05T16:12:55Z")

</div>

Has anyone extracted a mesh from COMSOL and imported it into FreeFem? I am exporting a 2d mesh from COMSOL. There are different formats that I can extract. I extract and tried all of them, but I cannot import it into Fr…

---

## [Interpolate from Mesh to arbitrary point](https://community.freefem.org/t/interpolate-from-mesh-to-arbitrary-point/3776)

<div class="topic-metadata">

**Author:** [@fem280w2](https://community.freefem.org/u/fem280w2)\
**Replies:** 6\
**Last updated:** [March 4, 2025, 1:14pm UTC](https://community.freefem.org/t/interpolate-from-mesh-to-arbitrary-point/3776 "2025-03-04T13:14:58Z")

</div>

Dear All, I apologize for being new to this software package. We would like to calculate particle trajectories and for this purpose we need to interpolate from a given mesh to an arbitrary, given point. I found various …

---

## [Integrating Nonlinear Terms](https://community.freefem.org/t/integrating-nonlinear-terms/3642)

<div class="topic-metadata">

**Author:** [@QZH\_xia](https://community.freefem.org/u/QZH_xia)\
**Replies:** 9\
**Last updated:** [March 2, 2025, 7:12am UTC](https://community.freefem.org/t/integrating-nonlinear-terms/3642 "2025-03-02T07:12:42Z")

</div>

Hello, I am learning to write FreeFem code for the Cahn-Hilliard equation with Neumann boundary conditions. I have simplified one of the nonlinear terms, but it seems that the int2d function requires a bilinear form. I …

---

## [Oldroyd-B model freefem++ code bugs and issues: Assertion fail](https://community.freefem.org/t/oldroyd-b-model-freefem-code-bugs-and-issues-assertion-fail/3767)

<div class="topic-metadata">

**Author:** [@ozil101](https://community.freefem.org/u/ozil101)\
**Replies:** 7\
**Last updated:** [February 28, 2025, 5:17pm UTC](https://community.freefem.org/t/oldroyd-b-model-freefem-code-bugs-and-issues-assertion-fail/3767 "2025-02-28T17:17:17Z")

</div>

Hi all, I built up a code for 2D bearing lubrication problem, I adjusted all the parameters & conditions into the standard ones of this benchmark problem, however I always get this issue: { 139 : } sizestack + 1024 =2…

---

## [Newbie question, how to solve this simple ODE with ff++?](https://community.freefem.org/t/newbie-question-how-to-solve-this-simple-ode-with-ff/3786)

<div class="topic-metadata">

**Author:** [@oldoldman](https://community.freefem.org/u/oldoldman)\
**Replies:** 2\
**Last updated:** [March 1, 2025, 1:45am UTC](https://community.freefem.org/t/newbie-question-how-to-solve-this-simple-ode-with-ff/3786 "2025-03-01T01:45:08Z")

</div>

Hi guys, I’m trying to solve this ODE u''=6x u(0)=0 with following script /\* u''=6x u(0)=0 \*/ border b(i=0,1) { x=i; y=0; } meshL Sh=buildmeshL(b(50)); fespace Vh(Sh,P1); Vh u,v; func f = 6\*x; func real ue(int i…

---

## [Issue with Parallel Computation in FreeFEM++ for Solving a PDE](https://community.freefem.org/t/issue-with-parallel-computation-in-freefem-for-solving-a-pde/3782)

<div class="topic-metadata">

**Author:** [@7420029](https://community.freefem.org/u/7420029)\
**Replies:** 4\
**Last updated:** [February 28, 2025, 10:08am UTC](https://community.freefem.org/t/issue-with-parallel-computation-in-freefem-for-solving-a-pde/3782 "2025-02-28T10:08:21Z")

</div>

Hello everyone! I am new to FreeFEM++ and I am working on solving the following partial differential equation (PDE): x^2 (1 - x - y)^2 \\frac{\\partial^2 f}{\\partial x^2} + (\\beta (1 - x - y)-1) x \\frac{\\partial f}{\\parti…

---

## [Domain dependent parameters in elasticity](https://community.freefem.org/t/domain-dependent-parameters-in-elasticity/3759)

<div class="topic-metadata">

**Author:** [@Hemanta822](https://community.freefem.org/u/Hemanta822)\
**Replies:** 10\
**Last updated:** [February 27, 2025, 2:11am UTC](https://community.freefem.org/t/domain-dependent-parameters-in-elasticity/3759 "2025-02-27T02:11:37Z")

</div>

Hi All, I want to implement elasticity in domain \[0,1\]\*\[0,1\] with known analytical solution, and I want to use different values of lambda and nu, in different halves of the domain and I tried it as follows: real nu1 = …

---

## [SNES with multigrid for the Jacobian](https://community.freefem.org/t/snes-with-multigrid-for-the-jacobian/3774)

<div class="topic-metadata">

**Author:** [@aszaboa](https://community.freefem.org/u/aszaboa)\
**Replies:** 12\
**Last updated:** [February 26, 2025, 6:54pm UTC](https://community.freefem.org/t/snes-with-multigrid-for-the-jacobian/3774 "2025-02-26T18:54:59Z")

</div>

Hello Everyone, I am trying to implement a PETSc simple multigrid method for inverting the Jacobian in SNES. However, even after examining the available examples, I am struggling to figure this out. I am attaching an M…

---

## [Getting not optimal results in parabolic integro-differential equation](https://community.freefem.org/t/getting-not-optimal-results-in-parabolic-integro-differential-equation/3771)

<div class="topic-metadata">

**Author:** [@Monirul25](https://community.freefem.org/u/Monirul25)\
**Replies:** 2\
**Last updated:** [February 26, 2025, 4:48pm UTC](https://community.freefem.org/t/getting-not-optimal-results-in-parabolic-integro-differential-equation/3771 "2025-02-26T16:48:57Z")

</div>

Dear all experts and Respected Francois sir, Hecht sir, i am currently trying the following problem: Parabolic\_integro\_eqn.pdf (121.7 KB) Here, is my code \> Integro\_Parabolic\_P1.edp (3.0 KB) Code is running fin…

---

## [Modified Weak Galerkin of Heat equation in 2D](https://community.freefem.org/t/modified-weak-galerkin-of-heat-equation-in-2d/3773)

<div class="topic-metadata">

**Author:** [@Monirul25](https://community.freefem.org/u/Monirul25)\
**Replies:** 2\
**Last updated:** [February 26, 2025, 2:16pm UTC](https://community.freefem.org/t/modified-weak-galerkin-of-heat-equation-in-2d/3773 "2025-02-26T14:16:26Z")

</div>

Dear all experts, Respected Francois Sir, and Respected Hecht sir, I have tried to implement modified weak Galerkin in the heat equation 2D FF++ code using the poisson equation modified weak Galerkin code . I…

---

## [Can it possible to find L^2-error and order of convergence in Heat-3d PETSc code (parrallel computing)](https://community.freefem.org/t/can-it-possible-to-find-l-2-error-and-order-of-convergence-in-heat-3d-petsc-code-parrallel-computing/3766)

<div class="topic-metadata">

**Author:** [@Monirul25](https://community.freefem.org/u/Monirul25)\
**Replies:** 9\
**Last updated:** [February 26, 2025, 11:58am UTC](https://community.freefem.org/t/can-it-possible-to-find-l-2-error-and-order-of-convergence-in-heat-3d-petsc-code-parrallel-computing/3766 "2025-02-26T11:58:09Z")

</div>

Respected prj sir, i have run heat-3d petsc code in window commant promt. But i wondering why plot command does not is giving plot in command promt. heat-3d.edp (5.0 KB) Blockquote plotMPI(Th, u, Pk, def, real, cm…

---

## [Imposed Dirichlet condition on labelled surfaces](https://community.freefem.org/t/imposed-dirichlet-condition-on-labelled-surfaces/3761)

<div class="topic-metadata">

**Author:** [@dominiquebodin](https://community.freefem.org/u/dominiquebodin)\
**Replies:** 5\
**Last updated:** [February 26, 2025, 10:49am UTC](https://community.freefem.org/t/imposed-dirichlet-condition-on-labelled-surfaces/3761 "2025-02-26T10:49:39Z")

</div>

Dear all, considering the " Newton Method for the Steady Navier-Stokes equations" example below: https://doc.freefem.org/tutorials/navierStokesNewton.html I’m wondering how to impose velocities on labelled surfaces if…

---

## [Nedelec elements degree 1, kind 1](https://community.freefem.org/t/nedelec-elements-degree-1-kind-1/2346)

<div class="topic-metadata">

**Author:** [@smyrback](https://community.freefem.org/u/smyrback)\
**Replies:** 6\
**Last updated:** [February 26, 2025, 9:01am UTC](https://community.freefem.org/t/nedelec-elements-degree-1-kind-1/2346 "2025-02-26T09:01:11Z")

</div>

I am trying to implement a method for solving Maxwell’s time-harmonic equations in 3D using the Nedelec elements of degree 1 and kind 1 (DefElement: Nédélec (first kind)). However, in the source code, it seems like only …

---

## [Enforced displacement, roller boundary, and then a periodic boundary conditions](https://community.freefem.org/t/enforced-displacement-roller-boundary-and-then-a-periodic-boundary-conditions/3753)

<div class="topic-metadata">

**Author:** [@Ayataka](https://community.freefem.org/u/Ayataka)\
**Replies:** 3\
**Last updated:** [February 25, 2025, 9:21am UTC](https://community.freefem.org/t/enforced-displacement-roller-boundary-and-then-a-periodic-boundary-conditions/3753 "2025-02-25T09:21:32Z")

</div>

Hello FF++ developers and users I’d like to calculate the deformations of a square composite structure subjected to uniaxial tension at an angle of 45°. Assuming that the square composite structure is symmetrical verti…

---

## [Error in Adapt function](https://community.freefem.org/t/error-in-adapt-function/3756)

<div class="topic-metadata">

**Author:** [@goutham2023](https://community.freefem.org/u/goutham2023)\
**Replies:** 1\
**Last updated:** [February 24, 2025, 12:33pm UTC](https://community.freefem.org/t/error-in-adapt-function/3756 "2025-02-24T12:33:13Z")

</div>

Hi FF++ users, I am trying to implement a material removal problem with mesh movement. However, after running for some time, I encounter a Bamg error when using the adaptmesh command. I have shared a picture of the erro…

---

## [Plot label 1D mesh in FreeFem](https://community.freefem.org/t/plot-label-1d-mesh-in-freefem/3760)

<div class="topic-metadata">

**Author:** [@natasha](https://community.freefem.org/u/natasha)\
**Replies:** 1\
**Last updated:** [February 20, 2025, 6:54pm UTC](https://community.freefem.org/t/plot-label-1d-mesh-in-freefem/3760 "2025-02-20T18:54:31Z")

</div>

What to add into my code lines to add a numerical scale, colours and labels onto my plot? for (real t=dt; t \<= T; t+dt){ EB; uOld = u; utOld = ut; meshL Thrj = movemesh(Th, \[x, 0, u\]); plot(Th, Thrj); }

---

## [How to plot the pressure distribution on the boundary](https://community.freefem.org/t/how-to-plot-the-pressure-distribution-on-the-boundary/2594)

<div class="topic-metadata">

**Author:** [@jawahar264](https://community.freefem.org/u/jawahar264)\
**Replies:** 7\
**Last updated:** [February 18, 2025, 7:59am UTC](https://community.freefem.org/t/how-to-plot-the-pressure-distribution-on-the-boundary/2594 "2025-02-18T07:59:44Z")

</div>

For example for an airfoil after computing the pressure distribution in the domain i want only the data on the airfoil how can i plot it?

---

## [Error using meshL, segment, msh3](https://community.freefem.org/t/error-using-meshl-segment-msh3/3745)

<div class="topic-metadata">

**Author:** [@natasha](https://community.freefem.org/u/natasha)\
**Replies:** 2\
**Last updated:** [February 17, 2025, 9:42pm UTC](https://community.freefem.org/t/error-using-meshl-segment-msh3/3745 "2025-02-17T21:42:14Z")

</div>

When trying to integrate on an interval using int1D, I get the following error message because meshL command doesn’t work even with load “msh3”, load “medit”. meshL The Identifier meshL does not exist How to properly …

---

## [Difference between .vtu output file and the values from FreeFEM for a Stokes problem](https://community.freefem.org/t/difference-between-vtu-output-file-and-the-values-from-freefem-for-a-stokes-problem/3755)

<div class="topic-metadata">

**Author:** [@Pwaroquier](https://community.freefem.org/u/Pwaroquier)\
**Replies:** 0\
**Last updated:** [February 17, 2025, 9:52am UTC](https://community.freefem.org/t/difference-between-vtu-output-file-and-the-values-from-freefem-for-a-stokes-problem/3755 "2025-02-17T09:52:23Z")

</div>

Dear all, I am working on a Stokes problem and I found out that my velocity field on Paraview was not the same that the solution I got from FreeFEM. You can see below the difference between my correct field and the valu…

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

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