## Features

Free and open source MATLAB library for the virtual element method.

- Two-dimensional linear elastostatics (plane strain and plane stress) and two-dimensional Poisson problem.
- Solution methods: Linear VEM (polygonal elements), FEM (3-node triangles, 4-node quadrilateral).
- Boundary conditions: Dirichlet, Neumann on boundary edges; can be a constant or a function.
- Meshers: PolyMesher, distmesh2d, quad4mesh; PolyMesher is customized for rectangular domain, wrench domain and plate with a hole domain; distmesh2d and quad4mesh are customized for rectangular domain only. Domains can be extended for any of the meshers, but it requires adjustments to some interface functions (see the instructions that are available in functions create_polygonal_mesh.m, create_quadrilateral_mesh.m and create_triangular_mesh.m in folder “mesher”).
- Meshes need to be generated separately and saved to folder “test/mesh_files.”
- Meshes must be generated with the functions “create_” located in the folder “mesher.” Then, the files containing the generated meshes will be automatically saved to folder “test/mesh_files” for their use.
- Solutions can be plotted to MATLAB figures, text files, GiD files and VTK files.

## Author

Alejandro Ortiz-Bernardin – Assistant Professor, Department of Mechanical Engineering, Universidad de Chile.

## Running VEMLab

VEMLab is a library. You need to create a main .m file and place it inside the folder “test.” The main file has the typical structure of a FEM simulation. Simply follow the test problems (they are given with detailed comments) that are provided inside the folder “test” to write your own .m files or modify the ones provided. Alternatively, you can read the manual that is available in the folder ‘doc.’

## Running VEMLab in Octave

We are grateful to Dr. Stefan Holst, EMAG Application Manager, Technology Group, CD-adapco/Siemens PLM Software, for his kind advice on making VEMLab to run in Octave.

In Octave, the “computer” function that is at the beginning of each test file, returns a different name than one of those expected by VEMLab when running in MATLAB, i.e., ‘PCWIN’, ‘PCWIN64’, ‘GLNX86’ or ‘GLNXA64′. To fix this, at the beginning of each test file simply redefine the variable “opsystem” as follows: opsystem=’PCWIN’ or opsystem=’ GLNX86′ if the machine where Octave is installed is a Windows machine or a Linux machine, respectively.

In addition, Octave presents some issues when plotting VEMLab results to MATLAB figures (on small meshes it will do the work, but on larger meshes it will crash). To fix this, switch off all the MATLAB figures by setting the following parameters in the function plot_and_output_options.m that is in the folder “config”:

create_matlab_contour_plots=’no’;

plot_mesh=’no’;

plot_mesh_over_results=’no’;

write_solutions_to_text_file=’yes’;

write_solutions_to_GiD_file=’yes’;

write_solutions_to_VTK_file=’yes’;

Make sure the last three parameters are set to ‘yes’ so that one can have access to VEMLab results through text files or can postprocess results in GiD and VTK/Paraview.

## License

This project is licensed under the GPL3 License. This program is free software; it can be redistributed or modified under the terms of the GNU General Public License 3 as published by the Free Software Foundation.

## Download

>> Latest stable version of VEMLab (25-OCT-2019): **VEMLab v2.2.2**

Download: Source code (zip) | Source code (tar.gz) | VEMLab Primer (PDF manual)

>> From VEMLab v2.2.1 to VEMLab v2.2.2:

- Fix function max_edge_size.m.
- Add an L-shape example in the test folder.
- Update calculation of the polygon’s area: MATLAB’s “polyarea.m” is now used.

>> From VEMLab v2.2 to VEMLab v2.2.1:

- Add option to explicitly switch off all MATLAB figures in function “plot_and_output_options.m”.
- Facilitate compatibility to run VEMLab in Octave.
- Update manual with a guide to running VEMLab in Octave.

>> From VEMLab v2.1 to VEMLab v2.2:

- Fix disp() in plot_and_ouput_options.m: disp(“Hello”) seems to work only in newer versions of MATLAB. So, it is changed to the standard MATLAB format disp(‘Hello’).
- Results that are postprocessed in the graphical user interface of GiD are now ordered in folders.
- Add option to plot deformed domain in MATLAB figures when using the LinearElastostatics module (see function “plot_and_ouput_options.m” located in the folder “config”).
- Add a function to read a meshfile having the domain type declared as “Custom”, which is useful for defining the meshfile manually or using an external mesh generator or using a customized version of the mesh generators available in VEMLab. (See example “Creating and using a custom meshfile” in the VEMLab Primer or details.)
- Add more details to the VEMLab Primer.

>> From VEMLab v2.0.2 to VEMLab v2.1:

- Add customized wrench domain (for PolyMesher mesh generator only).
- Add customized plate with a hole domain (for PolyMesher mesh generator only).
- Add the following test: “square_plate_with_source2_poisson2d.m” in test folder.
- Add the following test: “plate_with_hole_linelast2d.m” in test folder.
- Add the following test: “wrench_linelast2d.m” in test folder.
- Fix iteration counter in PolyMesher function.

>> From VEMLab v2.0.1 to VEMLab v2.0.2:

- Fix several bugs when using vemlab_method=’FEM2DQ4′ and vemlab_method=’FEM2DT3′.
- Add a control variable in config.m that permits to explicitly set the number of Gauss points to integrate the FEM2DQ4 stiffness matrix and body force vector.

>> From VEMLab v2.0 to VEMLab v2.0.1: the following features have been added

- More detailed manual in folder “doc.”
- Improvement to the plotting of axis and fonts in MATLAB figures.

>> From VEMLab v1.0 to VEMLab v2.0: the following features have been added

- Two-dimensional Poisson problem
- Setup of plot and output options in function “plot_and_output_options” located in folder “config”.
- Additional plotting options (stresses, strains, fluxes and gradients) to MATLAB figures, text files and GiD files.
- Option to plot solutions to VTK files.

>> VEMLab 1.0: (Initial release of code)

- Two-dimensional linear elastostatics (plane strain and plane stress)
- Solution methods: VEM (polygonal elements), FEM (3-node triangles, 4-node quadrilateral)
- Boundary conditions: Dirichlet, Neumann on boundary edges; can be a constant or a function.
- Meshers: PolyMesher [1], distmesh2d [2], quad4mesh; customized for rectangular domains only (requires adjustments for other domain types)
- Meshes need to be generated separately and stored inside folder ‘mesh_files’ located in the folder ‘test.’
- Meshes must be generated with the functions ‘create_’ located in the folder ‘mesher.’
- Solutions can be plotted to MATLAB figures, text files and GiD files.

Browse the source code on GitHub

————————————–

Counter stats since 17 FEB 2018

## Recent News

- The Virtual Element Decomposition: A New Paradigm for Developing Nodal Integration Schemes for Meshfree Galerkin Methods
A talk given by A. Ortiz-Bernardin at WONAPDE 2019, January 22, 2019, Concepción, Chile. THE VIRTUAL ELEMENT DECOMPOSITION: A NEW PARADIGM…

Read More » - Accepted Paper: Veamy: an extensible object-oriented C++ library for the virtual element method
Paper Accepted for Publication in Numerical Algorithms Aleandro Ortiz-Bernardin, Catalina Alvarez, Nancy Hitschfeld-Kahler, Alessandro Russo, Rodrigo Silva-Valenzuela, Edgardo Olate-Sanzana, “Veamy: an…

Read More » - Release of VEMLab v2.2.1 (now it runs in Octave!)
VEMLab: a MATLAB library for the virtual element method Release of VEMLab v2.2.1 >> From VEMLab v2.2 to VEMLab v2.2.1:…

Read More »

## Recent Publications

- Impact identification using nonlinear dimensionality reduction and supervised learning
Smart Materials and Structures Volume 28, Issue 11, 1 October 2019, Pages 115005 V. Meruane, C. Espinoza, E. Lopez Droguett,…

Read More » - Veamy: an extensible object-oriented C++ library for the virtual element method
Numerical Algorithms In press. Alejandro Ortiz-Bernardin, Catalina Alvarez, Nancy Hitschfeld-Kahler, Alessandro Russo, Rodrigo Silva-Valenzuela, Edgardo Olate-Sanzana. Abstract This paper summarizes the…

Read More » - On the behaviour of spherical inclusions in a cylinder under tension loads
Ingenius Vol. 19, 2018, pp. 69-78 S. Montero, R. Bustamante, A. Ortiz-Bernardin Abstract In the present paper the behaviour of…

Read More »