Vectorized 3D mesh refinement and Primal Hybrid FEM

This MATLAB package is developed by N. Harish, G. Sharat , J. Valdman and S. K. Acharya (Date: 01/08/2025).
1 Download
Updated 2 Sep 2025

View License

It is supplement to the paper "Vectorized 3D mesh refinement and implementation
of primal hybrid FEM in MATLAB". The reader should consult that paper for more information.
1. General information on the package
There are two directories when the package is unzipped:
3DPHFEM Elliptic problem with mixed boundary condition
3DUniformRedRefinement
[1]. "Vectorized 3D mesh refinement and implementation of primal hybrid FEM
in MATLAB", N. Harish, G. Sharath, J. Valdman and S. K. Acharya.
The paper [1] presents the overall theory, describes the software package and the examples in detail.
2. Installation Instructions:
i. Unzip Files:
- Download and unzip all the files associated with the package.
ii. Open MATLAB:
- Launch MATLAB on your system.
iii. Set Path:
- Set the proper path to the directory containing the MATLAB modules.
- This ensures that MATLAB can access the required files.
iv. Run the Package:
- With the path properly set, the package is now ready to run.
3. Open the directories
i. 3DPHFEM Elliptic problem with mixed boundary condition Directory:
- Contains MATLAB modules for computing the numerical approximation of a second-order elliptic problem.
- Run "Main.m", which loads initial mesh data from <InitialMesh.m>.
- Volume force and boundary data are provided as M-files: <f.m>, <u_d.m>.
- "StiffMassPH.m" computes stiffness and mass matrices along with the load vector.
- "Multiplier.m" computes the matrix C (Lagrangian multiplier matrix).
- Uses a reduced linear system of equations and Schur Complement method in "Main.m" to calculate a discrete solution
ii. 3DUniformRedRefinement Directory
-Contains MATLAB modules for computing the 3D uniform red refinements.
-Figures 1,2,3 and 5 from paper [1] are visualized
4. Applications
There are two main programs:
Main.m: - Calculates the numerical solution of the 3D second-order general elliptic problem
with mixed boundary conditions. This is based on the lowest-order 3D primal hybrid FEM.
- Three different approaches (Table 3) are followed to calculate the discrete solution:
i. Direct linear solver (mldivide),
ii. Parallel Computing of Schur Complement Method,
iii. Vectorized Schur Complement Method.
- It also calculates the order of convergences with their respective norms listed in Table 4.
RuntimeRefinements.m: Calculates the runtimes listed in Table 1 for the vectorized code of FaceUp.m, NumEdges.m,
EdgeNum2Tetra.m, and RedRefine.m .
5. Switch between solvers mldivide(default backslash), parallel Schur and vectorized Schur
i We prefer you to use MATLAB R2025a,
(1) With parallel computing toolbox,
In Main.m, if we set
solver=[1 1 1] : it run the solvers - default backslash, parallel Schur and vectorized Schur.
solver=[0 1 1] : it run the solvers - parallel Schur and vectorized Schur.
(2) Without parallel computing toolbox,
In Main.m, if we set
solver=[1 0 1] : it run the solvers - default backslash and vectorized Schur.
solver=[0 0 1] : it run the solvers - vectorized Schur.
Note: The inbuilt function pagemldivide used in SchurComplement_vectorization.m file, it will be available from MATLAB R2022a
ii If you are using MATLAB R2020b - R2022a,
(1) With parallel computing toolbox,
In Main.m, if we set
solver=[1 1 0] : it run the solvers - default backslash and parallel Schur.
solver=[0 1 0] : it run the solvers - parallel Schur.
(2) Without parallel computing toolbox,
In Main.m, if we set
solver=[1 0 0] : it run the solvers - default backslash.

Cite As

Sanjib Acharya (2025). Vectorized 3D mesh refinement and Primal Hybrid FEM (https://www.mathworks.com/matlabcentral/fileexchange/181928-vectorized-3d-mesh-refinement-and-primal-hybrid-fem), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2025a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

3DPHFEM/3DPHFEM Elliptic problem with mixed boundary condition

3DPHFEM/3DPHFEM Elliptic problem with mixed boundary condition/Error

3DPHFEM/3DPHFEM Elliptic problem with mixed boundary condition/mesh

3DPHFEM/3DPHFEM Elliptic problem with mixed boundary condition/visualization

3DPHFEM/3DUniformRedRefinement

3DPHFEM/3DUniformRedRefinement/Figures

3DPHFEM/3DUniformRedRefinement/mesh

Version Published Release Notes
1.0.0