# General Discussion

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

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

**Page:** 30

---

## [Impose a gradient boundary condition](https://community.freefem.org/t/impose-a-gradient-boundary-condition/2644)

<div class="topic-metadata">

**Author:** [@Drazer](https://community.freefem.org/u/Drazer)\
**Replies:** 3\
**Last updated:** [August 5, 2023, 10:59pm UTC](https://community.freefem.org/t/impose-a-gradient-boundary-condition/2644 "2023-08-05T22:59:18Z")

</div>

Hello everyone, Recently, I have been working on solving \\Delta \\phi = 0. Here, \\phi is the potential of speed (so v = \\nabla \\phi) in a fluid, around a cylinder (so there is a z-invariance to the problem and it can be …

---

## [Is there a way to include an "or" statement within an "if" statement?](https://community.freefem.org/t/is-there-a-way-to-include-an-or-statement-within-an-if-statement/2639)

<div class="topic-metadata">

**Author:** [@jna1g18](https://community.freefem.org/u/jna1g18)\
**Replies:** 2\
**Last updated:** [August 4, 2023, 1:32pm UTC](https://community.freefem.org/t/is-there-a-way-to-include-an-or-statement-within-an-if-statement/2639 "2023-08-04T13:32:43Z")

</div>

Hi, does freeFEM support “or” statements inside “if” statements? If so, what’s the syntax? I know there’s an “and” statement, the syntax for which is && (I think). Cheers!

---

## [Problem in Navier-Stokes 3D formulation](https://community.freefem.org/t/problem-in-navier-stokes-3d-formulation/2630)

<div class="topic-metadata">

**Author:** [@MariannaDellOtto](https://community.freefem.org/u/MariannaDellOtto)\
**Replies:** 3\
**Last updated:** [August 1, 2023, 10:32pm UTC](https://community.freefem.org/t/problem-in-navier-stokes-3d-formulation/2630 "2023-08-01T22:32:46Z")

</div>

Hello, I am trying to write Freefem++ code for the steady Navier Stokes equations in 3D using Newton’s method taking my cue from the 2D model in the FreeFem documentation. The code I have written is as follows: load “m…

---

## [Is it possible to create an array of solutions?](https://community.freefem.org/t/is-it-possible-to-create-an-array-of-solutions/2628)

<div class="topic-metadata">

**Author:** [@jna1g18](https://community.freefem.org/u/jna1g18)\
**Replies:** 0\
**Last updated:** [July 29, 2023, 11:21am UTC](https://community.freefem.org/t/is-it-possible-to-create-an-array-of-solutions/2628 "2023-07-29T11:21:36Z")

</div>

Hi, I have a transient PDE system and I would like to append the solution at each timestep to an array for later use. Is there a way to do this? Many thanks!

---

## [Représentation de la courbe l'erreur d'une edp](https://community.freefem.org/t/representation-de-la-courbe-lerreur-dune-edp/2627)

<div class="topic-metadata">

**Author:** [@Leonidas](https://community.freefem.org/u/Leonidas)\
**Replies:** 0\
**Last updated:** [July 29, 2023, 11:14am UTC](https://community.freefem.org/t/representation-de-la-courbe-lerreur-dune-edp/2627 "2023-07-29T11:14:23Z")

</div>

Hello, I solved an edp and I was able to plot the solution u(x,y,t) in 2D. I would like to plot this solution in 1D from freefem. I would also like to use freefem to plot log( | u\_ex -u\_h^n | ) as a function of log(h) a…

---

## [Build a mesh for the unitary sphere](https://community.freefem.org/t/build-a-mesh-for-the-unitary-sphere/244)

<div class="topic-metadata">

**Author:** [@MarcoF](https://community.freefem.org/u/MarcoF)\
**Replies:** 6\
**Last updated:** [July 29, 2023, 1:54am UTC](https://community.freefem.org/t/build-a-mesh-for-the-unitary-sphere/244 "2023-07-29T01:54:16Z")

</div>

Dear users, I’m new to FreeFem++ and I’m trying to build the mesh for the unitary sphere. In particular, I looked at the examples in the documentation Here. I need to solve an equation over this domain, so I need to ap…

---

## [How to run FreeFEM++ code in MATLAB with minimum message shown in MATLAB command windows?](https://community.freefem.org/t/how-to-run-freefem-code-in-matlab-with-minimum-message-shown-in-matlab-command-windows/2609)

<div class="topic-metadata">

**Author:** [@hezl09](https://community.freefem.org/u/hezl09)\
**Replies:** 5\
**Last updated:** [July 28, 2023, 12:00pm UTC](https://community.freefem.org/t/how-to-run-freefem-code-in-matlab-with-minimum-message-shown-in-matlab-command-windows/2609 "2023-07-28T12:00:24Z")

</div>

Hello, I’m running MATLAB to execute a FreeFEM++ file. Currently everything is fine, except that I do not want the FreeFEM++ code to be shown in the Matlab command window. Here is an example to explain my question. I ex…

---

## [Question of PETSc and parallelization in FreeFEM++](https://community.freefem.org/t/question-of-petsc-and-parallelization-in-freefem/2622)

<div class="topic-metadata">

**Author:** [@m31phy](https://community.freefem.org/u/m31phy)\
**Replies:** 7\
**Last updated:** [July 27, 2023, 9:09pm UTC](https://community.freefem.org/t/question-of-petsc-and-parallelization-in-freefem/2622 "2023-07-27T21:09:52Z")

</div>

Hello everyone I have a few questions of PETSc and its parallelization in FreeFEM++ First of all, I am not sure if PETSc in my computer works well. The OS used in my labtop is window 11. In addition, I installed FreeFE…

---

## [Nan error causing code to fail](https://community.freefem.org/t/nan-error-causing-code-to-fail/2623)

<div class="topic-metadata">

**Author:** [@jna1g18](https://community.freefem.org/u/jna1g18)\
**Replies:** 2\
**Last updated:** [July 26, 2023, 3:31pm UTC](https://community.freefem.org/t/nan-error-causing-code-to-fail/2623 "2023-07-26T15:31:59Z")

</div>

Hi, is there a way to break a for-loop when a particular quantity becomes equal to nan (not a number)? I.e. if during a loop I get quantity=nan, is there a way to break the loop? I tried inputting " for(quantity=nan) bre…

---

## [No solution for circular waveguide](https://community.freefem.org/t/no-solution-for-circular-waveguide/2621)

<div class="topic-metadata">

**Author:** [@Ionizing](https://community.freefem.org/u/Ionizing)\
**Replies:** 5\
**Last updated:** [July 25, 2023, 3:13pm UTC](https://community.freefem.org/t/no-solution-for-circular-waveguide/2621 "2023-07-25T15:13:08Z")

</div>

I am using FreeFEM++ to simulate the cylindrical waveguide, but no reasonable solution is returned. Here I’m using the 94 GHz light (𝜆 = 3.17mm) as input, and radius of the waveguide is 1.27mm. If I uncomment the savevt…

---

## [Problems using P3 FE and periodic BC](https://community.freefem.org/t/problems-using-p3-fe-and-periodic-bc/2568)

<div class="topic-metadata">

**Author:** [@Elissa](https://community.freefem.org/u/Elissa)\
**Replies:** 8\
**Last updated:** [July 22, 2023, 1:21am UTC](https://community.freefem.org/t/problems-using-p3-fe-and-periodic-bc/2568 "2023-07-22T01:21:10Z")

</div>

I consider the following situation. I have a domain comprising of a free flow part Z^+=(0,1)x(0,4) and a porous-medium part Z^-= (0,1)x(0,4)\\P, where solid inclusions are present and P denotes the set of solid inclusion…

---

## [Are the Neumann boundaries conditions approximate?](https://community.freefem.org/t/are-the-neumann-boundaries-conditions-approximate/2618)

<div class="topic-metadata">

**Author:** [@jbl](https://community.freefem.org/u/jbl)\
**Replies:** 3\
**Last updated:** [July 21, 2023, 2:32pm UTC](https://community.freefem.org/t/are-the-neumann-boundaries-conditions-approximate/2618 "2023-07-21T14:32:21Z")

</div>

Hello, I need to use Neumann BC so i want to be sure of the operation. to do this I took a simple example : load "iovtk" mesh Th = square(10,10); fespace SpaceP2(Th,P2); macro mGrad1(u1) (\[dx(u1),dy(u1)\]) // EOM …

---

## [Mesh becoming overly fine during adaptation](https://community.freefem.org/t/mesh-becoming-overly-fine-during-adaptation/2614)

<div class="topic-metadata">

**Author:** [@jna1g18](https://community.freefem.org/u/jna1g18)\
**Replies:** 11\
**Last updated:** [July 20, 2023, 3:12pm UTC](https://community.freefem.org/t/mesh-becoming-overly-fine-during-adaptation/2614 "2023-07-20T15:12:16Z")

</div>

Hi all, I’m quite new to freefem so please try to bear with me. I’ve been trying to implement a mesh adapation into my code for a nonlinear system of three equations in order to make it more efficient. My code uses a New…

---

## [Split multiple border free elements in a 3D mesh](https://community.freefem.org/t/split-multiple-border-free-elements-in-a-3d-mesh/2616)

<div class="topic-metadata">

**Author:** [@Loic](https://community.freefem.org/u/Loic)\
**Replies:** 0\
**Last updated:** [July 19, 2023, 9:07am UTC](https://community.freefem.org/t/split-multiple-border-free-elements-in-a-3d-mesh/2616 "2023-07-19T09:07:50Z")

</div>

Hello all, Given a 3D mesh discretized with tetrahedras (done with FreeFEM or gmsh), I would like to select the corner elements which have more than 1 free border (two or three) and then I would like to split these ele…

---

## [How can I simulate a system in hours instead of seconds?](https://community.freefem.org/t/how-can-i-simulate-a-system-in-hours-instead-of-seconds/2615)

<div class="topic-metadata">

**Author:** [@jna1g18](https://community.freefem.org/u/jna1g18)\
**Replies:** 0\
**Last updated:** [July 18, 2023, 7:09pm UTC](https://community.freefem.org/t/how-can-i-simulate-a-system-in-hours-instead-of-seconds/2615 "2023-07-18T19:09:23Z")

</div>

Hi. This is quite a general question related to numerical methods. I have a transient model in which the unit of time is seconds, but I want to simulate the system over a number of hours. The problem is that my model req…

---

## [Unsteady Stokes with PETSc](https://community.freefem.org/t/unsteady-stokes-with-petsc/2611)

<div class="topic-metadata">

**Author:** [@rirane](https://community.freefem.org/u/rirane)\
**Replies:** 3\
**Last updated:** [July 18, 2023, 3:33pm UTC](https://community.freefem.org/t/unsteady-stokes-with-petsc/2611 "2023-07-18T15:33:41Z")

</div>

Hi, I am still trying to solve an unsteady stokes equation (Stokes with time stepper - PETSc - #7 by rirane - the problem there got solved but now I have a problem with the time update) The right-hand side is updated in…

---

## [A small puzzle about the length of vector valued fespace](https://community.freefem.org/t/a-small-puzzle-about-the-length-of-vector-valued-fespace/2610)

<div class="topic-metadata">

**Author:** [@clthu](https://community.freefem.org/u/clthu)\
**Replies:** 3\
**Last updated:** [July 18, 2023, 7:28am UTC](https://community.freefem.org/t/a-small-puzzle-about-the-length-of-vector-valued-fespace/2610 "2023-07-18T07:28:54Z")

</div>

Dear all if we create two fespace Vh(Th,\[P2 P2 P1\]) and Mh(Th,P1) on the same mesh, then we define Vh \[ux,uy,up\] and Mh \[vp\], I find that the length of vp (vp.n) doesn’t equal to the length of up. I think the length o…

---

## [How to extract boundary data](https://community.freefem.org/t/how-to-extract-boundary-data/2612)

<div class="topic-metadata">

**Author:** [@jawahar264](https://community.freefem.org/u/jawahar264)\
**Replies:** 0\
**Last updated:** [July 18, 2023, 4:38am UTC](https://community.freefem.org/t/how-to-extract-boundary-data/2612 "2023-07-18T04:38:08Z")

</div>

i want to plot the lift on asymmetric airfoil. i solved the problem but no idea how to extract the data on airfoil and plot it in paraview

---

## [Source Code for int2d](https://community.freefem.org/t/source-code-for-int2d/2604)

<div class="topic-metadata">

**Author:** [@K.Mandalon](https://community.freefem.org/u/K.Mandalon)\
**Replies:** 7\
**Last updated:** [July 17, 2023, 10:01pm UTC](https://community.freefem.org/t/source-code-for-int2d/2604 "2023-07-17T22:01:34Z")

</div>

Hi everyone, I’m trying to implement an area integral over specific elements of a mesh. I’m kind of stumped since int2d integrates over the whole mesh. I can’t seem to find the source code for this in the github directo…

---

## [Interpolate results from one mesh to another mesh (subdomain)](https://community.freefem.org/t/interpolate-results-from-one-mesh-to-another-mesh-subdomain/2605)

<div class="topic-metadata">

**Author:** [@clthu](https://community.freefem.org/u/clthu)\
**Replies:** 5\
**Last updated:** [July 17, 2023, 12:36pm UTC](https://community.freefem.org/t/interpolate-results-from-one-mesh-to-another-mesh-subdomain/2605 "2023-07-17T12:36:31Z")

</div>

Dear all, I want to interpolate my results ( for example,(th1, \[P2 P2 P1\]) on the mesh1 (Th1) to the mesh2 (Th2) (Th2 is only one part of the Th1, its boundary is in the interior of Th1, but the mesh densitiy is higher …

---

## [How do I evaluate a PDE solution upon one of the domain boundaries?](https://community.freefem.org/t/how-do-i-evaluate-a-pde-solution-upon-one-of-the-domain-boundaries/2598)

<div class="topic-metadata">

**Author:** [@jna1g18](https://community.freefem.org/u/jna1g18)\
**Replies:** 6\
**Last updated:** [July 17, 2023, 10:39am UTC](https://community.freefem.org/t/how-do-i-evaluate-a-pde-solution-upon-one-of-the-domain-boundaries/2598 "2023-07-17T10:39:08Z")

</div>

Hi, Is there a way to evaluate a solution of a PDE at one of the domain boundaries? E.g. if u is the solution that I’ve just obtained, is there a simple way to then obtain u(gamma) where gamma is a boundary of the domai…

---

## [Save the values of scalar filed u w together with the mesh Th and Th1 in a .vtk file](https://community.freefem.org/t/save-the-values-of-scalar-filed-u-w-together-with-the-mesh-th-and-th1-in-a-vtk-file/2606)

<div class="topic-metadata">

**Author:** [@HJGH](https://community.freefem.org/u/HJGH)\
**Replies:** 4\
**Last updated:** [July 17, 2023, 8:25am UTC](https://community.freefem.org/t/save-the-values-of-scalar-filed-u-w-together-with-the-mesh-th-and-th1-in-a-vtk-file/2606 "2023-07-17T08:25:32Z")

</div>

Dear FF++Users & Developers, I was trying to save the values of scalar filed u w together with the mesh Th and Th1 in a .vtk file with savevtk(“uw.vtu”,Th,u,Th1,w,dataname=“uw source”); But that doesn’t seem to be pos…

---

## [Average of variable](https://community.freefem.org/t/average-of-variable/2607)

<div class="topic-metadata">

**Author:** [@zese](https://community.freefem.org/u/zese)\
**Replies:** 4\
**Last updated:** [July 17, 2023, 8:01am UTC](https://community.freefem.org/t/average-of-variable/2607 "2023-07-17T08:01:37Z")

</div>

Dear all I want to take the area average of my velocity field in freefem++ code. is it enough to write uAverage=int2d(th)(ux)/Area ? I think something is wrong and the integral must be area weighted. Do you know how …

---

## [Erreur de compilation](https://community.freefem.org/t/erreur-de-compilation/2502)

<div class="topic-metadata">

**Author:** [@aweni](https://community.freefem.org/u/aweni)\
**Replies:** 8\
**Last updated:** [July 14, 2023, 10:05am UTC](https://community.freefem.org/t/erreur-de-compilation/2502 "2023-07-14T10:05:00Z")

</div>

Bonsoir à tous Comment corriger cet erreur svp Merci d’avance current line = 169 Exec error : Try to get unset x,y, … – number :1 Exec error : Try to get unset x,y, … – number :1 err code 8 , mpirank 0 try getC…

---

## [Define the nonlinearity f inside and outside the time loop gave different result](https://community.freefem.org/t/define-the-nonlinearity-f-inside-and-outside-the-time-loop-gave-different-result/2602)

<div class="topic-metadata">

**Author:** [@nguyenquynhnga101010](https://community.freefem.org/u/nguyenquynhnga101010)\
**Replies:** 1\
**Last updated:** [July 14, 2023, 9:59am UTC](https://community.freefem.org/t/define-the-nonlinearity-f-inside-and-outside-the-time-loop-gave-different-result/2602 "2023-07-14T09:59:02Z")

</div>

Hello everyone, I am solving a simple heat equation of variable u with the source term f. At first, function f only depends on u so I can define f outside the time loops and it gives a good result. But then I want f to…

---

## [ERROR: "Warning manifold obj nb:4 adj 4 of dim =2 freefem"](https://community.freefem.org/t/error-warning-manifold-obj-nb-4-adj-4-of-dim-2-freefem/2603)

<div class="topic-metadata">

**Author:** [@luca.liverotti](https://community.freefem.org/u/luca.liverotti)\
**Replies:** 1\
**Last updated:** [July 14, 2023, 9:49am UTC](https://community.freefem.org/t/error-warning-manifold-obj-nb-4-adj-4-of-dim-2-freefem/2603 "2023-07-14T09:49:24Z")

</div>

Hi everyone. I’m writing a .msh file (“new.msh”) in order to get a new mesh starting from another one (I have to perform some local transformations, that’s the reason I’m writing a new .msh). The fact is the following.…

---

## [How is Sommerfeld boundary condition applied in this model problem](https://community.freefem.org/t/how-is-sommerfeld-boundary-condition-applied-in-this-model-problem/2601)

<div class="topic-metadata">

**Author:** [@jawahar264](https://community.freefem.org/u/jawahar264)\
**Replies:** 3\
**Last updated:** [July 13, 2023, 12:01pm UTC](https://community.freefem.org/t/how-is-sommerfeld-boundary-condition-applied-in-this-model-problem/2601 "2023-07-13T12:01:25Z")

</div>

load “bem” real k = 10; int n = 100; border circle(t = 0, 2pi){x=cos(t); y=sin(t);} meshL ThL = buildmeshL(circle(n)); ThL = OrientNormal(ThL,unbounded=1); varf vbem(u,v) = int1dx1d(ThL)(ThL)(BEM(BemKernel(“SL”,k=k…

---

## [Post processing of Electromagnetic FEM in waveguide](https://community.freefem.org/t/post-processing-of-electromagnetic-fem-in-waveguide/2592)

<div class="topic-metadata">

**Author:** [@deepdeepdark](https://community.freefem.org/u/deepdeepdark)\
**Replies:** 2\
**Last updated:** [July 13, 2023, 11:11am UTC](https://community.freefem.org/t/post-processing-of-electromagnetic-fem-in-waveguide/2592 "2023-07-13T11:11:05Z")

</div>

Hello everyone, I’m trying to finish a FEM procedure in Matlab and the FEM is referred to 《The finite element method in electromagnetics》 written by Jianming Jin. I’ve already finished the Matrix solving but confused by…

---

## [MPI REDUCE with sparse matrices](https://community.freefem.org/t/mpi-reduce-with-sparse-matrices/2600)

<div class="topic-metadata">

**Author:** [@Loic](https://community.freefem.org/u/Loic)\
**Replies:** 0\
**Last updated:** [July 12, 2023, 3:22pm UTC](https://community.freefem.org/t/mpi-reduce-with-sparse-matrices/2600 "2023-07-12T15:22:14Z")

</div>

Hello all, When doing MPI REDUCE on sparse matrices, Does anyone know what this problem means ? and how to solve it ? 6 \*\*\*\* MPI\_Reduce sparse matrix: warning missing term in pattern 300 3 \*\*\*\* MPI\_Reduce sparse mat…

---

## [Stokes with time stepper - PETSc](https://community.freefem.org/t/stokes-with-time-stepper-petsc/2593)

<div class="topic-metadata">

**Author:** [@rirane](https://community.freefem.org/u/rirane)\
**Replies:** 6\
**Last updated:** [July 11, 2023, 8:45am UTC](https://community.freefem.org/t/stokes-with-time-stepper-petsc/2593 "2023-07-11T08:45:11Z")

</div>

Hi, I am new to FreeFem and PETSc and need some help. I want to solve a time dependent stokes equation, where the righthandside is updated with the old velocity uold in each iteration step. Until the time loop everythin…

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

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