# General Discussion

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

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

**Page:** 21

---

## [How to construct a FE function from values at the nodes](https://community.freefem.org/t/how-to-construct-a-fe-function-from-values-at-the-nodes/3175)

<div class="topic-metadata">

**Author:** [@PeterQ](https://community.freefem.org/u/PeterQ)\
**Replies:** 0\
**Last updated:** [April 29, 2024, 12:27pm UTC](https://community.freefem.org/t/how-to-construct-a-fe-function-from-values-at-the-nodes/3175 "2024-04-29T12:27:57Z")

</div>

Dear Freefem community, I have encountered some difficulties. I first established a space and divided it into tetrahedral finite elements, then I used other software to calculate the values of a function at the vertices …

---

## [Runge-Kutta time stepping any comments?](https://community.freefem.org/t/runge-kutta-time-stepping-any-comments/2860)

<div class="topic-metadata">

**Author:** [@marchywka](https://community.freefem.org/u/marchywka)\
**Replies:** 4\
**Last updated:** [April 29, 2024, 12:24pm UTC](https://community.freefem.org/t/runge-kutta-time-stepping-any-comments/2860 "2024-04-29T12:24:37Z")

</div>

Most of all of the examples I’ve seen here use Euler but it is possible to do FEM along time and there is a lot of literature I found, mostly from years ago combining RK with FEM. Whatever happened to that ? Thanks.

---

## [Negative pressure](https://community.freefem.org/t/negative-pressure/3114)

<div class="topic-metadata">

**Author:** [@Aubium](https://community.freefem.org/u/Aubium)\
**Replies:** 4\
**Last updated:** [April 29, 2024, 10:36am UTC](https://community.freefem.org/t/negative-pressure/3114 "2024-04-29T10:36:39Z")

</div>

Greetings fellow members, I’m implementing a DG scheme for a Poiseuille flow in Freefem. While I get very satisfying results on the velocity, I’m surprised with negative values for the pressure. Anyone had a similar iss…

---

## [A question about the Newton method in SNES](https://community.freefem.org/t/a-question-about-the-newton-method-in-snes/3158)

<div class="topic-metadata">

**Author:** [@clthu](https://community.freefem.org/u/clthu)\
**Replies:** 4\
**Last updated:** [April 29, 2024, 6:47am UTC](https://community.freefem.org/t/a-question-about-the-newton-method-in-snes/3158 "2024-04-29T06:47:46Z")

</div>

Dear all, I am trying to use petsc SNES to solve the nonlinear equation instead of doing Newton iteration by hand. I find there are many options for -snes\_type and -snes\_linesearch\_type. The default option is the Line …

---

## [Scaling problem](https://community.freefem.org/t/scaling-problem/3127)

<div class="topic-metadata">

**Author:** [@Wilkinsonad01](https://community.freefem.org/u/Wilkinsonad01)\
**Replies:** 1\
**Last updated:** [April 26, 2024, 4:25pm UTC](https://community.freefem.org/t/scaling-problem/3127 "2024-04-26T16:25:27Z")

</div>

Hi all, I have ran my code to simulate cell growth diffusing a cross a thin rectangular domain of length 0.6 with a initial condition of c = exp(-75 x) over time t = 9.8. This seems to work perfectly fine. but when I …

---

## [Boundary condition](https://community.freefem.org/t/boundary-condition/2945)

<div class="topic-metadata">

**Author:** [@Salas](https://community.freefem.org/u/Salas)\
**Replies:** 19\
**Last updated:** [April 25, 2024, 2:13pm UTC](https://community.freefem.org/t/boundary-condition/2945 "2024-04-25T14:13:13Z")

</div>

Hello Dear community FreeFem, I need your help to introduce the boundary condition U.N=0 on Gamma where U=(ux,uy,uz) is the velocity and N=(Nx,Ny,Nz) is the unit normal vector. For U=0 we put +on(Gamma, ux=0,uy=0, uz=…

---

## [Clear or Delete matrix or array](https://community.freefem.org/t/clear-or-delete-matrix-or-array/3149)

<div class="topic-metadata">

**Author:** [@miguelpicos](https://community.freefem.org/u/miguelpicos)\
**Replies:** 1\
**Last updated:** [April 25, 2024, 1:28pm UTC](https://community.freefem.org/t/clear-or-delete-matrix-or-array/3149 "2024-04-25T13:28:42Z")

</div>

Hello everyone, I’m working on some models where I’ve utilized arrays of numbers and matrices. At certain points in the code, I’d like to clear or delete some of them as they are no longer needed, or I’d like to rebuild…

---

## [Movemesh() to generate a circle](https://community.freefem.org/t/movemesh-to-generate-a-circle/3113)

<div class="topic-metadata">

**Author:** [@yongxing](https://community.freefem.org/u/yongxing)\
**Replies:** 3\
**Last updated:** [April 25, 2024, 1:19pm UTC](https://community.freefem.org/t/movemesh-to-generate-a-circle/3113 "2024-04-25T13:19:09Z")

</div>

Hi there, if we use Th = movemesh(Th0, \[xcos(y), xsin(y)\]) to generate a circular mesh from a rectangle: How to collapse the overlapped line at y=0 so that it becomes a proper structured mesh? Seems there is…

---

## [Mesh problem / Auto contact](https://community.freefem.org/t/mesh-problem-auto-contact/3146)

<div class="topic-metadata">

**Author:** [@Joujou](https://community.freefem.org/u/Joujou)\
**Replies:** 3\
**Last updated:** [April 25, 2024, 12:34pm UTC](https://community.freefem.org/t/mesh-problem-auto-contact/3146 "2024-04-25T12:34:36Z")

</div>

Hello everyone, I am working on a simulation regarding the compression of a pillar ( Rectangular form). At high level of deformation, two elements touch each other and my calculation get stopped(see the figure attache…

---

## [Array of array, question](https://community.freefem.org/t/array-of-array-question/3130)

<div class="topic-metadata">

**Author:** [@bcaval](https://community.freefem.org/u/bcaval)\
**Replies:** 2\
**Last updated:** [April 21, 2024, 7:51pm UTC](https://community.freefem.org/t/array-of-array-question/3130 "2024-04-21T19:51:39Z")

</div>

Hello, On the help guide I found : // Array of Array real \[int\]\[int\] V(10); matrix\[int\] B(10); real \[int, int\]\[int\] A(10); Do you have examples how to use the last line ? Indeed I would like to use the two first i…

---

## [A problem with adaptmesh?](https://community.freefem.org/t/a-problem-with-adaptmesh/94)

<div class="topic-metadata">

**Author:** [@Charles](https://community.freefem.org/u/Charles)\
**Replies:** 5\
**Last updated:** [April 21, 2024, 11:29am UTC](https://community.freefem.org/t/a-problem-with-adaptmesh/94 "2024-04-21T11:29:36Z")

</div>

Dear all, I am trying to run an example involving the resolution of several time-dependent pdes on meshes adapted at each time step, and I very soon get stuck with problems related to bad memory allocation. After some c…

---

## [How to run FreeFem++ in GPU system](https://community.freefem.org/t/how-to-run-freefem-in-gpu-system/3118)

<div class="topic-metadata">

**Author:** [@arjuntulasi12](https://community.freefem.org/u/arjuntulasi12)\
**Replies:** 1\
**Last updated:** [April 21, 2024, 11:28am UTC](https://community.freefem.org/t/how-to-run-freefem-in-gpu-system/3118 "2024-04-21T11:28:09Z")

</div>

Dear All Is there any difference between running the FreeFem++ file in the CPU system and the GPU system? If I would like to run the file on a GPU, will I need any additional software, add-ons, or instructions in the c…

---

## [Non linear time dependent problem](https://community.freefem.org/t/non-linear-time-dependent-problem/856)

<div class="topic-metadata">

**Author:** [@Laurent](https://community.freefem.org/u/Laurent)\
**Replies:** 13\
**Last updated:** [April 21, 2024, 2:05am UTC](https://community.freefem.org/t/non-linear-time-dependent-problem/856 "2024-04-21T02:05:53Z")

</div>

Dear all, I looking for an or more examples of nonlinear time dependent problem using Newton method or other. Regards

---

## [Coordinates of DoFs in RT space](https://community.freefem.org/t/coordinates-of-dofs-in-rt-space/3101)

<div class="topic-metadata">

**Author:** [@larismartins](https://community.freefem.org/u/larismartins)\
**Replies:** 5\
**Last updated:** [April 20, 2024, 5:24pm UTC](https://community.freefem.org/t/coordinates-of-dofs-in-rt-space/3101 "2024-04-20T17:24:20Z")

</div>

Hello, I’m trying to find the coordinates of the dofs of a Raviart-Thomas space, I’ve tried the following: mesh Th = square(1,1); fespace RT(Th, RT0); RT \[rtx, rty\] = \[x,y\]; real\[int, int\] coordDofRT(RT.ndof, 2); for…

---

## [Integral on interior edges only](https://community.freefem.org/t/integral-on-interior-edges-only/3116)

<div class="topic-metadata">

**Author:** [@Aubium](https://community.freefem.org/u/Aubium)\
**Replies:** 0\
**Last updated:** [April 20, 2024, 12:25pm UTC](https://community.freefem.org/t/integral-on-interior-edges-only/3116 "2024-04-20T12:25:36Z")

</div>

Greetings fellow members, How can I integrate on internal edges only ? If my understanding is correct, intalledges() sums over boundary and internal edges alike. Any idea how to integrate only on Omega\\Fr(Omega) ? Best…

---

## [Solver for complex-valued Maxwell equation](https://community.freefem.org/t/solver-for-complex-valued-maxwell-equation/3112)

<div class="topic-metadata">

**Author:** [@aanovotny](https://community.freefem.org/u/aanovotny)\
**Replies:** 0\
**Last updated:** [April 19, 2024, 2:37pm UTC](https://community.freefem.org/t/solver-for-complex-valued-maxwell-equation/3112 "2024-04-19T14:37:19Z")

</div>

Hi! I am solving a complex-valued Maxwell equation, as follows: load “lapack” load “MUMPS” load “PETSc-complex” load “Element\_Mixte3d” func Pk = Edge03d; fespace Vhk(Th,Pk, periodic = \[\[1,y,z\],\[2,y,z\],\[3,x,z\],\[4,x…

---

## [About MHD equations](https://community.freefem.org/t/about-mhd-equations/3103)

<div class="topic-metadata">

**Author:** [@LXX](https://community.freefem.org/u/LXX)\
**Replies:** 4\
**Last updated:** [April 19, 2024, 1:12pm UTC](https://community.freefem.org/t/about-mhd-equations/3103 "2024-04-19T13:12:35Z")

</div>

Hello, everyone. I want to solev MHD equations in freefem++, but I really can not deal with the boundary condition of magnetic B, especially the condition B·n = 0 or B·n = Be·n Be is the analytic solution and n is t…

---

## [The boundary condition](https://community.freefem.org/t/the-boundary-condition/3079)

<div class="topic-metadata">

**Author:** [@LXX](https://community.freefem.org/u/LXX)\
**Replies:** 4\
**Last updated:** [April 19, 2024, 7:39am UTC](https://community.freefem.org/t/the-boundary-condition/3079 "2024-04-19T07:39:10Z")

</div>

How to write the following three dimensions boundary condition in FreeFEM++? whre J=\[0,T\] is the time.

---

## [Physical tensorial properties by domain](https://community.freefem.org/t/physical-tensorial-properties-by-domain/3108)

<div class="topic-metadata">

**Author:** [@bcaval](https://community.freefem.org/u/bcaval)\
**Replies:** 0\
**Last updated:** [April 18, 2024, 1:31pm UTC](https://community.freefem.org/t/physical-tensorial-properties-by-domain/3108 "2024-04-18T13:31:44Z")

</div>

Hi everybody, I work on a thermoelastic problem but with general elasticity Cijkl. I have 3 domains, but also we could have more. And I wrote fespace Ph(Th3,P0); Ph\[int\] c(37); for (i=1;i\<=6;i++) { for (j=1;j\<=6;j++…

---

## [The k equation source term from the examples" a large fluid problem" is wrong](https://community.freefem.org/t/the-k-equation-source-term-from-the-examples-a-large-fluid-problem-is-wrong/3104)

<div class="topic-metadata">

**Author:** [@localhost](https://community.freefem.org/u/localhost)\
**Replies:** 0\
**Last updated:** [April 17, 2024, 2:44pm UTC](https://community.freefem.org/t/the-k-equation-source-term-from-the-examples-a-large-fluid-problem-is-wrong/3104 "2024-04-17T14:44:47Z")

</div>

in the example code, the source term is prode = -0.126kp(pow(2dx(Ux),2)+pow(2dy(Uy),2)+2pow(dx(Uy)+dy(Ux),2))/2; prodk = -prodekp/epp\*0.09/0.126; but both of them should be negative, so prodk should be prodk = prodek…

---

## [Periodic BC with DG spaces](https://community.freefem.org/t/periodic-bc-with-dg-spaces/3100)

<div class="topic-metadata">

**Author:** [@amirmahdimech](https://community.freefem.org/u/amirmahdimech)\
**Replies:** 1\
**Last updated:** [April 16, 2024, 2:50pm UTC](https://community.freefem.org/t/periodic-bc-with-dg-spaces/3100 "2024-04-16T14:50:22Z")

</div>

Is it possible to implement bi-periodic condition for solving a pde on a 1 by 1 square which is discretized by H(div),RT space functions in freeFEM?

---

## [Limit the number of elements/nodes when refining a mesh using mmg3d](https://community.freefem.org/t/limit-the-number-of-elements-nodes-when-refining-a-mesh-using-mmg3d/3066)

<div class="topic-metadata">

**Author:** [@Jacoban90](https://community.freefem.org/u/Jacoban90)\
**Replies:** 3\
**Last updated:** [April 16, 2024, 2:34pm UTC](https://community.freefem.org/t/limit-the-number-of-elements-nodes-when-refining-a-mesh-using-mmg3d/3066 "2024-04-16T14:34:23Z")

</div>

Hello everyone, I am trying to define an adaptative 3d mesh by using mmg3d based on a level set function phi. The results obtained are smoother compared with tetgenreconstruction. length = max(hmin, min(hmax,abs(phi)))…

---

## ["Vectorial" jumps and averages - Discontinuous Galerkin](https://community.freefem.org/t/vectorial-jumps-and-averages-discontinuous-galerkin/3097)

<div class="topic-metadata">

**Author:** [@Aubium](https://community.freefem.org/u/Aubium)\
**Replies:** 4\
**Last updated:** [April 15, 2024, 1:10pm UTC](https://community.freefem.org/t/vectorial-jumps-and-averages-discontinuous-galerkin/3097 "2024-04-15T13:10:21Z")

</div>

Greetings fellow members, If i’m correct, jump() and average() functions give the jump and mean value of a given function at an edge for discontinuous Galerkin schemes. But how to retrieve these fundamental quantities w…

---

## [How to fix nan diff nan](https://community.freefem.org/t/how-to-fix-nan-diff-nan/2328)

<div class="topic-metadata">

**Author:** [@cfdyuewu](https://community.freefem.org/u/cfdyuewu)\
**Replies:** 1\
**Last updated:** [April 14, 2024, 2:27am UTC](https://community.freefem.org/t/how-to-fix-nan-diff-nan/2328 "2024-04-14T02:27:16Z")

</div>

nan != nan diff nan =\> Sorry error in Optimization (e) add: int2d(Th,optimize=0)(...) remark if you add (.. , optimize=2) then you remove this check (be careful); current line = 146 Exec error : In Optimized ver…

---

## [Macro ThN2O for mixed vectorial and scalar finite element space](https://community.freefem.org/t/macro-thn2o-for-mixed-vectorial-and-scalar-finite-element-space/1731)

<div class="topic-metadata">

**Author:** [@jmorvan](https://community.freefem.org/u/jmorvan)\
**Replies:** 31\
**Last updated:** [April 12, 2024, 10:24am UTC](https://community.freefem.org/t/macro-thn2o-for-mixed-vectorial-and-scalar-finite-element-space/1731 "2024-04-12T10:24:52Z")

</div>

Hello everyone! I’ve recently watched the tutorials from professor Pierre Jolivet on Youtube about parallel computing in FreeFem. I have a code that works fine sequentially and I intend to swicht it to parallel. In the…

---

## [Problem save 3D file .msh](https://community.freefem.org/t/problem-save-3d-file-msh/3094)

<div class="topic-metadata">

**Author:** [@Mathloger](https://community.freefem.org/u/Mathloger)\
**Replies:** 1\
**Last updated:** [April 12, 2024, 3:43am UTC](https://community.freefem.org/t/problem-save-3d-file-msh/3094 "2024-04-12T03:43:51Z")

</div>

Hello, I am trying to save a mesh3 by: load "msh3" mesh3 Th=cube(5,5,5); savemesh(Th,"Th.msh"); plot(Th,wait=true); but it give me: Load: lg\_fem lg\_mesh lg\_mesh3 eigenvalue 1 : load "msh3"(load: loadLibary D:\\Fr…

---

## [Problem: codying a variational formulation](https://community.freefem.org/t/problem-codying-a-variational-formulation/3096)

<div class="topic-metadata">

**Author:** [@mariavm](https://community.freefem.org/u/mariavm)\
**Replies:** 0\
**Last updated:** [April 11, 2024, 10:59am UTC](https://community.freefem.org/t/problem-codying-a-variational-formulation/3096 "2024-04-11T10:59:08Z")

</div>

Hello, I am a newbie on FreeFEM and I want to solve a problem. I have this variational formula (written in LaTeX code) : \\begin{align\*} \\int\_\\Omega \\frac{du}{dt}v \\text{ } dx + \\int\_\\Omega k(x)\\nabla u \\cdot\\nabla v \\t…

---

## [How to draw an arc in my mesh](https://community.freefem.org/t/how-to-draw-an-arc-in-my-mesh/3093)

<div class="topic-metadata">

**Author:** [@zoumpou](https://community.freefem.org/u/zoumpou)\
**Replies:** 1\
**Last updated:** [April 10, 2024, 8:47am UTC](https://community.freefem.org/t/how-to-draw-an-arc-in-my-mesh/3093 "2024-04-10T08:47:06Z")

</div>

// Mesh border a(t=0, 1) {x=t; y=0;, z=0; label=1;}; border b(t=0, 2) {x=1; y=t;, z= label=1;}; border c(t=1, 3) {x=t; y=2; label=1;}; border d(t=0, 2) {x=3; y=2-t; label=1;}; border e(t=0, 1) {x=3+t; y=0; label=1;}…

---

## [EPSSetInitialSpace set in FreeFem](https://community.freefem.org/t/epssetinitialspace-set-in-freefem/3087)

<div class="topic-metadata">

**Author:** [@WeiQLiu](https://community.freefem.org/u/WeiQLiu)\
**Replies:** 6\
**Last updated:** [April 10, 2024, 6:09am UTC](https://community.freefem.org/t/epssetinitialspace-set-in-freefem/3087 "2024-04-10T06:09:43Z")

</div>

Dear all, Recently, I’m learning about SLEPc and I’m reading this help manual slepc.pdf. I find the Advanced Usage of EPS described in Chapter 2, section 6. Section 2.6.1 is about entering an initial guess into EPS. Th…

---

## [How to read complex matrix in matlab](https://community.freefem.org/t/how-to-read-complex-matrix-in-matlab/3089)

<div class="topic-metadata">

**Author:** [@Amitkaush](https://community.freefem.org/u/Amitkaush)\
**Replies:** 6\
**Last updated:** [April 9, 2024, 4:21pm UTC](https://community.freefem.org/t/how-to-read-complex-matrix-in-matlab/3089 "2024-04-09T16:21:32Z")

</div>

I am writing a complex matrix using ofstream in FreeFEM++ \`ofstream file("A.dat"); file \<\< A \<\<endl; And I am trying to read it in MATLAB using dlmread but it causes error. Can someone suggest a better way …

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

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