View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Computation of the Friedrich's, Poincare and Maxwell constants in 2D/3D

Join the 15-year community celebration.

Play games and win prizes!

» Learn more

5.0 | 1 rating Rate this file 3 Downloads (last 30 days) File Size: 59.7 KB File ID: #23991 Version: 2.0
image thumbnail

Computation of the Friedrich's, Poincare and Maxwell constants in 2D/3D


Jan Valdman (view profile)


04 May 2009 (Updated )

Computation of Friedrichs', Poincare and Maxwell constants in 2D/3D from eigenvalue problems.

| Watch this File

File Information

To run the code, type 'start_2D' or 'start_3D' in the MATLAB window.
Mass and stiffness matrices are assembled for nested uniform meshes (triangles in 2D and tetrahedral in 3D) starting from a coarse mesh (level=1 mesh) with few elements and ending up with a finest mesh (level=levels, where levels is predefined) with up to a milion of elements, depending on the memory available.
The Friedrichs', the Poincare and the Maxwell constants are computed from corresponding generalized eigenvalue problems. Their computed values are compared with exact values if these are known (eg. for the unit square domain in 2D and the unit cube domain in 3D) and eigenfunctions are visualized. Domains geometry can be easily changed by modifying input matrices nodes2coords, elems2nodes, dirichlet.
This code generalizes the original computations of the Friedrichs constant explained in the section 3.1. of [1]. The original code to [1] is saved in the 'original_code' folder and can be run as the file 'start_Friedrichs' in the MATLAB window. This code exploits vectorization concepts of FEM assemblies exaplained in [2] and [3] and runs therefore much faster. There will be a separate report explaining analysis and numeric behind a code (in preparation).

[1] Jan Valdman, Minimization of Functional Majorant in A Posteriori Error Analysis based on H(div) Multigrid-Preconditioned CG Method, Advances in Numerical Analysis, vol. 2009, Article ID 164519 (2009)

[2] Talal Rahman, Jan Valdman, Fast MATLAB assembly of FEM matrices in 2D and 3D: nodal elements. Applied Mathematics and Computation 219, 7151–7158 (2013)

[3] Immanuel Anjam, Jan Valdman, Fast MATLAB assembly of FEM matrices in 2D and 3D: Edge elements. Applied Mathematics and Computation 267, 252–263 (2015)

The paper can be downloaded from the author's web


Sparse Null Space And Orthogonal and Fast Assembly Of Stiffness And Matrices In Finite Element Method Using Edge Elements inspired this file.

This file inspired Double Porosity Model.

Required Products MATLAB Compiler
MATLAB release MATLAB 8.4 (R2014b)
MATLAB Search Path
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (1)
13 Jun 2009 Nikola Toljic

Works good.

04 May 2009 1.1


05 May 2009 1.2

description + screenshot

11 Jun 2009 1.3


14 Jun 2009 1.4

Faster performance. Almost scalable generation of stiffness and mass matrices.

22 Jul 2009 1.5

paper citation added

29 Jun 2016 2.0

This is a major update. Features: now both 2D and 3D computations, vectorized assembly of FEM matrices

Contact us