# General Discussion

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

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

**Page:** 6

---

## [Convolution in 1d](https://community.freefem.org/t/convolution-in-1d/4077)

<div class="topic-metadata">

**Author:** [@smail](https://community.freefem.org/u/smail)\
**Replies:** 3\
**Last updated:** [September 23, 2025, 1:51pm UTC](https://community.freefem.org/t/convolution-in-1d/4077 "2025-09-23T13:51:10Z")

</div>

I need to compute a convolution in 1d \\\\int\\\_{0}^{t}g(t-s)u(s) ds for simplicity I take g=u=\\\\exp(-s), the exact convolution is t \\\\exp(-t). I tried to adapt the freedom code Convolution-Sample.edp to the 1D case, but …

---

## [Obtain the shape function and its derivative at each element](https://community.freefem.org/t/obtain-the-shape-function-and-its-derivative-at-each-element/1755)

<div class="topic-metadata">

**Author:** [@hezl09](https://community.freefem.org/u/hezl09)\
**Replies:** 3\
**Last updated:** [September 20, 2025, 7:07am UTC](https://community.freefem.org/t/obtain-the-shape-function-and-its-derivative-at-each-element/1755 "2025-09-20T07:07:43Z")

</div>

Hello, I would like to get the shape function (or characteristic function) together with its derivative at each element. Is there a quick way in freefem to do so? Many thanks! Note: I understand that I can use varf to …

---

## [Solution for transient Navier Stokes](https://community.freefem.org/t/solution-for-transient-navier-stokes/4072)

<div class="topic-metadata">

**Author:** [@lipesantosa](https://community.freefem.org/u/lipesantosa)\
**Replies:** 1\
**Last updated:** [September 19, 2025, 2:08pm UTC](https://community.freefem.org/t/solution-for-transient-navier-stokes/4072 "2025-09-19T14:08:10Z")

</div>

Hello, evereone! I would like to know if anyone knows of any paper with data and a solution for transient Navier Stokes.

---

## [Resolvent operator with FF/PETSc (MatMatSolve?)](https://community.freefem.org/t/resolvent-operator-with-ff-petsc-matmatsolve/1603)

<div class="topic-metadata">

**Author:** [@cmd](https://community.freefem.org/u/cmd)\
**Replies:** 24\
**Last updated:** [September 15, 2025, 1:17pm UTC](https://community.freefem.org/t/resolvent-operator-with-ff-petsc-matmatsolve/1603 "2025-09-15T13:17:12Z")

</div>

Hello FF developers, I am interested in implementing a resolvent (input/output) analysis framework using the FreeFEM/PETSc interface. To do this, I need to construct a matrix that is defined by a series of products and…

---

## [Question about dual- P1DCP\_1^{DC} DG formulation in FreeFem++ documentation (nTonEdge logic & parameter al)](https://community.freefem.org/t/question-about-dual-p1dcp-1-dc-dg-formulation-in-freefem-documentation-ntonedge-logic-parameter-al/4035)

<div class="topic-metadata">

**Author:** [@Tan](https://community.freefem.org/u/Tan)\
**Replies:** 5\
**Last updated:** [September 15, 2025, 12:18pm UTC](https://community.freefem.org/t/question-about-dual-p1dcp-1-dc-dg-formulation-in-freefem-documentation-ntonedge-logic-parameter-al/4035 "2025-09-15T12:18:34Z")

</div>

I am currently studying the section “Solution by Discontinuous-Galerkin FEM” in the FreeFem++ documentation, which presents a dual-P1DCP\_1^{DC} formulation for solving a scalar advection problem. The weak formulation pr…

---

## [Nonlinear Parabolic Equation](https://community.freefem.org/t/nonlinear-parabolic-equation/4063)

<div class="topic-metadata">

**Author:** [@ds2201](https://community.freefem.org/u/ds2201)\
**Replies:** 1\
**Last updated:** [September 15, 2025, 9:48am UTC](https://community.freefem.org/t/nonlinear-parabolic-equation/4063 "2025-09-15T09:48:30Z")

</div>

Hi, I am trying to solve the nonlinear parabolic equation with non homogeneous Dirichlet boundary condition. I am trying to solve it with following fully discrete DG scheme where I am attaching my code here.…

---

## [Viscous term in NS](https://community.freefem.org/t/viscous-term-in-ns/4058)

<div class="topic-metadata">

**Author:** [@goetze](https://community.freefem.org/u/goetze)\
**Replies:** 1\
**Last updated:** [September 15, 2025, 9:43am UTC](https://community.freefem.org/t/viscous-term-in-ns/4058 "2025-09-15T09:43:08Z")

</div>

Hi everyone, I’m trying to solve the term \\nabla\\cdot(\\nu\_t(\\nabla\\mathbf{u}+\\nabla\\mathbf{u}^T)) and extract the x and y component but I’m struggling with implementation. I guess it’s best to use varf but I’m pretty…

---

## [From FreeFem matrix to Petsc Mat, double size of memory usage?](https://community.freefem.org/t/from-freefem-matrix-to-petsc-mat-double-size-of-memory-usage/4061)

<div class="topic-metadata">

**Author:** [@MatrixVector](https://community.freefem.org/u/MatrixVector)\
**Replies:** 4\
**Last updated:** [September 11, 2025, 2:10pm UTC](https://community.freefem.org/t/from-freefem-matrix-to-petsc-mat-double-size-of-memory-usage/4061 "2025-09-11T14:10:26Z")

</div>

In parallel study using PETSc, the examples in the directory examples/hpddm usually first generate the FreeFem matrix like matrix Aloc = vA(Vh, Vh); “Aloc“, and then assign its value to a PETSc Mat like Mat A = Alo…

---

## [Pointwise Dirichlet constraint using setBC is not suitable for a PETSc parallel environment?](https://community.freefem.org/t/pointwise-dirichlet-constraint-using-setbc-is-not-suitable-for-a-petsc-parallel-environment/4060)

<div class="topic-metadata">

**Author:** [@MatrixVector](https://community.freefem.org/u/MatrixVector)\
**Replies:** 7\
**Last updated:** [September 11, 2025, 2:06pm UTC](https://community.freefem.org/t/pointwise-dirichlet-constraint-using-setbc-is-not-suitable-for-a-petsc-parallel-environment/4060 "2025-09-11T14:06:52Z")

</div>

Dear FreFem++ community and developers: The “setBC” function for enforcing Dirichlet boundary condition is very useful in solid mechanics field, just like that shown in the examples/3d/Elasticity-simple-support-BC.edp. …

---

## [Fascinating theoretical challenge: Simulating EM eigenmodes in a tetrahedron](https://community.freefem.org/t/fascinating-theoretical-challenge-simulating-em-eigenmodes-in-a-tetrahedron/4049)

<div class="topic-metadata">

**Author:** [@Frode](https://community.freefem.org/u/Frode)\
**Replies:** 10\
**Last updated:** [September 10, 2025, 8:05pm UTC](https://community.freefem.org/t/fascinating-theoretical-challenge-simulating-em-eigenmodes-in-a-tetrahedron/4049 "2025-09-10T20:05:47Z")

</div>

Hello FreeFEM community, I am an independent researcher working on a theoretical physics model where the geometry of space is hypothesized to be tetrahedral at a fundamental scale. A key prediction of the model is that …

---

## [Mmg3d does not work in Ubuntu 20.04 but works in Mac and Windows](https://community.freefem.org/t/mmg3d-does-not-work-in-ubuntu-20-04-but-works-in-mac-and-windows/2432)

<div class="topic-metadata">

**Author:** [@YAOH](https://community.freefem.org/u/YAOH)\
**Replies:** 12\
**Last updated:** [September 9, 2025, 1:18pm UTC](https://community.freefem.org/t/mmg3d-does-not-work-in-ubuntu-20-04-but-works-in-mac-and-windows/2432 "2025-09-09T13:18:57Z")

</div>

Dear all, I did mesh adaption by mmg3d, the same code has different results on different PCs. In windows with FreeFem v4.10 and Mac with v4.12, the mesh can be adapted, be refined near the edge (y==0); but in Ubuntu 2…

---

## [Compile issue in plotting 3d mesh](https://community.freefem.org/t/compile-issue-in-plotting-3d-mesh/4052)

<div class="topic-metadata">

**Author:** [@RaghunathBandha](https://community.freefem.org/u/RaghunathBandha)\
**Replies:** 5\
**Last updated:** [September 5, 2025, 7:34am UTC](https://community.freefem.org/t/compile-issue-in-plotting-3d-mesh/4052 "2025-09-05T07:34:31Z")

</div>

Let \\Omega is cubical the domain \[-1,1\]^3 and \\Omega^1 is the spherical domain of radius 0.5. Let \\Omega^2 is \\Omega\\setminus\\Omega^1 is the cube with a spherical hole. Write a freefem code to build two different 3d mesh…

---

## [How to implement jump(u^3) for nonlinear DG flux in FreeFEM++](https://community.freefem.org/t/how-to-implement-jump-u-3-for-nonlinear-dg-flux-in-freefem/4054)

<div class="topic-metadata">

**Author:** [@ds2201](https://community.freefem.org/u/ds2201)\
**Replies:** 2\
**Last updated:** [September 5, 2025, 6:04am UTC](https://community.freefem.org/t/how-to-implement-jump-u-3-for-nonlinear-dg-flux-in-freefem/4054 "2025-09-05T06:04:28Z")

</div>

Hi, I am implementing a DG scheme in FreeFEM++ for a nonlinear diffusion problem. I need to write the jump of b(u)=u+u^3/3 in intalledges. Writing it directly gives me the compilation error. Can jump() handle nonlinear …

---

## [2D Resolvent Analysis on NS equation (how to do multiplication with complex conjugate)](https://community.freefem.org/t/2d-resolvent-analysis-on-ns-equation-how-to-do-multiplication-with-complex-conjugate/2751)

<div class="topic-metadata">

**Author:** [@xuanshi123](https://community.freefem.org/u/xuanshi123)\
**Replies:** 10\
**Last updated:** [September 1, 2025, 12:50pm UTC](https://community.freefem.org/t/2d-resolvent-analysis-on-ns-equation-how-to-do-multiplication-with-complex-conjugate/2751 "2025-09-01T12:50:45Z")

</div>

Hi, I am trying to solve this resolvent formulation I have (iw-L) ready from matrix transformation from https://github.com/FreeFem/FreeFem-sources/blob/develop/examples/hpddm/navier-stokes-2d-SLEPc-complex.edp. but …

---

## [Time dependent Schrodinger equation in FreeFem](https://community.freefem.org/t/time-dependent-schrodinger-equation-in-freefem/4051)

<div class="topic-metadata">

**Author:** [@Joaquin](https://community.freefem.org/u/Joaquin)\
**Replies:** 0\
**Last updated:** [September 1, 2025, 11:30am UTC](https://community.freefem.org/t/time-dependent-schrodinger-equation-in-freefem/4051 "2025-09-01T11:30:34Z")

</div>

Good morning. I am trying to solve the time dependent Schrodinger equation using finite elements method. The problem I have is that since this is a complex equation I do not know how to define or work with complex functi…

---

## [Save od ofstream stifness matrix asn file.txt](https://community.freefem.org/t/save-od-ofstream-stifness-matrix-asn-file-txt/4045)

<div class="topic-metadata">

**Author:** [@karzan](https://community.freefem.org/u/karzan)\
**Replies:** 4\
**Last updated:** [August 27, 2025, 9:24am UTC](https://community.freefem.org/t/save-od-ofstream-stifness-matrix-asn-file-txt/4045 "2025-08-27T09:24:00Z")

</div>

I have a question regarding save or record Stiffness Matrix in Freefem++! here is my question and freefem++ code To save all entries in the matrix A or get the stiffness matrix or sparse matrix from, I wrote this code, …

---

## [Non-uniform border vertex spacing (before movemesh23) and incompatibility when combining with square3-generated meshS](https://community.freefem.org/t/non-uniform-border-vertex-spacing-before-movemesh23-and-incompatibility-when-combining-with-square3-generated-meshs/430)

<div class="topic-metadata">

**Author:** [@aaron1d](https://community.freefem.org/u/aaron1d)\
**Replies:** 2\
**Last updated:** [August 25, 2025, 9:48am UTC](https://community.freefem.org/t/non-uniform-border-vertex-spacing-before-movemesh23-and-incompatibility-when-combining-with-square3-generated-meshs/430 "2025-08-25T09:48:10Z")

</div>

I have a somewhat complex 3d geometry, the boundary of most of which I can construct with meshS pieces from calling square3. However, Due to the different numbers of vertices required on opposing sides in one plane of my…

---

## [Not a number computing L2 and H1 errors](https://community.freefem.org/t/not-a-number-computing-l2-and-h1-errors/4040)

<div class="topic-metadata">

**Author:** [@juanpaca](https://community.freefem.org/u/juanpaca)\
**Replies:** 3\
**Last updated:** [August 25, 2025, 9:34am UTC](https://community.freefem.org/t/not-a-number-computing-l2-and-h1-errors/4040 "2025-08-25T09:34:09Z")

</div>

Dear FreeFem community, I hope you are well. I am implementing a stabilized method for a reaction–diffusion model, which is \\sigma u - \\epsilon \\Delta u = f in \\Omega, u = 0 on \\partial \\Omega. When I set \\epsilon = 10…

---

## [Boundary conditions in a sphere using tetgreconstruction](https://community.freefem.org/t/boundary-conditions-in-a-sphere-using-tetgreconstruction/4043)

<div class="topic-metadata">

**Author:** [@Joaquin](https://community.freefem.org/u/Joaquin)\
**Replies:** 1\
**Last updated:** [August 25, 2025, 9:27am UTC](https://community.freefem.org/t/boundary-conditions-in-a-sphere-using-tetgreconstruction/4043 "2025-08-25T09:27:12Z")

</div>

Hey, I have been trying to solve the Schrodinger equation for the hydrogen atom using Finite Elements in FreeFem. The problem is that in order to get good results I need to use a refine sphere because the Coulomb potenti…

---

## [Error operator in Petrov-Galerkin Least-Squares](https://community.freefem.org/t/error-operator-in-petrov-galerkin-least-squares/4046)

<div class="topic-metadata">

**Author:** [@lipesantosa](https://community.freefem.org/u/lipesantosa)\
**Replies:** 2\
**Last updated:** [August 24, 2025, 10:48am UTC](https://community.freefem.org/t/error-operator-in-petrov-galerkin-least-squares/4046 "2025-08-24T10:48:06Z")

</div>

I am getting an error in my script, “error operator,” whenever I try to subtract with a variable or function. In this case, the variables would be Vh fx, fy, fT. This happens whenever I have a problem to solve. …

---

## [3D Electrostatic Trap Simulation with FreeFem++ and Gmsh](https://community.freefem.org/t/3d-electrostatic-trap-simulation-with-freefem-and-gmsh/4039)

<div class="topic-metadata">

**Author:** [@Deepanshu](https://community.freefem.org/u/Deepanshu)\
**Replies:** 0\
**Last updated:** [August 13, 2025, 8:02pm UTC](https://community.freefem.org/t/3d-electrostatic-trap-simulation-with-freefem-and-gmsh/4039 "2025-08-13T20:02:52Z")

</div>

Hello everyone, We’re working on a simulation of an electrostatic confinement setup for an electron cloud in 3D. The attachment here is a working example of the code, which loads a Gmsh-generated mesh with a cylindrical…

---

## [Getting error while solving stokes interface problem in a square domain](https://community.freefem.org/t/getting-error-while-solving-stokes-interface-problem-in-a-square-domain/4033)

<div class="topic-metadata">

**Author:** [@RaghunathBandha](https://community.freefem.org/u/RaghunathBandha)\
**Replies:** 1\
**Last updated:** [August 6, 2025, 2:00pm UTC](https://community.freefem.org/t/getting-error-while-solving-stokes-interface-problem-in-a-square-domain/4033 "2025-08-06T14:00:17Z")

</div>

I have taken \[-2,2\]\\times \[-2,2\] as domain with interface \[-1,1\]\\times\[-1,1\]. But after solving in Free Fem++, I am getting a large error for pressure. Please look into it. stokessquareinterface.edp (1.8 KB)

---

## [Direct sum of spaces](https://community.freefem.org/t/direct-sum-of-spaces/4034)

<div class="topic-metadata">

**Author:** [@pratyay](https://community.freefem.org/u/pratyay)\
**Replies:** 1\
**Last updated:** [August 6, 2025, 2:07pm UTC](https://community.freefem.org/t/direct-sum-of-spaces/4034 "2025-08-06T14:07:47Z")

</div>

Can I write the direct sum of two fe spaces in FreeFem++ and use this space as my solution space and test function space?

---

## [About how to use DDM tool](https://community.freefem.org/t/about-how-to-use-ddm-tool/4031)

<div class="topic-metadata">

**Author:** [@qingYang](https://community.freefem.org/u/qingYang)\
**Replies:** 3\
**Last updated:** [July 31, 2025, 2:59pm UTC](https://community.freefem.org/t/about-how-to-use-ddm-tool/4031 "2025-07-31T14:59:21Z")

</div>

Hello everyone,: I have studied the following DDM case and I have a question. For the ffddmsetupOperator and ffddmbuildrhs functions, it is necessary to define the macro Varf(varfName, meshName, VhName). Suppose my prob…

---

## [Explicitly Defining Regions](https://community.freefem.org/t/explicitly-defining-regions/4012)

<div class="topic-metadata">

**Author:** [@MariamiMamgo](https://community.freefem.org/u/MariamiMamgo)\
**Replies:** 3\
**Last updated:** [July 30, 2025, 2:28pm UTC](https://community.freefem.org/t/explicitly-defining-regions/4012 "2025-07-30T14:28:19Z")

</div>

question.edp (4.9 KB) Hello FreeFem++ community, I’m working on a problem that involves a complex 2D geometry, and I need to define and extract specific regions (subdomains) from the generated mesh for further processi…

---

## [Generalized eigenvalue problem in a mesh](https://community.freefem.org/t/generalized-eigenvalue-problem-in-a-mesh/4022)

<div class="topic-metadata">

**Author:** [@juanpaca](https://community.freefem.org/u/juanpaca)\
**Replies:** 9\
**Last updated:** [July 29, 2025, 12:28pm UTC](https://community.freefem.org/t/generalized-eigenvalue-problem-in-a-mesh/4022 "2025-07-29T12:28:58Z")

</div>

Dear FreeFem community, I hope you are all doing well. I am trying to solve the following generalized eigenvalue problem on a simplicial mesh \\mathcal{T}\_h: for each K \\in \\mathcal{T}\_h, find \\lambda \\in \\mathbb{R} and…

---

## [Can't create the solution for waveguide.edp](https://community.freefem.org/t/cant-create-the-solution-for-waveguide-edp/2282)

<div class="topic-metadata">

**Author:** [@minhquan](https://community.freefem.org/u/minhquan)\
**Replies:** 28\
**Last updated:** [July 29, 2025, 8:08am UTC](https://community.freefem.org/t/cant-create-the-solution-for-waveguide-edp/2282 "2025-07-29T08:08:36Z")

</div>

Hello, I’m trying to execute “waveguide.edp” example by FreeFem++ in Frederichecht github. But the solution only appears the image of cube mesh, and with the error: Error umpfack umfpack\_zi\_numeric status 1 Error um…

---

## [Issue in plotting a mesh of rectangular cube in 3D](https://community.freefem.org/t/issue-in-plotting-a-mesh-of-rectangular-cube-in-3d/4015)

<div class="topic-metadata">

**Author:** [@RaghunathBandha](https://community.freefem.org/u/RaghunathBandha)\
**Replies:** 3\
**Last updated:** [July 27, 2025, 2:29pm UTC](https://community.freefem.org/t/issue-in-plotting-a-mesh-of-rectangular-cube-in-3d/4015 "2025-07-27T14:29:51Z")

</div>

I want to plot a 3D mesh of rectangular cube x=0 to x=2\*pi, y=0 to y=pi, z=1 to z=1.5. But the code is showing error in line 48. cube.edp (1.6 KB)

---

## [Issue in movemesh while tansforming a 3D rectangular cube](https://community.freefem.org/t/issue-in-movemesh-while-tansforming-a-3d-rectangular-cube/4021)

<div class="topic-metadata">

**Author:** [@RaghunathBandha](https://community.freefem.org/u/RaghunathBandha)\
**Replies:** 0\
**Last updated:** [July 26, 2025, 6:21am UTC](https://community.freefem.org/t/issue-in-movemesh-while-tansforming-a-3d-rectangular-cube/4021 "2025-07-26T06:21:55Z")

</div>

While plotting the code is showing error Bad orientation of tet before cleanmesh 0 mes = -2.31518e-05 Error of mesh orientation , current orientation = 1 mesure element mesh = -9.88309 mesure border mesh = 42.6648 …

---

## [Segfault passing a map array by value](https://community.freefem.org/t/segfault-passing-a-map-array-by-value/4016)

<div class="topic-metadata">

**Author:** [@jtermens](https://community.freefem.org/u/jtermens)\
**Replies:** 0\
**Last updated:** [July 25, 2025, 7:33am UTC](https://community.freefem.org/t/segfault-passing-a-map-array-by-value/4016 "2025-07-25T07:33:02Z")

</div>

Hi everyone, I’ve been exploring different ways to encapsulate mesh creation in FreeFem++ (version 4.15), experimenting with the available data types. My goal is to build a catalog of functions, each of which takes a st…

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

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