GithubHelp home page GithubHelp logo

freefem / freefem-doc Goto Github PK

View Code? Open in Web Editor NEW
124.0 15.0 43.0 247.63 MB

FreeFEM user documentation

Home Page: https://doc.freefem.org

License: Other

Python 2.15% Makefile 0.14% Batchfile 0.12% CSS 5.42% JavaScript 86.56% HTML 4.87% C 0.26% Gnuplot 0.27% MATLAB 0.22%
finite-element-methods finite-element-analysis finite-elements simulation-framework freefem-doc freefem

freefem-doc's Introduction

Doc build (HTML & PDF)

FreeFEM documentation

The FreeFEM documentation is a collaborative effort. We welcome all contributions, do not hesitate to submit a pull request.

View the documentation

Visit the Documentation website or download the PDF. The PDF is re-generated automatically after each GitHub commit.

Install the documentation

FreeFEM-doc uses Sphinx, have a look at the sphinx installation

How to contribute

Have a look at the contributing file

freefem-doc's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

freefem-doc's Issues

Change toggle key between documentation and example search to something different from Ctrl

Is your feature request related to a problem? Please describe.

I am a new user of FreeFem and currently onboarding myself to the language by studying the documentation + examples which are impressive and go into great depth!

I often find myself using Ctrl + F to search within the current page (or Ctrl + C to copy a line of text) but this also triggers the "toggle between documentation and example search" behavior if F (C) is pressed too "late". While mostly a slight annoyance, I think switching to a different key for this toggle would improve the user experience a lot.

Describe the solution you'd like
The toggle key switched from Ctrl to Alt for example.

1.9.4 Coloring Syntax FreeFem++ / Atom

I need to work on Windows 11 :-(

About 1.9.4 Coloring Syntax FreeFem++ / Atom

  1. I downloaded and installed Atom (1.60.0 x64), but I cannot find the Edit -> Preferences -> Install menu path mentioned in pdf doc:
    AtomEdit

  2. clicking on FreeFEM language support and then on Install button, nothing happens though I've already installed Atom
    Atom2

Suggested amendments to the documentation

Hello,
I would like to report these bugs I found in version 4.0 documentation.
The page number refers to the number you find on the bottom right corner of each page.

page 150: text out of bounds
page 180: bc[] is not defined
page 517: the paper you should refer to is the one by Hintermuller, Ito and Kunisch (see the file VI.edp)

Thanks and best regards,

Paolo

Correct the documentation on Raviart-Thomas element

The documentation on Raviart-Thomas element section 3.3.10 has some mistakes/incompleteness

-- The formula giving fh=f_h(x,y) has some typo: the last term \phi_{i_lj_l} should be replaced by \phi_{i_l}^k

-- The comments explain the orientation of the edges: from small to large indices of the vertices.
"for example we can" should be replaced by just "we"
Once the edge is oriented, we must give the orientation of the normal n_e, which is not said.
I propose to insert "Then the normal $n_e$ is oriented so as to point to the right with respect to the direction of the edge". This is coherent with the boundary convention of FreeFem : the domain is on the left, and here it means that the normal will be external on the boundary of the domain (if the boundary vertices are labeled increasingly in counterclock sense).
This choice of orientation corresponds to what I observe when I use RT0 in my FreeFem codes, with regards to the fact that according to the definition of the dof, one must have phi_i^k(m_i)\cdot n_i > 0.
If you take in the code the basis function and you take the scalar product with the normal, you see according to the sign of the result and the indices of the two vertices that the above orientation is the one that is set in FreeFem. Fig 3.35 illustrates the case i_c<i_a<i_b.
In consequence we see that the formulas for the basis functions phi_i^k in the documentation have a WRONG SIGN: there should be a minus in front of each of the three formulas.

Problems compiling on Arch

@FreeFem/documenters
Sorry if this is the inappropriate place or way to complain, but i had some problems compiling Freefem++ on arch (Manjaro to be exact).
the error occured after the "./reconfigure" step
expected behaviour:
"make" causes freefem to compile
actual behaviour:
there is a "missing seperator" error and the compilation stopped after the command "make" is execured.

i think i solved the issue, by removing all lines that only said "dir" from all files called "Makefile" since this line caused the error. to my very limited knolege of makefiles this line made no sence there. here is a INCOMPLETE list of places this line occured:
File Line String
./examples++-eigen/Makefile 396 dir
./examples++-mpi/Makefile 419 dir
./examples++-tutorial/Makefile 398 dir
./examples++/Makefile 398 dir
./examples++-load/Makefile 437 dir
./examples++-hpddm/Makefile 419 dir
./examples++-chapt3/Makefile 398 dir
./src/bamglib/Makefile 199 dir
./src/Makefile 257 dir
./src/Algo/Makefile 199 dir
./src/bamg/Makefile 237 dir
./src/mpi/Makefile 275 dir
./src/lglib/Makefile 253 dir
./src/fflib/Makefile 277 dir
./src/medit/Makefile 254 dir
./src/bin-win32/Makefile 192 dir
./src/femlib/Makefile 199 dir
./src/Graphics/Makefile 192 dir
./src/nw/Makefile 268 dir
./examples++-other/Makefile 396 dir
./examples++-bug/Makefile 194 dir
./examples++-3d/Makefile 398 dir

edit this still did not work, compilation failed after some time with the following error:

gfortran -O -g -DNDEBUG -O3 -mmmx -msse4.2 -fPIC -I/home/moritz/FreeFem-sources/download//include/scotch -Dscotch -Dpord -I. -I../include -c mumps_static_mapping.F -o mumps_static_mapping.o
mumps_static_mapping.F:3945: Error: Can't open included file 'mpif.h'

FreeFem + Paraview

I use the version v4.5 of FreeFem++.
When I run this small part of code:
****** BEGIN ******
load "medit"
load "msh3"
load "iovtk"
mesh3 Th = cube(10, 10, 10);
savemesh(Th,"test.mesh");
mesh3 Th2;
Th2 = readmesh3("test.mesh");
savevtk("test.vtk",Th);
savevtk("test2.vtk",Th2);
****** END ******
Both files test.vtk and test2.vtk can not be opened by Paraview (version 5.8.0).
It works with 2D mesh (and with surface mesh) but not with 3D mesh.
Thank you very much for your help.

Eigen problem

Hi,
I have to solve eigen value problems, so I first try to solve a validation example... But it does not work.

Expected behavior
I take a diagonal matrix (4x4) with 4 distinct integers on diagonal, then I use the "EigenValue" function following the help page (https://doc.freefem.org/models/eigen-value-problems.html).
So I expect to find 4 eigen values/vectors, but the function only returns the 3 highest ones.
I try to grow in dimension, but the function always returns the (n-1) highest eigen values.

The code for the example :
`matrix A =
[ [4, 0, 0, 0],
[0, 3 ,0 ,0],
[0, 0, 2, 0],
[0, 0, 0, 5] ];
set(A, solver=UMFPACK);

cout << A << endl;
matrix B =
[ [1, 0, 0, 0],
[0, 1 ,0 ,0],
[0, 0, 1, 0],
[0, 0, 0, 1] ];
set(B, solver=UMFPACK);

// Solve
int Nev = 4 ;
real[int] ev(Nev); //to store eigen values
real[int,int] Vec(Nev,Nev); //to store eigen vectors

int k = EigenValue(A, B, sym=true, value=ev, rawvector=Vec, nev=Nev, maxit=0, ncv=0);
cout << k ;
cout << " vp : " << ev << endl;
cout << " Vp : " << Vec << endl;
`

I try multiple parameters, but I still don't know why it is not working.

Desktop :

  • OS: Ubuntu 18.04
  • Freefem version : v4.4.2

Thank you for your help,
Pierre.

autoreconf error

Hi,

I have downloaded the source from Git, but when I type autoreconf -i, I get the following error message:

$ autoreconf -i
configure.ac:1110: warning: file `etc/config/m4/acmpi.m4' included several times
configure.ac:1185: warning: file `etc/config/m4/acmpi.m4' included several times
configure.ac:1110: warning: file `etc/config/m4/acmpi.m4' included several times
configure.ac:1185: warning: file `etc/config/m4/acmpi.m4' included several times
configure.ac:1110: warning: file `etc/config/m4/acmpi.m4' included several times
configure.ac:1185: warning: file `etc/config/m4/acmpi.m4' included several times
Useless use of /d modifier in transliteration operator at /local/software/automake/bin/automake line 5278.
configure.ac: 43: `automake requires `AM_CONFIG_HEADER', not `AC_CONFIG_HEADER'
automake: configure.ac: `AM_INIT_AUTOMAKE' must be used
automake: configure.ac: installing `./install-sh'
automake: configure.ac: installing `./mkinstalldirs'
automake: configure.ac: installing `./missing'
automake: Makefile.am: installing `./INSTALL'
automake: Makefile.am: required file `./NEWS' not found
automake: Makefile.am: required file `./README' not found
automake: Makefile.am: installing `./COPYING'
automake: Makefile.am: required file `./ChangeLog' not found
automake: configure.ac: installing `./depcomp'
src/bamg/Makefile.am: invalid unused variable name: `HDF5_LDFLAGS'
src/fflib/Makefile.am:99: AM_CPPFLAGS was already defined in condition TRUE, which implies condition ENABLE_EIGEN_TRUE

  AM_CPPFLAGS (User, where = 99) +=
  {
    TRUE => -I$(srcdir)/../lglib -I$(srcdir)/../bamglib -I$(srcdir)/../Graphics -I$(srcdir)/../femlib $(HDF5_CPPFLAGS) $(UMFPACK_CPPFLAGS)
  }
src/mpi/Makefile.am:34: variable `MPISCRIPT' not defined
autoreconf: automake failed with exit status: 1

Can you please assist? I've Googled around and cannot find any answer.

Thanks in advance,

3D elasticity complex with mixed elements

3D elasticity complex with mixed elements with weak symmetry enforcement

(only "primal" method, based on only displacement dofs, is demonstrated in Freefem documentation)

Describe the solution you'd like
Would like to see Nedelec type II (linear face elements) for the elasticity complex in 3D.

Or better, actually all of these:
https://web.archive.org/web/20190325195633/http://femtable.org/femtable.pdf

Below is lowest order elasticity complex with mixed elements with weak symmetry, enforced by Lagrange multipliers. Literature ref:
https://www.doi.org/10.1007/0-387-38034-5_3

Below is 2D example:
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


load "Element_Mixte";

int nn=5;
mesh Th= square(4*nn,nn,[4*x,y]);
fespace Vh(Th, [BDM1,BDM1,P0,P0,P0]);

real young=2;
real nu=0.3;

real mu=young/2/(1+nu);
real lambda=young*nu/(1+nu)/(1-2*nu);

real mu1= 0.5/mu;
real lambda1 = -mu1*lambda/(2*lambda+2*mu);
real rho = 1;
real gravity = -1*rho;
 
Vh [usxx,usyx,usxy,usyy,ux,uy,up],[vsxx,vsyx,vsxy,vsyy,vx,vy,vp];
solve fld([usxx,usyx,usxy,usyy,ux,uy,up],[vsxx,vsyx,vsxy,vsyy,vx,vy,vp])
  = int2d(Th)((mu1+lambda1)*usxx*vsxx+mu1*usxy*vsxy+mu1*usyx*vsyx+(mu1+lambda1)*usyy*vsyy+lambda1*usxx*vsyy+lambda1*usyy*vsxx+ux*(dx(vsxx)+dy(vsyx))+uy*(dx(vsxy)+dy(vsyy))+(dx(usxx)+dy(usyx))*vx+(dx(usxy)+dy(usyy))*vy+(usxy-usyx)*vp+up*(vsxy-vsyx)  
  )
  +  int2d(Th) ( -gravity*vy)
  +on(1,2,3,usxx=0,usyx=0,usxy=0,usyy=0)
 //+on(4,ux=0,uy=0)
  ;
 plot(ux, wait=1);
 mesh th = movemesh(Th, [x+0.001*ux, y+0.001*uy]);
plot(th, wait=true);

error in doc for transpose

I think there is an error on the definition of transpose in the documentation.

It is indicated that the operator ' returns the transpose, and '' the hermitian transpose.

In my version of FreeFem++ (3.610001), the operator ' returns the transpose if the matrix is real, and hermitian transpose if the matrix is complex. This behavior is observed both for matrix and complex[int,int] types.

The operator '' is not recognized.

Advertise on FreeFEM application

Is your feature request related to a problem? Please describe.
After submission of a paper, the publisher rejected my publication on the basis that FreeFEM was not applicable to superconducting circuits only when "dimensions >> coherence length and London penetration depth". I strongly disagree with this statement and I don't know where it comes from.

Describe the solution you'd like
I suggest to add in the examples of the documentation (and manual) a small example (e.g. provided at this end of this message).

Describe alternatives you've considered
Emphasize the application to superconducting circuits by giving references to published papers (e.g. Mikhail Khapaev, M. Yu. Kupriyanov, Sergey Bakurskiy, N. V. Klenov and I.I. Soloviev, "Modeling Superconductor SFN-Structures Using the Finite Element Method" in Differential Equations 56(7):959-967 (July 2020) DOI:10.1134/S0012266120070149).

`// Far field vector potential identical if created by infinite length (along z) filament:

// A=Az0*log(r/r0);
// The superconductor is a single strip with rounded edges (line 26)
real W=25,large=50,loin=500,haut=300, e=2; // linear dimensions (in µm)
real l2= 0.09; // Lambda2 =0.3² is the square of the London penetration depth
bool debug=true;

border bottom(t=-loin,loin) { x=t; y=-haut; label=1; }
border coted(t=-haut,haut) { x=loin; y=t; label=1; }
border coteg(t=haut,-haut) { x=-loin; y=t; label=1; }
border dessus(t=loin,-loin) { x=t; y=haut; label=1; }

border bo(t=-5*W,5*W) { x=t; y=-5*W; label=2; }
border cd(t=-5*W,5*W) { x=5*W; y=t; label=2; }
border cg(t=5*W,-5*W) { x=-5*W; y=t; label=2; }
border de(t=5*W,-5*W) { x=t; y=5*W; label=2; }

mesh Th1=buildmesh(bottom(26)+coted(16)+dessus(26)+coteg(16)+bo(-201)+cd(-121)+de(-201)+cg(-121));
mesh Th2=buildmesh(bo(201)+cd(121)+de(201)+cg(121));
mesh Th=Th1+Th2;
plot(Th,ps="flux_focus_fullstrip.eps",bw=1, wait=true);

fespace Vh(Th,P2);
Vh Aphi, v;
func f=-1/l2*((abs(x)<W-e)*(abs(y)<e)+(x>=W-e)*((x-W+e)^2+y^2<e)+(x<=W-e)*((x+W-e)^2+y^2<e)); // in the superconductor only

problem poissonMagneto(Aphi,v) =
int2d(Th)( dx(Aphi)*dx(v) + dy(Aphi)*dy(v) )
+ int2d(Th) ( -v*Aphi*f ) // the source term: Mu0*J=-Aphi/l2 in the superconductor only
+ on(1, Aphi=log(x*x +y*y)); // far away
poissonMagneto;
plot(Aphi, ps="vector_potential_fullstrip.eps", value=true, wait=debug);
`

Add detailed explanation on the typeOfFE::Data

Is your feature request related to a problem? Please describe.

I want to add a new element to FreeFem. Defining interpolation points and associated vertex/edge/element is quite straightforward from the current documentation.
However, the definition of typeOfFE::Data is not well documented.
According to the documentation, it should be 5*NbDoF + N where the first 5 NbDoF elements are
(1) (NbDoF) the support of the node of the df (maybe for unique id?)
(2) (NbDoF) the number of the df on the node
(3) (NbDoF) the node of the df (not sure what this means)
(4) (NbDoF) the df come from which FE (also not sure)
(5) (NbDoF) which are the df on sub FE (...)
(6) (N) no explanation

Also, I found that, in the source code, P1Lagrange and P2Lagrange have 3*5 + 3 and 6*5 + 3, respectively.
This does not match with the documentation since N=1 as they are scalar spaces.
image

Describe the solution you'd like
Can anyone add more detailed explanation about the typeOfFE::Data

Describe alternatives you've considered

Additional context

Small typo in documentation

The documentation for Free boundary problems shows this code at the top

// Parameters
real L = 10; //length
real hr = 2.1; //left height
real hl = 0.35; //right height
int n = 4;

I believe the left and right height variable names are swapped.

Add documentation on logical operators

The manual states

Notice the C++-like syntax; the user needs not study C++ for using FreeFEM, but it helps to guess what is allowed in the language.

and the language goes to great lengths to replicate C++ syntax. Yet, nowhere on an impressive number of PDF pages of documentation it is mentioned that the operators && and || do not use short-circuit evaluation as in C++. One common use case would be to check whether a real variable is zero before division since this results in a runtime error instead of a recoverable infinite value. Therefore I suggest to add a corresponding section in the documentation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.