Fujiwara

Last modified : 19 Dec. 2021.

Contents in this page are provided with no warranties and no liability. The original site is here.

Patches

PDF/SVG output by built-in plot() command

This patch adds PDF and SVG output function to the built-in plot() command which can generate only PostScript files as default.

  • FreeFem-sources-4.10-pdf.patch

    • patch application: tar zxf FreeFem-sources-4.10.tar.gz && cd FreeFem-sources-4.10 && patch -c -p1 < FreeFem-sources-4.10-pdf.patch

    • usage: plot( ..., pdf="filename.pdf", svg="filename.svg" );

PETSc patch

FreeFEM-4.10 automatically downloads/compiles/includes PETSc Ver3.16.1 by configuration. However, I met an error on Linux (Ubuntu 20.04.3) such as:

/usr/bin/ld: .../FreeFem-sources-4.10/3rdparty/ff-petsc/petsc-3.16.1/fc/lib/libpetsc.so: undefined reference to `GOMP_loop_nonmonotonic_guided_start'

/usr/bin/ld: .../FreeFem-sources-4.10/3rdparty/ff-petsc/petsc-3.16.1/fc/lib/libpetsc.so: undefined reference to `omp_get_max_threads'


(in FreeFem-sources-4.10/3rdparty/ff-petsc/petsc-3.16.1/fc/externalpackages/git.slepc/installed-arch-linux2-c-opt-complex/lib/slepc/conf/configure.log)

This patch modifies some options in order to compile it with PETSc.

  • FreeFem-sources-4.10-petsc.patch

    • patch application: tar zxf FreeFem-sources-4.10.tar.gz && cd FreeFem-sources-4.10 && patch -c -p1 < FreeFem-sources-4.10-petsc.patch

    • After executing the configure script, cd 3rdparty/ff-petsc && make petsc-slepc

Dynamic Loading Modules

plotPDF : Save Numerical Solutions/Mesh/Indices to PDF file

As default, FreeFEM uses text file and PostScript to store mesh and numerical results respectively. This module enables us to store them in a single PDF file. Both contours drawing and fill-style output of P0/P1/P1nc/P2 finite elements solutions are available. Meshes are drawn with/without indices (vertex, element, and edge, and boundary labels).

  • plotPDF-20211219.cpp

    • compile: ff-c++ -std=c++11 -DHAVE_ZLIB plotPDF.cpp -lz

    • compile (in Windows with MSYS2-x86_64): ff-c++ -static -DHAVE_ZLIB plotPDF.cpp -lz

    • install (in Windows): put plotPDF.dll (ver. 2021/12/19) into C:\Program Files (x86)\FreeFem++, where you installed FreeFEM. (The DLL file is compiled with MSYS2 with zlib. It should be distributed under their licenses.)

    • usage:

        • bool plotPDF( mesh Th, PDFFilename [, options] );

        • bool plotPDF( Vh u, mesh Th, PDFFilename [, options] );

        • bool plotPDF( Vh<complex> u, mesh Th, PDFfilename [, options] );

        • bool plotPDF( [Vh u, Vh v], mesh Th, PDFFilename [, options] );

    • options and plotPDF-sample.edp

    • Slide, FreeFEM Days 2020 Dec.11, 2020.

plotGnuplot : Save 2D Numerical Solution for gnuplot

A data file which gnuplot can use in 'splot' is generated by this module.

Element_CR : Crouzeix-Raviart Element in 2D,3D

Crouzeix-Raviart Element, known as one of "Non-conforming Finite Elements"

SaveHB : Save System of Linear Equations in Harwell-Boeing format

Harwell-Boeing is one of popular formats to store a system linear equations. Since it is available in various software e.g. in Matlab, NAG Library, and SparseLib++, users can use favorite environments in order to solve and to examine properties of linear systems discretized with FreeFEM.

EDPs

Shepp-Logan Phantom