# General Discussion

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

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

**Page:** 34

---

## [Non-homogeneous Dirichlet BC at a point](https://community.freefem.org/t/non-homogeneous-dirichlet-bc-at-a-point/2410)

<div class="topic-metadata">

**Author:** [@sumantkr](https://community.freefem.org/u/sumantkr)\
**Replies:** 2\
**Last updated:** [April 25, 2023, 11:17am UTC](https://community.freefem.org/t/non-homogeneous-dirichlet-bc-at-a-point/2410 "2023-04-25T11:17:08Z")

</div>

Dear All, can we impose a non-homogeneous Dirichlet boundary condition at a point in a square domain? Ex: u\_xx + u\_yy = f(x, y) over a square AB, BC, CD, and DA are four boundaries of a square. So, how to impose, u(…

---

## [Convect with periodic boundaries](https://community.freefem.org/t/convect-with-periodic-boundaries/2399)

<div class="topic-metadata">

**Author:** [@ilavi](https://community.freefem.org/u/ilavi)\
**Replies:** 4\
**Last updated:** [April 24, 2023, 1:30pm UTC](https://community.freefem.org/t/convect-with-periodic-boundaries/2399 "2023-04-24T13:30:41Z")

</div>

Hello all, I’m new here but not so new to FreeFem++. I want to implement the convect operator on a periodic function (with a periodic velocity field) in 2d. mesh Th=square(Nx,Ny,\[Lxx,Lyy\]); fespace Den(Th,P2,periodic=…

---

## [Moving phase boundary electrochemical etching](https://community.freefem.org/t/moving-phase-boundary-electrochemical-etching/2414)

<div class="topic-metadata">

**Author:** [@marchywka](https://community.freefem.org/u/marchywka)\
**Replies:** 0\
**Last updated:** [April 23, 2023, 12:31am UTC](https://community.freefem.org/t/moving-phase-boundary-electrochemical-etching/2414 "2023-04-23T00:31:19Z")

</div>

I was just curious if anyone had any particular thoughts on FF features related to this exercise. It is nominally anodic etching of a metal with a normalized/fictional Butler-Volmer equation for now. The initial equill…

---

## [Closing an output file steam - does it need to be flushed?](https://community.freefem.org/t/closing-an-output-file-steam-does-it-need-to-be-flushed/2413)

<div class="topic-metadata">

**Author:** [@marchywka](https://community.freefem.org/u/marchywka)\
**Replies:** 0\
**Last updated:** [April 22, 2023, 10:51am UTC](https://community.freefem.org/t/closing-an-output-file-steam-does-it-need-to-be-flushed/2413 "2023-04-22T10:51:41Z")

</div>

I was using this macro without the flush but the last value in the last line was missing sometimes. On a quick check, adding the flush may have fixed it. This looks like a problem with the ofstream flushing when desto…

---

## [Neumann B.C. with dependance on value at boundary](https://community.freefem.org/t/neumann-b-c-with-dependance-on-value-at-boundary/2179)

<div class="topic-metadata">

**Author:** [@Lysandros](https://community.freefem.org/u/Lysandros)\
**Replies:** 3\
**Last updated:** [April 21, 2023, 7:49am UTC](https://community.freefem.org/t/neumann-b-c-with-dependance-on-value-at-boundary/2179 "2023-04-21T07:49:47Z")

</div>

Dear all, I am trying to implement a boundary condition where the rate of change of my function at the boundary depends on the value of the function at this boundary in a nonlinear way. How can I implement his? As far …

---

## [How to rotate strain field?](https://community.freefem.org/t/how-to-rotate-strain-field/2409)

<div class="topic-metadata">

**Author:** [@Keita](https://community.freefem.org/u/Keita)\
**Replies:** 1\
**Last updated:** [April 21, 2023, 6:55am UTC](https://community.freefem.org/t/how-to-rotate-strain-field/2409 "2023-04-21T06:55:50Z")

</div>

Hi, developpers!! I’m wondering how to rotate the strain field. Is it possible? I asked this question because I stumbled upon it. I would appreciate it if you could tell me how to do this.

---

## [How to import (3D) STL file(s) to define volume boundary mesh?](https://community.freefem.org/t/how-to-import-3d-stl-file-s-to-define-volume-boundary-mesh/1971)

<div class="topic-metadata">

**Author:** [@JuillenL](https://community.freefem.org/u/JuillenL)\
**Replies:** 3\
**Last updated:** [April 20, 2023, 8:45am UTC](https://community.freefem.org/t/how-to-import-3d-stl-file-s-to-define-volume-boundary-mesh/1971 "2023-04-20T08:45:20Z")

</div>

Hello I am a newcomer to FreeFem++… I would like to know if there are existing commands/operators to import directly a 3D STL files that would contain the external boundary of a volume/3D domain ? If no, what would be…

---

## [Adding a "sheet charge" to a volume charge distribution](https://community.freefem.org/t/adding-a-sheet-charge-to-a-volume-charge-distribution/2401)

<div class="topic-metadata">

**Author:** [@marchywka](https://community.freefem.org/u/marchywka)\
**Replies:** 1\
**Last updated:** [April 19, 2023, 4:32pm UTC](https://community.freefem.org/t/adding-a-sheet-charge-to-a-volume-charge-distribution/2401 "2023-04-19T16:32:37Z")

</div>

I could post some code but thought it may be less confusing to just describe the objective and see if anyone can point to a specific example that may be useful. I am doing an “electropolishing” exercise where I have …

---

## [Running Matlab script from Freefem](https://community.freefem.org/t/running-matlab-script-from-freefem/2406)

<div class="topic-metadata">

**Author:** [@luca.liverotti](https://community.freefem.org/u/luca.liverotti)\
**Replies:** 1\
**Last updated:** [April 19, 2023, 3:12pm UTC](https://community.freefem.org/t/running-matlab-script-from-freefem/2406 "2023-04-19T15:12:12Z")

</div>

Hi, I should run a matlab script from Freefem. I read that is possible run terminal command in Freefem by using exec(…) or system(…). Anyway, I have problems with the launch of a matlab script by terminal. I tried exe…

---

## [Stokes PETSC solver but in a doubled-size space](https://community.freefem.org/t/stokes-petsc-solver-but-in-a-doubled-size-space/2389)

<div class="topic-metadata">

**Author:** [@yongxing](https://community.freefem.org/u/yongxing)\
**Replies:** 12\
**Last updated:** [April 13, 2023, 11:20am UTC](https://community.freefem.org/t/stokes-petsc-solver-but-in-a-doubled-size-space/2389 "2023-04-13T11:20:40Z")

</div>

Dear all I learnt from https://github.com/mbarzegary/navier-stokes-solver an efficient @prj @mojtaba.barzegari an efficient PETSC solver for Stokes solution \[u, v, w, p\] in FEM space \[P2, P2, P2, P1\]: set(A, sparams …

---

## [Moving mesh FreeFEM with PETSc](https://community.freefem.org/t/moving-mesh-freefem-with-petsc/2386)

<div class="topic-metadata">

**Author:** [@Stone](https://community.freefem.org/u/Stone)\
**Replies:** 2\
**Last updated:** [April 9, 2023, 1:45pm UTC](https://community.freefem.org/t/moving-mesh-freefem-with-petsc/2386 "2023-04-09T13:45:03Z")

</div>

Hi, Does anyone know if FreeFEM with PETSc supports moving mesh? Does FreeFEM have similar cases? Thanks

---

## [Memory Leak Issue with ff-mpirun](https://community.freefem.org/t/memory-leak-issue-with-ff-mpirun/2369)

<div class="topic-metadata">

**Author:** [@sruget](https://community.freefem.org/u/sruget)\
**Replies:** 20\
**Last updated:** [April 6, 2023, 3:23pm UTC](https://community.freefem.org/t/memory-leak-issue-with-ff-mpirun/2369 "2023-04-06T15:23:19Z")

</div>

Hi, As I was looking for a memory leak in my code using valgrind, I found an issue and unfortunately was not able to understand it. Here is this issue. I take the simplest code one can write, it just prints “Hello worl…

---

## [Obtain Eigenvectors using SLEPc parallely](https://community.freefem.org/t/obtain-eigenvectors-using-slepc-parallely/2379)

<div class="topic-metadata">

**Author:** [@zhugp123](https://community.freefem.org/u/zhugp123)\
**Replies:** 5\
**Last updated:** [April 5, 2023, 4:10pm UTC](https://community.freefem.org/t/obtain-eigenvectors-using-slepc-parallely/2379 "2023-04-05T16:10:12Z")

</div>

Dear FreeFEM Developer, I try to solve the following eigenvalue problem using SLPEc parallelly. The FE space for \[u, v, p\] is fespace Xh(Th, \[P2, P2, P1\]); Note that the variables U and V are independent of spati…

---

## [2D iovtk Files corrupted](https://community.freefem.org/t/2d-iovtk-files-corrupted/80)

<div class="topic-metadata">

**Author:** [@riahi](https://community.freefem.org/u/riahi)\
**Replies:** 5\
**Last updated:** [April 5, 2023, 5:49am UTC](https://community.freefem.org/t/2d-iovtk-files-corrupted/80 "2023-04-05T05:49:47Z")

</div>

Dear FF+±Users & Developers, I’m facing an issue with iovtk 2d where both binary and ASCII files are corrupted. Paraview is unable to read correctly the files. I have used version ff++3.36 ff+±4.0 on Ubuntu and MacOS a…

---

## [Compute Hdiv norm for RT elements](https://community.freefem.org/t/compute-hdiv-norm-for-rt-elements/2247)

<div class="topic-metadata">

**Author:** [@larismartins](https://community.freefem.org/u/larismartins)\
**Replies:** 16\
**Last updated:** [April 4, 2023, 9:20am UTC](https://community.freefem.org/t/compute-hdiv-norm-for-rt-elements/2247 "2023-04-04T09:20:02Z")

</div>

Hi there, I couldnt find anything regarding the Hdiv norm for a RT element in the documentation. Can someone help?

---

## [More coding questions using one BC in different location,](https://community.freefem.org/t/more-coding-questions-using-one-bc-in-different-location/2376)

<div class="topic-metadata">

**Author:** [@marchywka](https://community.freefem.org/u/marchywka)\
**Replies:** 0\
**Last updated:** [April 3, 2023, 9:20pm UTC](https://community.freefem.org/t/more-coding-questions-using-one-bc-in-different-location/2376 "2023-04-03T21:20:23Z")

</div>

I have several questions but the most important is if this picture looks like artifacts or some well known programming mistake. Briefly this is supposed to be poynting vector with a source square and a higher dielectr…

---

## [Some questions on boarders](https://community.freefem.org/t/some-questions-on-boarders/2375)

<div class="topic-metadata">

**Author:** [@marchywka](https://community.freefem.org/u/marchywka)\
**Replies:** 1\
**Last updated:** [April 3, 2023, 8:51pm UTC](https://community.freefem.org/t/some-questions-on-boarders/2375 "2023-04-03T20:51:58Z")

</div>

I think I got a few simple concepts confused although the code below will eventually do what I need, I’m not sure it is the best way to do. Any comments? Thanks. load "isoline" load "medit" // What does "Curve()" ret…

---

## [Creata a 'Mat' with all componets are zero PETSc](https://community.freefem.org/t/creata-a-mat-with-all-componets-are-zero-petsc/2374)

<div class="topic-metadata">

**Author:** [@Stone](https://community.freefem.org/u/Stone)\
**Replies:** 2\
**Last updated:** [April 3, 2023, 4:21pm UTC](https://community.freefem.org/t/creata-a-mat-with-all-componets-are-zero-petsc/2374 "2023-04-03T16:21:41Z")

</div>

Hi, I am leanring to develop a code using FreeFEM with PETSc. I just met a problem that is to create a ‘Mat’ type matrix with all components being zero. My solution is int N = 200; real\[int, int\] A(N, N); A = 0.; m…

---

## [Inverting a matrix object?](https://community.freefem.org/t/inverting-a-matrix-object/2362)

<div class="topic-metadata">

**Author:** [@Neutrino](https://community.freefem.org/u/Neutrino)\
**Replies:** 7\
**Last updated:** [April 3, 2023, 3:45pm UTC](https://community.freefem.org/t/inverting-a-matrix-object/2362 "2023-04-03T15:45:59Z")

</div>

Hi there, I’m not sure if this has been answered before, and probably seems like a trivial question, but suppose that I have the following code varf a(u,v) = int2d(Th)(dx(u)\*dx(v) + dy(u)\*dy(v)); matrix K = a(Vh,Vh); a…

---

## [Load function values from the file](https://community.freefem.org/t/load-function-values-from-the-file/2372)

<div class="topic-metadata">

**Author:** [@Anita](https://community.freefem.org/u/Anita)\
**Replies:** 1\
**Last updated:** [April 2, 2023, 9:12pm UTC](https://community.freefem.org/t/load-function-values-from-the-file/2372 "2023-04-02T21:12:06Z")

</div>

I’m trying to solve the system of equations where for one of the functions (actually velocity vector) I got values calculated outside FF. To simplify lets imagine I’ve rectangular mesh size 10x20 and got file with vecto…

---

## [Changing Matrix components PETSc Parallel](https://community.freefem.org/t/changing-matrix-components-petsc-parallel/2367)

<div class="topic-metadata">

**Author:** [@zhugp123](https://community.freefem.org/u/zhugp123)\
**Replies:** 10\
**Last updated:** [April 2, 2023, 8:25am UTC](https://community.freefem.org/t/changing-matrix-components-petsc-parallel/2367 "2023-04-02T08:25:06Z")

</div>

Dear FreeFEM developers: I was converting the code to a parallel version using PETSc, but I found that the number of matrix components changed with the number of processors I used. The test code and results are shown be…

---

## [Laplace value in freefem](https://community.freefem.org/t/laplace-value-in-freefem/2371)

<div class="topic-metadata">

**Author:** [@zese](https://community.freefem.org/u/zese)\
**Replies:** 1\
**Last updated:** [April 2, 2023, 7:58am UTC](https://community.freefem.org/t/laplace-value-in-freefem/2371 "2023-04-02T07:58:09Z")

</div>

Dear all I have the values for (Ux,Ur,Utheta) and I want to calculate ((1/Re)Laplace(U)) for axisymmetric geometry. because of having y^2 as the denominator, its calculation is difficult. I wanted to use the following …

---

## [Cylindrical coordinate for flow simulation](https://community.freefem.org/t/cylindrical-coordinate-for-flow-simulation/1941)

<div class="topic-metadata">

**Author:** [@zese](https://community.freefem.org/u/zese)\
**Replies:** 3\
**Last updated:** [April 2, 2023, 7:07am UTC](https://community.freefem.org/t/cylindrical-coordinate-for-flow-simulation/1941 "2023-04-02T07:07:50Z")

</div>

Dear all I want to solve a flow inside a pipe in 3D and I have (r,theta,z) as my coordinate. how I can define d/dtheta or d/dr in freefem? BR

---

## [Modal analysis using cylindrical coordinates](https://community.freefem.org/t/modal-analysis-using-cylindrical-coordinates/2366)

<div class="topic-metadata">

**Author:** [@Markov](https://community.freefem.org/u/Markov)\
**Replies:** 4\
**Last updated:** [March 31, 2023, 7:49am UTC](https://community.freefem.org/t/modal-analysis-using-cylindrical-coordinates/2366 "2023-03-31T07:49:25Z")

</div>

Hello, I’m trying to find the natural frequencies of a structure that is an axisymmetric cut of a circular disc. I wrote the FreeFem code using cylindrical coordinates, but the results are different compared to the full…

---

## [Code for Q1 element for elliptic equation](https://community.freefem.org/t/code-for-q1-element-for-elliptic-equation/2368)

<div class="topic-metadata">

**Author:** [@ogabic](https://community.freefem.org/u/ogabic)\
**Replies:** 1\
**Last updated:** [March 31, 2023, 6:50am UTC](https://community.freefem.org/t/code-for-q1-element-for-elliptic-equation/2368 "2023-03-31T06:50:25Z")

</div>

Hi all , please I’m looking for a code for the rectangle Q1 finite element method ( rectangle mesh) for the following poisson equation e\*dx^2 u + dy^2 u = f with Dirichlet boundary condition on a square (0,1)x(0,1) Whe…

---

## [Changing mesh name from Th to Th3 appears to generate problems](https://community.freefem.org/t/changing-mesh-name-from-th-to-th3-appears-to-generate-problems/2364)

<div class="topic-metadata">

**Author:** [@marchywka](https://community.freefem.org/u/marchywka)\
**Replies:** 3\
**Last updated:** [March 30, 2023, 4:23pm UTC](https://community.freefem.org/t/changing-mesh-name-from-th-to-th3-appears-to-generate-problems/2364 "2023-03-30T16:23:23Z")

</div>

I’m trying to convert some code to use PETSc. I tried to copy an example but got various compile errors and then seg faults at run time. I isolated a problem upstream but have not verified to is a problem later. At is…

---

## [2D Gmsh mesh saved/recognized as 3D mesh](https://community.freefem.org/t/2d-gmsh-mesh-saved-recognized-as-3d-mesh/2357)

<div class="topic-metadata">

**Author:** [@etj](https://community.freefem.org/u/etj)\
**Replies:** 7\
**Last updated:** [March 30, 2023, 12:51pm UTC](https://community.freefem.org/t/2d-gmsh-mesh-saved-recognized-as-3d-mesh/2357 "2023-03-30T12:51:13Z")

</div>

Hello, I am trying to build a simple 2D mesh with Gmsh and use it in FreeFem. I save the mesh with File → Export → Mesh - INRIA Medit (\*.mesh), with “Physical entities” and “Save all elements” checked. I obtain a mesh …

---

## [How to write Neumann and mixed conditions in Freefem++?](https://community.freefem.org/t/how-to-write-neumann-and-mixed-conditions-in-freefem/2363)

<div class="topic-metadata">

**Author:** [@Ali\_Changezi](https://community.freefem.org/u/Ali_Changezi)\
**Replies:** 1\
**Last updated:** [March 30, 2023, 12:12pm UTC](https://community.freefem.org/t/how-to-write-neumann-and-mixed-conditions-in-freefem/2363 "2023-03-30T12:12:39Z")

</div>

I am not sure whether this question is addressed earlier or not. Actually i want to know how shall i write the Neumann and Mixed boundary conditions in Freefem++? T.I.A

---

## [Error (no connexe boundary be careful with internal boundary (pb of sens) ) : nb start = 2](https://community.freefem.org/t/error-no-connexe-boundary-be-careful-with-internal-boundary-pb-of-sens-nb-start-2/2356)

<div class="topic-metadata">

**Author:** [@yongxing](https://community.freefem.org/u/yongxing)\
**Replies:** 1\
**Last updated:** [March 30, 2023, 12:09pm UTC](https://community.freefem.org/t/error-no-connexe-boundary-be-careful-with-internal-boundary-pb-of-sens-nb-start-2/2356 "2023-03-30T12:09:06Z")

</div>

Does anyone have an idea what’s going wrong? The first remeshing works perfectly fine, but the second time of remeshing shows the this error; error (no connexe boundary be careful with internal boundary (pb of sens) )…

---

## [Why this code cause an error message](https://community.freefem.org/t/why-this-code-cause-an-error-message/2361)

<div class="topic-metadata">

**Author:** [@cfdyuewu](https://community.freefem.org/u/cfdyuewu)\
**Replies:** 2\
**Last updated:** [March 30, 2023, 12:01pm UTC](https://community.freefem.org/t/why-this-code-cause-an-error-message/2361 "2023-03-30T12:01:58Z")

</div>

load "iovtk" verbosity=0; // Parameters int nn = 15; int nnPlus = 5; real l = 1.; real L = 15.; real hSlope = 0.1; real H = 6.; real h = 0.5; real beta = 0.01; real eps = 9.81/303; real nu = 1.; real numu = nu/sqrt(0.0…

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

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