# General Discussion

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

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

**Page:** 40

---

## [Invalid array size in the code with PETSc for solving the fluid-structure coupling problem](https://community.freefem.org/t/invalid-array-size-in-the-code-with-petsc-for-solving-the-fluid-structure-coupling-problem/2094)

<div class="topic-metadata">

**Author:** [@SHENG](https://community.freefem.org/u/SHENG)\
**Replies:** 15\
**Last updated:** [November 9, 2022, 9:01am UTC](https://community.freefem.org/t/invalid-array-size-in-the-code-with-petsc-for-solving-the-fluid-structure-coupling-problem/2094 "2022-11-09T09:01:25Z")

</div>

Dear all, I am facing a problem. I want to solve the fluid-structure coupling problem with PETSc. However, the code always report the error, as shown in the below figure, I have debugged this code for long time. I r…

---

## [Export then read global solution](https://community.freefem.org/t/export-then-read-global-solution/2109)

<div class="topic-metadata">

**Author:** [@Markov](https://community.freefem.org/u/Markov)\
**Replies:** 1\
**Last updated:** [November 9, 2022, 6:22am UTC](https://community.freefem.org/t/export-then-read-global-solution/2109 "2022-11-09T06:22:53Z")

</div>

Hello, I am running a code on parallel and I would like to export the global solution as one array, then I would like to read this array in another .edp file. Now I am familiar with exporting/importing data in FreeFEM, …

---

## [Magnetostatic issue](https://community.freefem.org/t/magnetostatic-issue/2102)

<div class="topic-metadata">

**Author:** [@dega](https://community.freefem.org/u/dega)\
**Replies:** 7\
**Last updated:** [November 8, 2022, 1:31pm UTC](https://community.freefem.org/t/magnetostatic-issue/2102 "2022-11-08T13:31:41Z")

</div>

Hello, I am trying to make a simple magnetostatic simulation of a coil, I started from the example in: https://modules.freefem.org/modules/magnetostatic/ I created a simple gemometry with 4 coils and the results seem …

---

## [Calculating the resultant forces via the pressure and shear stress terms in Navier-Stokes](https://community.freefem.org/t/calculating-the-resultant-forces-via-the-pressure-and-shear-stress-terms-in-navier-stokes/2107)

<div class="topic-metadata">

**Author:** [@Markov](https://community.freefem.org/u/Markov)\
**Replies:** 0\
**Last updated:** [November 7, 2022, 9:33am UTC](https://community.freefem.org/t/calculating-the-resultant-forces-via-the-pressure-and-shear-stress-terms-in-navier-stokes/2107 "2022-11-07T09:33:00Z")

</div>

Hello, I would like to calculate the resultant forces that a viscous fluid exerts on a flat surface, suppose that the object is in 3D, is the total force calculated as follows?: varFf(\[u1,u2,u3\],\[v1,v2,v3\]) = int2d(Th…

---

## [Syntax in a loop](https://community.freefem.org/t/syntax-in-a-loop/2100)

<div class="topic-metadata">

**Author:** [@Loic](https://community.freefem.org/u/Loic)\
**Replies:** 1\
**Last updated:** [November 7, 2022, 9:11am UTC](https://community.freefem.org/t/syntax-in-a-loop/2100 "2022-11-07T09:11:39Z")

</div>

Hello all ! I have a small practical question. For example if I want to replace something like this: mesh Th=square(2,2); fespace Vh1(Th, P1); fespace Vh0(Th, P0); func w1=1; func w2=x; func w3=y; varf vL1(u,uu) = …

---

## [Label each boundary edge with the natural numbering](https://community.freefem.org/t/label-each-boundary-edge-with-the-natural-numbering/2106)

<div class="topic-metadata">

**Author:** [@Loic](https://community.freefem.org/u/Loic)\
**Replies:** 1\
**Last updated:** [November 7, 2022, 9:07am UTC](https://community.freefem.org/t/label-each-boundary-edge-with-the-natural-numbering/2106 "2022-11-07T09:07:29Z")

</div>

Hello all, Given a domain with N boundary edge, I would like to assign to each boundary edge the label corresponding to the natural numbering (label 0 for boundary edge 0, label 1 for boundary edge 1, …). For example …

---

## [Parallel computing](https://community.freefem.org/t/parallel-computing/926)

<div class="topic-metadata">

**Author:** [@niaa](https://community.freefem.org/u/niaa)\
**Replies:** 11\
**Last updated:** [November 7, 2022, 7:23am UTC](https://community.freefem.org/t/parallel-computing/926 "2022-11-07T07:23:57Z")

</div>

Dear all, I heve few questions on the example Maxwell-3d-simple.edp from ffddm examples. I need to solve my own maxwell code in parallel and I am new in parallel computing and need to understand this code in detail, I w…

---

## [Error from the code with PETSc when the mesh is refined](https://community.freefem.org/t/error-from-the-code-with-petsc-when-the-mesh-is-refined/2080)

<div class="topic-metadata">

**Author:** [@SHENG](https://community.freefem.org/u/SHENG)\
**Replies:** 25\
**Last updated:** [November 2, 2022, 8:12am UTC](https://community.freefem.org/t/error-from-the-code-with-petsc-when-the-mesh-is-refined/2080 "2022-11-02T08:12:54Z")

</div>

Dear all, I am facing a problem. I compiled a code with PETSc to solve the elastic problem of the 3D model. The code with PETSc can normally run when the mesh of the model is rough, while the code reports error when the…

---

## [Questions on the steay stokes equation with Dirchlet boundary conditions](https://community.freefem.org/t/questions-on-the-steay-stokes-equation-with-dirchlet-boundary-conditions/2105)

<div class="topic-metadata">

**Author:** [@zhugp123](https://community.freefem.org/u/zhugp123)\
**Replies:** 0\
**Last updated:** [November 5, 2022, 1:23pm UTC](https://community.freefem.org/t/questions-on-the-steay-stokes-equation-with-dirchlet-boundary-conditions/2105 "2022-11-05T13:23:22Z")

</div>

Hi, I try to solve the above steady stokes equation with Dirichlet boundary conditions in the matrix form (Ax = b). The vector b is implemented as fespace Xh(Th, \[P2, P2, P1\]); fespace Vh(Th, P2), Qh(Th, P1); Vh …

---

## [One questiong about fespace](https://community.freefem.org/t/one-questiong-about-fespace/2098)

<div class="topic-metadata">

**Author:** [@Yangshen](https://community.freefem.org/u/Yangshen)\
**Replies:** 0\
**Last updated:** [November 3, 2022, 6:27am UTC](https://community.freefem.org/t/one-questiong-about-fespace/2098 "2022-11-03T06:27:54Z")

</div>

Hello everyone, I have the following code. It is an example of optimization algorithm in the tutorial. I don’t know what Ib and Ic define.

---

## [Unifying regions to assing constant values](https://community.freefem.org/t/unifying-regions-to-assing-constant-values/2097)

<div class="topic-metadata">

**Author:** [@galfras](https://community.freefem.org/u/galfras)\
**Replies:** 1\
**Last updated:** [November 2, 2022, 5:36pm UTC](https://community.freefem.org/t/unifying-regions-to-assing-constant-values/2097 "2022-11-02T17:36:27Z")

</div>

Hello! I have a domain like the one shown in the picture. I need to solve an equation where k = 1 inside the squares and 0 outside (ignore the red border). I know it is possible to solve this in multiple ways and I actu…

---

## [3D periodic boundary condition](https://community.freefem.org/t/3d-periodic-boundary-condition/2093)

<div class="topic-metadata">

**Author:** [@danmo](https://community.freefem.org/u/danmo)\
**Replies:** 2\
**Last updated:** [October 31, 2022, 11:07am UTC](https://community.freefem.org/t/3d-periodic-boundary-condition/2093 "2022-10-31T11:07:07Z")

</div>

Hi all, I want to apply 3-D periodic BC on a structure, but when running the code, I encounter the following error: Exec error : periodic: Sorry one vertex of face is losted Does anyone know what could be the reason f…

---

## [Running freefem from matlab](https://community.freefem.org/t/running-freefem-from-matlab/886)

<div class="topic-metadata">

**Author:** [@zese](https://community.freefem.org/u/zese)\
**Replies:** 5\
**Last updated:** [October 31, 2022, 12:46am UTC](https://community.freefem.org/t/running-freefem-from-matlab/886 "2022-10-31T00:46:32Z")

</div>

Dear all, I wanted to run freefem from matlab. inside Mathworks this command was proposed: \[file, path\] = uigetfile(’\*.edp’); selectedFilePath = fullfile(path, file) system(\['FreeFem++ ’ Path\]); when I use this comm…

---

## [How to use Freefem++ on Mac M1](https://community.freefem.org/t/how-to-use-freefem-on-mac-m1/2091)

<div class="topic-metadata">

**Author:** [@Coulson](https://community.freefem.org/u/Coulson)\
**Replies:** 1\
**Last updated:** [October 29, 2022, 3:26pm UTC](https://community.freefem.org/t/how-to-use-freefem-on-mac-m1/2091 "2022-10-29T15:26:17Z")

</div>

I used Integrated development environment VScode on windows, Can i use this IDE to write code on MAC? Now I just can run the examples by following the README.TEX in terminal on MAC. It is not convenient. Can you help m…

---

## [PDE-1 with nonhomogeneous Neumann BCs](https://community.freefem.org/t/pde-1-with-nonhomogeneous-neumann-bcs/2070)

<div class="topic-metadata">

**Author:** [@bukshtu](https://community.freefem.org/u/bukshtu)\
**Replies:** 3\
**Last updated:** [October 26, 2022, 7:25pm UTC](https://community.freefem.org/t/pde-1-with-nonhomogeneous-neumann-bcs/2070 "2022-10-26T19:25:38Z")

</div>

Could you please refer to any examples of solving the first-order PDE with nonhomogeneous Neumann BCs? In the last version of the FF manual, I found a reference to the function int0d, but I don’t have a clue how to corre…

---

## [KSP\_DIVERGED\_NAN error](https://community.freefem.org/t/ksp-diverged-nan-error/2089)

<div class="topic-metadata">

**Author:** [@ajahstephen](https://community.freefem.org/u/ajahstephen)\
**Replies:** 1\
**Last updated:** [October 26, 2022, 3:33pm UTC](https://community.freefem.org/t/ksp-diverged-nan-error/2089 "2022-10-26T15:33:55Z")

</div>

I am trying a simulation in Fluidity/ICFERST for 3D geometry generated from Gmsh. It is giving me these error messages WARNING: Failed to converge. PETSc did not converge for matrix solve of: DeltaP Reason for non-con…

---

## [Error of savemesh in 3D](https://community.freefem.org/t/error-of-savemesh-in-3d/1839)

<div class="topic-metadata">

**Author:** [@RYP](https://community.freefem.org/u/RYP)\
**Replies:** 9\
**Last updated:** [October 26, 2022, 11:14am UTC](https://community.freefem.org/t/error-of-savemesh-in-3d/1839 "2022-10-26T11:14:12Z")

</div>

Hello!everyone, I install windows version FreeFem 4.11 in win 10. But there is something wrong when I save 3D mesh. So I test the following simple code: load "msh3" load "medit" mesh3 Th3=cube(10,15,5); plot(Th3); med…

---

## [FreeFEM compilation error : \_\_float128 problem](https://community.freefem.org/t/freefem-compilation-error-float128-problem/2083)

<div class="topic-metadata">

**Author:** [@ffeppon](https://community.freefem.org/u/ffeppon)\
**Replies:** 3\
**Last updated:** [October 25, 2022, 9:53am UTC](https://community.freefem.org/t/freefem-compilation-error-float128-problem/2083 "2022-10-25T09:53:57Z")

</div>

Dear developpers, I am encountering some difficulties to compile FreeFEM on a compute server. When I reach the compulation of mpi plugins, I have the error below… I have also seen error messages stating error: cannot…

---

## [Create a mesh from xy coordinates](https://community.freefem.org/t/create-a-mesh-from-xy-coordinates/2051)

<div class="topic-metadata">

**Author:** [@galfras](https://community.freefem.org/u/galfras)\
**Replies:** 4\
**Last updated:** [October 25, 2022, 9:03am UTC](https://community.freefem.org/t/create-a-mesh-from-xy-coordinates/2051 "2022-10-25T09:03:54Z")

</div>

Hello! I have a .txt file with the xy coordinates of the border of my mesh. I tried the trinagulate() command, but I get the error “Assertion fail : (area \> 0)”. I tried reducing the number of point and got another erro…

---

## [Memory allocation problem in MPI computation using PETSc](https://community.freefem.org/t/memory-allocation-problem-in-mpi-computation-using-petsc/2071)

<div class="topic-metadata">

**Author:** [@marcodeba](https://community.freefem.org/u/marcodeba)\
**Replies:** 43\
**Last updated:** [October 25, 2022, 8:35am UTC](https://community.freefem.org/t/memory-allocation-problem-in-mpi-computation-using-petsc/2071 "2022-10-25T08:35:53Z")

</div>

Dear FreeFEM developers and users, I’m writing here since I’m having an issue in memory allocation during MPI computation using PETSc. The problem is the following one: I’m using the same script and the same amount of …

---

## [Acoustic-Elastic interaction problem](https://community.freefem.org/t/acoustic-elastic-interaction-problem/2079)

<div class="topic-metadata">

**Author:** [@Leo](https://community.freefem.org/u/Leo)\
**Replies:** 0\
**Last updated:** [October 22, 2022, 2:41pm UTC](https://community.freefem.org/t/acoustic-elastic-interaction-problem/2079 "2022-10-22T14:41:05Z")

</div>

I am unfamiliar with the FreeFEM and try to use it to solve the acoustic-elastic interaction problem. The acoustic-elastic interaction problem is a coupling problem, where the exterior and interior domain are governed b…

---

## [How can I ofstream the values of macros in my code?](https://community.freefem.org/t/how-can-i-ofstream-the-values-of-macros-in-my-code/2076)

<div class="topic-metadata">

**Author:** [@gnaganlu](https://community.freefem.org/u/gnaganlu)\
**Replies:** 2\
**Last updated:** [October 21, 2022, 1:33pm UTC](https://community.freefem.org/t/how-can-i-ofstream-the-values-of-macros-in-my-code/2076 "2022-10-21T13:33:27Z")

</div>

I need to be ofstream of the values of the macro following as //Macro macro Gradient(u) \[dx(u), dy(u)\] // macro Divergence(ux, uy) (dx(ux) + dy(uy)) // macro UgradV(ux,uy,vx,vy) \[ \[ux,uy\]'\[dx(vx),dy(vx)\] , \[ux,uy\]'\[d…

---

## [Energy of each node, Elasticity problem](https://community.freefem.org/t/energy-of-each-node-elasticity-problem/2075)

<div class="topic-metadata">

**Author:** [@Stefanosv](https://community.freefem.org/u/Stefanosv)\
**Replies:** 1\
**Last updated:** [October 21, 2022, 6:13am UTC](https://community.freefem.org/t/energy-of-each-node-elasticity-problem/2075 "2022-10-21T06:13:04Z")

</div>

I’ve noticed the usage of 2 equations to calculate the energy of each node when solving using the elasticity code Energy1=dx(uu)+dy(vv) Energy2=2\*mu\*(dx(uu)^2+dy(vv)^2+((dx(vv)+dy(uu))^2)/2.)+lamda\*(dx(uu)+dy(vv))^2; I…

---

## [Derivative with respect to w](https://community.freefem.org/t/derivative-with-respect-to-w/2074)

<div class="topic-metadata">

**Author:** [@bikram](https://community.freefem.org/u/bikram)\
**Replies:** 0\
**Last updated:** [October 19, 2022, 1:13pm UTC](https://community.freefem.org/t/derivative-with-respect-to-w/2074 "2022-10-19T13:13:22Z")

</div>

Dear all, If u is the function of x,y,z and w, that is, u = u(x,y,z,w). Then the partial derivatives of u with respect to x, y, and z are dx(u), dy(u), and dz(u). But how do we define the partial derivative of u with re…

---

## [The elasticity problem with "varf"](https://community.freefem.org/t/the-elasticity-problem-with-varf/2057)

<div class="topic-metadata">

**Author:** [@SHENG](https://community.freefem.org/u/SHENG)\
**Replies:** 23\
**Last updated:** [October 19, 2022, 10:13am UTC](https://community.freefem.org/t/the-elasticity-problem-with-varf/2057 "2022-10-19T10:13:13Z")

</div>

Dear all, I faced a problem. I am asking for your help. I want to simulate the propagation of elastic wave in a 2D model. By the obtained displacement of a specify point with time (i.e., the waveform), I could judge th…

---

## [Running failure of an additive Schwarz method in two overlapping non-matching grids](https://community.freefem.org/t/running-failure-of-an-additive-schwarz-method-in-two-overlapping-non-matching-grids/1789)

<div class="topic-metadata">

**Author:** [@AbuAzzan](https://community.freefem.org/u/AbuAzzan)\
**Replies:** 17\
**Last updated:** [October 19, 2022, 10:05am UTC](https://community.freefem.org/t/running-failure-of-an-additive-schwarz-method-in-two-overlapping-non-matching-grids/1789 "2022-10-19T10:05:45Z")

</div>

Hi there, I wrote an additive Schwarz method code to solve a semi-linear elliptic problem. It seems fine but when I come to run it does not work properly. I guess the failure from the function uh that the code seems doe…

---

## [Unset error in while condition](https://community.freefem.org/t/unset-error-in-while-condition/2020)

<div class="topic-metadata">

**Author:** [@ulrichger](https://community.freefem.org/u/ulrichger)\
**Replies:** 2\
**Last updated:** [October 18, 2022, 11:01am UTC](https://community.freefem.org/t/unset-error-in-while-condition/2020 "2022-10-18T11:01:41Z")

</div>

Dear Freefem community, I am trying to solve a scheme with steady nse and my stopping condition for the loop depends on the error between successful iterations. This works quite well when considered l2 norm like below: …

---

## [Integral over nested meshes](https://community.freefem.org/t/integral-over-nested-meshes/1859)

<div class="topic-metadata">

**Author:** [@yuki](https://community.freefem.org/u/yuki)\
**Replies:** 13\
**Last updated:** [October 17, 2022, 9:42am UTC](https://community.freefem.org/t/integral-over-nested-meshes/1859 "2022-10-17T09:42:19Z")

</div>

Dear all, I am trying to evaluate an integral for the solution obtained in the nested meshes. More concretely, I’d like to evaluate the integral of the solution in the following example: According to the previous ent…

---

## [Substract meshes](https://community.freefem.org/t/substract-meshes/2063)

<div class="topic-metadata">

**Author:** [@galfras](https://community.freefem.org/u/galfras)\
**Replies:** 3\
**Last updated:** [October 16, 2022, 10:08am UTC](https://community.freefem.org/t/substract-meshes/2063 "2022-10-16T10:08:37Z")

</div>

Hello! I have two already constructed meshes and I what to substract one from the other (make a hole in the bigger mesh with the shape of the smaller mesh). Is that possible? Thanks!

---

## [How to solve a problem based on 2D polar coordinate](https://community.freefem.org/t/how-to-solve-a-problem-based-on-2d-polar-coordinate/2062)

<div class="topic-metadata">

**Author:** [@Kellen](https://community.freefem.org/u/Kellen)\
**Replies:** 1\
**Last updated:** [October 15, 2022, 5:18pm UTC](https://community.freefem.org/t/how-to-solve-a-problem-based-on-2d-polar-coordinate/2062 "2022-10-15T17:18:59Z")

</div>

Hello, everyone. I’m solving a problem in a domain which is reprensted with polar coordinate. The equation is given in rectangular coordinate system. But the Dirichlet boundary condition is polar coordinate. So I think …

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

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