# General Discussion

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

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

**Page:** 4

---

## [Equivalent of emptymesh in 3D](https://community.freefem.org/t/equivalent-of-emptymesh-in-3d/4171)

<div class="topic-metadata">

**Author:** [@pi.3.141](https://community.freefem.org/u/pi.3.141)\
**Replies:** 0\
**Last updated:** [December 28, 2025, 4:50pm UTC](https://community.freefem.org/t/equivalent-of-emptymesh-in-3d/4171 "2025-12-28T16:50:57Z")

</div>

Hello Freefemers, Emptymesh command is very useful to handle boundary values in 2D. For example mesh Th=square(10,10); fespace Vh(Th, P1); Uh u, uh; mesh Thb=emptymesh(Th); fespace Uhb(Thb, P1); Uhb ud=x, …

---

## [Error on https://doc.freefem.org/documentation/finite-element.html](https://community.freefem.org/t/error-on-https-doc-freefem-org-documentation-finite-element-html/4161)

<div class="topic-metadata">

**Author:** [@MBK](https://community.freefem.org/u/MBK)\
**Replies:** 1\
**Last updated:** [December 23, 2025, 4:12am UTC](https://community.freefem.org/t/error-on-https-doc-freefem-org-documentation-finite-element-html/4161 "2025-12-23T04:12:54Z")

</div>

Hi! On at or in \[P4dc\] definition there should be P\_4 instead of P\_3 and 4 instead 3 before sentence-end. Greetings

---

## [Region assignment](https://community.freefem.org/t/region-assignment/4149)

<div class="topic-metadata">

**Author:** [@Shyam](https://community.freefem.org/u/Shyam)\
**Replies:** 1\
**Last updated:** [December 12, 2025, 12:38pm UTC](https://community.freefem.org/t/region-assignment/4149 "2025-12-12T12:38:15Z")

</div>

Hello all, I am working wth a particular special geometry for my problem. I glued two bodies with a simple ‘mesh3 body1 + body2;‘ command. However, I now want to identify these two bodies as two different regions. How d…

---

## [Plot u vs x for fixed t and y](https://community.freefem.org/t/plot-u-vs-x-for-fixed-t-and-y/4152)

<div class="topic-metadata">

**Author:** [@ahmed2018](https://community.freefem.org/u/ahmed2018)\
**Replies:** 0\
**Last updated:** [December 11, 2025, 2:10pm UTC](https://community.freefem.org/t/plot-u-vs-x-for-fixed-t-and-y/4152 "2025-12-11T14:10:06Z")

</div>

In this runnable code, I want to either plot u versus x for a fixed y and time t, or extract the u vs x data. What should I add to this code to achieve that? // thermal\_convection.edp // // Discussion: // // Fo…

---

## [Spatial stability analysis for compressible jet flow](https://community.freefem.org/t/spatial-stability-analysis-for-compressible-jet-flow/4151)

<div class="topic-metadata">

**Author:** [@Kumar](https://community.freefem.org/u/Kumar)\
**Replies:** 0\
**Last updated:** [December 11, 2025, 1:57pm UTC](https://community.freefem.org/t/spatial-stability-analysis-for-compressible-jet-flow/4151 "2025-12-11T13:57:01Z")

</div>

Hi all, I am working on spatial stability analysis of 1D jet flow in a polar coordinate system. I am trying to validate the growth rate plot from this Linear and nonlinear mechanisms of sound radiation by instability …

---

## [Define the inflow and outflow on interior boundaries](https://community.freefem.org/t/define-the-inflow-and-outflow-on-interior-boundaries/4145)

<div class="topic-metadata">

**Author:** [@LXX](https://community.freefem.org/u/LXX)\
**Replies:** 6\
**Last updated:** [December 11, 2025, 1:19pm UTC](https://community.freefem.org/t/define-the-inflow-and-outflow-on-interior-boundaries/4145 "2025-12-11T13:19:10Z")

</div>

Hello everyone, I’m trying to implement an upwind DG scheme, but this requires defining the inflow and outflow on the interior boundaries, and I don’t know how to represent them. This has been bothering me for a long tim…

---

## [Eigenvalue problem with a mesh-independent input space](https://community.freefem.org/t/eigenvalue-problem-with-a-mesh-independent-input-space/4147)

<div class="topic-metadata">

**Author:** [@aszaboa](https://community.freefem.org/u/aszaboa)\
**Replies:** 5\
**Last updated:** [December 10, 2025, 4:56pm UTC](https://community.freefem.org/t/eigenvalue-problem-with-a-mesh-independent-input-space/4147 "2025-12-10T16:56:33Z")

</div>

Hello everyone, I would like to solve an eigenvalue problem in the form of sigma^2 B x = A x using PETSc The matrices A and B are symmetric and positive definite. The catch is that I would like the vector ‘x’ be indepe…

---

## [Fix/Pin nodes as boundary condition](https://community.freefem.org/t/fix-pin-nodes-as-boundary-condition/1596)

<div class="topic-metadata">

**Author:** [@Yvan](https://community.freefem.org/u/Yvan)\
**Replies:** 9\
**Last updated:** [December 9, 2025, 11:28am UTC](https://community.freefem.org/t/fix-pin-nodes-as-boundary-condition/1596 "2025-12-09T11:28:25Z")

</div>

Hello, I would like to know if it is possible to pin nodes (instead of surfaces) as boundary conditions to solve thermoelasticity problems. I want to get the geometric distorsion of the part from the thermal shrinkage.…

---

## [Calculate the rank of a 10\*10 matrix to find whether it is rank deficient](https://community.freefem.org/t/calculate-the-rank-of-a-10-10-matrix-to-find-whether-it-is-rank-deficient/4144)

<div class="topic-metadata">

**Author:** [@MatrixVector](https://community.freefem.org/u/MatrixVector)\
**Replies:** 1\
**Last updated:** [December 1, 2025, 1:48pm UTC](https://community.freefem.org/t/calculate-the-rank-of-a-10-10-matrix-to-find-whether-it-is-rank-deficient/4144 "2025-12-01T13:48:51Z")

</div>

Is it possible using FreeFem++ to calculate the rank of a 10\*10 matrix? I’m dealing with a least-square fitting problem in 3D, and a piece of code is about: check whether the rank of a 10\*10 matrix is equal to 10. If so…

---

## [Basis function/shape function of P2 triangular & tetrahedral element](https://community.freefem.org/t/basis-function-shape-function-of-p2-triangular-tetrahedral-element/4140)

<div class="topic-metadata">

**Author:** [@MatrixVector](https://community.freefem.org/u/MatrixVector)\
**Replies:** 0\
**Last updated:** [November 24, 2025, 2:24am UTC](https://community.freefem.org/t/basis-function-shape-function-of-p2-triangular-tetrahedral-element/4140 "2025-11-24T02:24:01Z")

</div>

I’m doing a postprocessing work which needs to calculate the Gauss integration points’ Cartesian coordinates. One way to implement this is substituting the Gauss coordinates into the basis functions or shape functions, a…

---

## [FSI problem with SLEPc](https://community.freefem.org/t/fsi-problem-with-slepc/4138)

<div class="topic-metadata">

**Author:** [@quentin](https://community.freefem.org/u/quentin)\
**Replies:** 6\
**Last updated:** [November 21, 2025, 12:59pm UTC](https://community.freefem.org/t/fsi-problem-with-slepc/4138 "2025-11-21T12:59:01Z")

</div>

@prj Thanks to your guidance, I’ve completed the initial version of my code. However, I’m facing some persistent issues with its robustness: The script isn’t robust enough, it works with -n 4 but fails with -n 6 , and …

---

## [Error in Newton-Raphson Incremental Iteration](https://community.freefem.org/t/error-in-newton-raphson-incremental-iteration/4137)

<div class="topic-metadata">

**Author:** [@AlexanderJFDR](https://community.freefem.org/u/AlexanderJFDR)\
**Replies:** 2\
**Last updated:** [November 20, 2025, 4:19pm UTC](https://community.freefem.org/t/error-in-newton-raphson-incremental-iteration/4137 "2025-11-20T16:19:15Z")

</div>

Hi, I am trying to use FreeFem++ to solve plasticity mechanics problems using an incremental iterative approach, with the specific code documentation being: test.edp (15.6 KB) tension.zip (307.4 KB) (it’s the mesh fil…

---

## [Question about parmmg](https://community.freefem.org/t/question-about-parmmg/4139)

<div class="topic-metadata">

**Author:** [@zxss](https://community.freefem.org/u/zxss)\
**Replies:** 0\
**Last updated:** [November 20, 2025, 4:03pm UTC](https://community.freefem.org/t/question-about-parmmg/4139 "2025-11-20T16:03:40Z")

</div>

Dear all, I implemented the 3D L shape Possion equation with parmmg for adaptation after watching this tutorial https://www.youtube.com/watch?v=W08n2FqyFdc&t=9882s. I implemented parmmg with both global mesh and distri…

---

## [Several Lagrange mutiplier using fieldsplit](https://community.freefem.org/t/several-lagrange-mutiplier-using-fieldsplit/4130)

<div class="topic-metadata">

**Author:** [@smori](https://community.freefem.org/u/smori)\
**Replies:** 18\
**Last updated:** [November 17, 2025, 2:30pm UTC](https://community.freefem.org/t/several-lagrange-mutiplier-using-fieldsplit/4130 "2025-11-17T14:30:27Z")

</div>

Hello Freefem user, I’m studying the following system : Mat NN = \[\[ A , pBEx,pBEy,pBEz,pBMx,pBMy,pBMz \], \[ pBEx’,-1/kt,0,0,0,0,0 \], \[ pBEy’,0,-1/kt,0,0,0,0 \], \[ pBEz’,0,0,-1/ka,0,0,0 \], \[ pBMx’,0,0,0,-1/kf,0,0 …

---

## [CO2 concentration in a sheet of water](https://community.freefem.org/t/co2-concentration-in-a-sheet-of-water/4136)

<div class="topic-metadata">

**Author:** [@llober](https://community.freefem.org/u/llober)\
**Replies:** 0\
**Last updated:** [November 17, 2025, 2:22pm UTC](https://community.freefem.org/t/co2-concentration-in-a-sheet-of-water/4136 "2025-11-17T14:22:08Z")

</div>

I want to determine the CO2 concentration in a sheet of water contained within a rectangular container measuring 30 m by 60 m, with a surface area of 1,800 m². The water level height is 40 cm. The water surface is in dir…

---

## [Divergence-free condition on boundary](https://community.freefem.org/t/divergence-free-condition-on-boundary/4135)

<div class="topic-metadata">

**Author:** [@LXX](https://community.freefem.org/u/LXX)\
**Replies:** 4\
**Last updated:** [November 16, 2025, 12:01pm UTC](https://community.freefem.org/t/divergence-free-condition-on-boundary/4135 "2025-11-16T12:01:45Z")

</div>

Hello everyone, I have a question about boundary conditions. I want to solve the incompressible MHD equations, as follows: For the magnetic field, the boundary conditions I chose are: \\mathbf{B}\\times\\mathbf{n}|\_{\\p…

---

## [Node numbering of a refined mesh (truncated with split = 2) for P2 elements post-processing](https://community.freefem.org/t/node-numbering-of-a-refined-mesh-truncated-with-split-2-for-p2-elements-post-processing/4132)

<div class="topic-metadata">

**Author:** [@MatrixVector](https://community.freefem.org/u/MatrixVector)\
**Replies:** 5\
**Last updated:** [November 14, 2025, 10:12am UTC](https://community.freefem.org/t/node-numbering-of-a-refined-mesh-truncated-with-split-2-for-p2-elements-post-processing/4132 "2025-11-14T10:12:15Z")

</div>

I’m doing a post-processing work which outputs the node values of a 2D P2 element using VTK. Since Freefem++ currently doesn’t support outputing the P2 elements (VTK order = 2) directly, one possible way is to first refi…

---

## [Is it possible to directly merge the dispatched meshes into a whole mesh](https://community.freefem.org/t/is-it-possible-to-directly-merge-the-dispatched-meshes-into-a-whole-mesh/4133)

<div class="topic-metadata">

**Author:** [@zxss](https://community.freefem.org/u/zxss)\
**Replies:** 9\
**Last updated:** [November 13, 2025, 3:53pm UTC](https://community.freefem.org/t/is-it-possible-to-directly-merge-the-dispatched-meshes-into-a-whole-mesh/4133 "2025-11-13T15:53:17Z")

</div>

Dear all, I know that if we need the information of global mesh after DmeshCreate(Th), we need to save the global mesh as a backup in advance. I just wonder if it is possible to directly merge the dispatched mesh into …

---

## [Building RHS block vector manually](https://community.freefem.org/t/building-rhs-block-vector-manually/4131)

<div class="topic-metadata">

**Author:** [@gart1542](https://community.freefem.org/u/gart1542)\
**Replies:** 8\
**Last updated:** [November 12, 2025, 8:29pm UTC](https://community.freefem.org/t/building-rhs-block-vector-manually/4131 "2025-11-12T20:29:37Z")

</div>

Hello all, I have the following weak formulations: varf Lhs(\[dc, dmu\], \[v, psi\]) = int2d(Th)((1/chi^2)\\\*(tau\\\*eps\\\*((dx(dmu))\\\*(dx(v)) + (dy(dmu))\\\*(dy(v)))) + dc\\\*v ) + int2d(Th)( dmu\\\*psi - (chi^2)\\\*(3./eps)\\\*…

---

## [How to decompose a mesh of huge size effectively?](https://community.freefem.org/t/how-to-decompose-a-mesh-of-huge-size-effectively/4126)

<div class="topic-metadata">

**Author:** [@lzjqingao](https://community.freefem.org/u/lzjqingao)\
**Replies:** 7\
**Last updated:** [November 10, 2025, 12:53pm UTC](https://community.freefem.org/t/how-to-decompose-a-mesh-of-huge-size-effectively/4126 "2025-11-10T12:53:41Z")

</div>

Hi FreeFem Community, I am working on a code to decompose a 3D mesh by calling FFDDM. The mesh was generated with Gmsh, and has about 46 million elements. The code is running on the HPC of our Lab, and each node has 1T …

---

## [Linear solve did not converge due to DIVERGED\_NANORINF iterations](https://community.freefem.org/t/linear-solve-did-not-converge-due-to-diverged-nanorinf-iterations/4127)

<div class="topic-metadata">

**Author:** [@zxss](https://community.freefem.org/u/zxss)\
**Replies:** 4\
**Last updated:** [November 9, 2025, 12:55pm UTC](https://community.freefem.org/t/linear-solve-did-not-converge-due-to-diverged-nanorinf-iterations/4127 "2025-11-09T12:55:04Z")

</div>

Hi, I am now implementing 2D fluid structure interaction in parallel. I try to simulate a benchmark: oscillating flag. Here is the code ParallelOscillatingFlag.edp (5.8 KB) It works well when I use more than 2 proces…

---

## [Mesh smoothing after elements removal. Failure zone propagation](https://community.freefem.org/t/mesh-smoothing-after-elements-removal-failure-zone-propagation/4128)

<div class="topic-metadata">

**Author:** [@toriyamatokanawa](https://community.freefem.org/u/toriyamatokanawa)\
**Replies:** 0\
**Last updated:** [November 7, 2025, 8:50am UTC](https://community.freefem.org/t/mesh-smoothing-after-elements-removal-failure-zone-propagation/4128 "2025-11-07T08:50:29Z")

</div>

I’m simulating the hole failure under external stress state via Mohr-Coulomb failure criterion. I remove the mesh cells which cannot withstand the failure criterion. I have written a loop to observe how the failure would…

---

## [Split Function/Accessing components](https://community.freefem.org/t/split-function-accessing-components/4124)

<div class="topic-metadata">

**Author:** [@gart1542](https://community.freefem.org/u/gart1542)\
**Replies:** 1\
**Last updated:** [November 5, 2025, 6:15pm UTC](https://community.freefem.org/t/split-function-accessing-components/4124 "2025-11-05T18:15:31Z")

</div>

Hi all, I am working on a code to solve the Cahn-Hilliard equation, and I am having trouble trying to split the solution function u into its phi and mu components for updating the Newton loop. I have the mesh and funct…

---

## [How to set the options of HPDDM?](https://community.freefem.org/t/how-to-set-the-options-of-hpddm/4123)

<div class="topic-metadata">

**Author:** [@lzjqingao](https://community.freefem.org/u/lzjqingao)\
**Replies:** 2\
**Last updated:** [November 4, 2025, 11:29am UTC](https://community.freefem.org/t/how-to-set-the-options-of-hpddm/4123 "2025-11-04T11:29:43Z")

</div>

Dear FreeFEM community, I’m calling HPDDM to solve a 3D elasticity problem by switching to hpddm within FFDDM. I have tried two methods to set the options of hpddm. (1) Setting in the code The key codes are: mesh3 …

---

## [Find the adjacent tetrahedron of a specific tetrahedron by vertex e?](https://community.freefem.org/t/find-the-adjacent-tetrahedron-of-a-specific-tetrahedron-by-vertex-e/4115)

<div class="topic-metadata">

**Author:** [@MatrixVector](https://community.freefem.org/u/MatrixVector)\
**Replies:** 3\
**Last updated:** [November 3, 2025, 2:46pm UTC](https://community.freefem.org/t/find-the-adjacent-tetrahedron-of-a-specific-tetrahedron-by-vertex-e/4115 "2025-11-03T14:46:58Z")

</div>

The “Th\[k\].adj(e)” function works for 2D triangles, which find the adjacent triangle of the triangle k by edge e. Is it also works for 3D? I tested two cases, i.e., “mesh3 Th = cube(1, 1, 1)” and “mesh3 Th = cube(2, 2, …

---

## [Fespace Vh as the input argument of a function](https://community.freefem.org/t/fespace-vh-as-the-input-argument-of-a-function/4121)

<div class="topic-metadata">

**Author:** [@MatrixVector](https://community.freefem.org/u/MatrixVector)\
**Replies:** 2\
**Last updated:** [November 3, 2025, 11:33am UTC](https://community.freefem.org/t/fespace-vh-as-the-input-argument-of-a-function/4121 "2025-11-03T11:33:51Z")

</div>

Is it possible to set the fespace itself as an input argument of a self-defined func function? My problem is related to the node id of the fespace, and a simplified example is as follows: mesh Th = square(2, 2); fespace…

---

## [Logical "and" condition inconsistent with the "short-circuit evaluation"?](https://community.freefem.org/t/logical-and-condition-inconsistent-with-the-short-circuit-evaluation/4120)

<div class="topic-metadata">

**Author:** [@MatrixVector](https://community.freefem.org/u/MatrixVector)\
**Replies:** 1\
**Last updated:** [November 2, 2025, 1:24pm UTC](https://community.freefem.org/t/logical-and-condition-inconsistent-with-the-short-circuit-evaluation/4120 "2025-11-02T13:24:59Z")

</div>

When using logical && condition in some special cases like cond1 && cond2, it seems that it is inconsistent with the so called “short-circuit evaluation“. In FreeFem++, both conditions cond1 and cond2 are checked, while …

---

## [Square bracket or parenthesis when dealing with the element of an array](https://community.freefem.org/t/square-bracket-or-parenthesis-when-dealing-with-the-element-of-an-array/4119)

<div class="topic-metadata">

**Author:** [@MatrixVector](https://community.freefem.org/u/MatrixVector)\
**Replies:** 1\
**Last updated:** [November 2, 2025, 7:10am UTC](https://community.freefem.org/t/square-bracket-or-parenthesis-when-dealing-with-the-element-of-an-array/4119 "2025-11-02T07:10:26Z")

</div>

When dealing with the element of an array, it seems that both the square bracket a\[i\] and the parenthesis a(i) are OK. For example, real\[int\] U = 1:5; for (int i = 0; i \< U.n; i++ ) { cout \<\< U(i) \<\< endl; } real\[i…

---

## [Question about movemesh in parallel](https://community.freefem.org/t/question-about-movemesh-in-parallel/4113)

<div class="topic-metadata">

**Author:** [@zxss](https://community.freefem.org/u/zxss)\
**Replies:** 12\
**Last updated:** [October 30, 2025, 10:07am UTC](https://community.freefem.org/t/question-about-movemesh-in-parallel/4113 "2025-10-30T10:07:43Z")

</div>

Dear all, I am implementing Navier Stokes equations with moving boundary using ALE method. I want to parallelize it. Firstly, I directly movemesh in parallel without ‘move the global mesh in a single processor‘, and the…

---

## [Example of solving a coupled system using Varf](https://community.freefem.org/t/example-of-solving-a-coupled-system-using-varf/4117)

<div class="topic-metadata">

**Author:** [@Ravi](https://community.freefem.org/u/Ravi)\
**Replies:** 0\
**Last updated:** [October 29, 2025, 12:38pm UTC](https://community.freefem.org/t/example-of-solving-a-coupled-system-using-varf/4117 "2025-10-29T12:38:54Z")

</div>

Hello, everyone. Can someone provide an example of solving a coupled system using VARF? I am trying to solve a coupled system using VARF, but I don’t have a clue how to build the block matrix for coupled variables belong…

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

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