## Features:

Free and open source C++ library that implements the virtual element method. The current release of this library allows the solution of 2D linear elastostatic problems and the 2D Poisson problem. The 2D linear elastostatic problem can also be solved using the standard three-node finite element triangle. For this, a module called Feamy is available within Veamy.

- Includes its own mesher based on the computation of the constrained Voronoi diagram. The meshes can be created in arbitrary domains, with or without holes, with procedurally generated points.
- Meshes can also be read from OFF-style text files (an example can be found in the test folder).
- Allows easy input of boundary conditions by constraining domain segments and nodes.
- The results of the computation can be either written into a file or used directly.
- PolyMesher‘s meshes and boundary conditions can be read straightforwardly in Veamy to solve problems using the VEM.

## Author

Catalina Alvarez – B.Sc., M.Sc., Department of Computer Science, Universidad de Chile.

## Supervisors

Nancy Hitschfeld-Kahler – Associate Professor, Department of Computer Science, Universidad de Chile.

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

## Collaborators

Alessandro Russo – Professor, Department of Mathematics and Applications, Università degli Studi di Milano-Bicocca.

Rodrigo Silva-Valenzuela – Master’s student, Department of Mechanical Engineering, Universidad de Chile.

Edgardo Olate-Sanzana – Master’s student, Department of Mechanical Engineering, Universidad de Chile.

## Running a Veamy program

Veamy is currently for Unix-like systems only.

- Download the source code and unpack it.
- In the root directory of Veamy, create a
**build/**folder. - Go to
**test/**folder located in the root directory of Veamy and: (a) add the main C++ file

(say,**mytest.cpp**) containing your test example problem, (b) modify the**CMakeLists.txt**

by changing the file name**example.cpp**in`set(SOURCE_FILES example.cpp)`

by the name of your main C++ file (in this case,

**mytest.cpp**) - Inside the
**build/**folder, type and execute in the terminal:`cmake ..`

to create the makefiles. And to compile the program type and execute:

`make`

- To run your example, go to the
**build/test/**folder, and in the terminal, type and execute:`./Test`

## Usage example

The complete procedure to compute the displacements using the virtual element method requires:

- If using the included mesher: create the domain and the input points, and then call the meshing procedure:
`std::vector points = {Point(0,0), Point(1,0), Point(1,1), Point(0,1)}; Region region(points); region.generateSeedPoints(PointGenerator(functions::random_double(), functions::random_double()), 10, 10); TriangleVoronoiGenerator generator (region.getSeedPoints(), region); Mesh<Polygon> mesh = generator.getMesh(); mesh.printInFile("mesh.txt");`

- If using an externally generated mesh, for example, from PolyMesher, refer to the next section of this tutorial; for a generic mesh format see “EquilibriumPatchTestMain.cpp” in the test folder.
- Create the problem conditions, assigning the domain material properties and the body forces if needed: :
`Material* material = new MaterialPlaneStrain(1e7, 0.3); LinearElasticityConditions* conditions = new LinearElasticityConditions(material);`

- Declare and assign boundary conditions: :
`PointSegment leftSide (Point(0,0), Point(0,1)); SegmentConstraint left(leftSide, mesh.getPoints(), new Constant(0)); conditions->addEssentialConstraint(left, mesh.getPoints(), elasticity_constraints::Direction::Total); PointSegment rightSide (Point(1,0), Point(1,1)); SegmentConstraint right(rightSide, mesh.getPoints(), new Constant(1000)); conditions->addNaturalConstraint(right, mesh.getPoints(), elasticity_constraints::Direction::Horizontal);`

- Create a Veamer instance and initialize the numerical problem:
`VeamyLinearElasticityDiscretization* problem = new VeamyLinearElasticityDiscretization(conditions); Veamer veamer(problem); veamer.initProblem(mesh);`

- Compute the displacements:
`Eigen::VectorXd displacements = veamer.simulate(mesh);`

- If required, print the nodal displacements to a text file:
`veamer.writeDisplacements("displacements.txt", displacements);`

- The results can be plotted using the Matlab function
**plotPolyMeshDisplacements**(located in folder**/lib/visualization/**):`[points,polygons,displacements] = plotPolyMeshDisplacements('mesh.txt','displacements.txt','$$u_x^h$$','$$u_y^h$$','$$||u^h||$$','yes');`

This and various additional examples are provided in the **test/** folder located in the root directory of Veamy. In addition, thanks to its extensibility, Veamy is capable of solving the two dimensional Poisson problem. Two examples are provided in the **test/** folder.

## Using the finite element method

Veamy, being an extensible library, includes the possibility of solving the linear elasticity problem using the Finite Element Method in a module named Feamy. Solving the linear elasticity problem using FEM is similar to VEM, with just a few differences:

- The current finite element implementation only accepts triangular meshes (three-node triangular elements). Triangulations can be generated using the same mesher used for the polygonal mesh generation, as follows:
`std::vector points = {Point(0,0), Point(1,0), Point(1,1), Point(0,1)}; Region region(points); region.generateSeedPoints(PointGenerator(functions::random_double(), functions::random_double()), 10, 10); TriangleDelaunayGenerator generator (region.getSeedPoints(), region); Mesh<Triangle> mesh = generator.getConformingDelaunayTriangulation();`

- Both the constraints and problem conditions (body forces and material properties) are set exactly as in Veamy.
- Create a Feamer instance, an ElementConstructor (which represents the type of elements to be used for the analysis — in this case, three-node triangular elements), and initialize the numerical problem:
`Feamer feamer; feamer.initProblem(mesh, conditions, new Tri3Constructor());`

- Displacements computation and post processing are performed exactly as in Veamy

## Using PolyMesher

- Use the Matlab function
**PolyMesher2Veamy.m**included in the**polymesher/**folder and use it to generate a Veamy-format file, whose default name is “polymesher2veamy.txt”, from PolyMesher. - Use the previously generated file as parameter of the
**initProblemFromFile**method of the**Veamer**class. It

requires the definition of the material properties, and, in the case the problem includes them, a body force pointer:`Material* material = new MaterialPlaneStress(1e7, 0.3); LinearElasticityConditions* conditions = new LinearElasticityConditions(material); VeamyLinearElasticityDiscretization* problem = new VeamyLinearElasticityDiscretization(conditions); Veamer veamer(problem); Mesh mesh = veamer.initProblemFromFile("polymesher2veamy.txt");`

- Proceed exactly as shown from step 6 forward, as boundary conditions are already defined.

This and various additional examples are provided in the **test/** folder located in the root directory of Veamy.

## Veamy’s paper example tests

All the examples that accompany the paper:

A. Ortiz-Bernardin, C. Alvarez, N. Hitschfeld-Kahler, A. Russo, R. Silva, E. Olate-Sanzana. “Veamy: an extensible object-oriented C++ library for the virtual element method” arXiv:1708.03438 [cs.MS]

can be found in **test/** folder located in the root directory of Veamy. To run these example files just follow the instructions given in **Running a Veamy program** section of this manual or consult the **Veamy Primer** that is located inside the **docs**/ folder.

## Acknowledgements

Veamy depends on two external open source libraries, whose codes are included in this repository, inside **lib** folder.

Linear algebra aspects are handled using:

## License

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

## Citing Veamy

If you use Veamy in a publication, please include an acknowledgement by citing Veamy as follows:

A. Ortiz-Bernardin, C. Alvarez, N. Hitschfeld-Kahler, A. Russo, R. Silva, E. Olate-Sanzana. Veamy: an extensible object-oriented C++ library for the virtual element method. arXiv:1708.03438 [cs.MS]

## Download & Mailing List

>> Latest stable version of Veamy (23-January-2018): **Veamy v2.0 **

>> Download: Source code (zip) | Source code (tar.gz) | Veamy Primer v2.0 (PDF manual)

>> From Veamy v1.1.1 to Veamy 2.0:

- Add documentation to the source code.
- Implement VEM for the two-dimensional Poisson problem.
- Implement Feamy, a FEM module that uses three-node triangular finite elements for the solution of the two dimensional linear elastostatic problem.
- Add methods to compute the L2-norm and H1-seminorm of the error.
- Improve the built-in polygonal mesh generator.
- Change to Eigen’s sparse solver for the solution of the system of linear equations.
- Add additional test files.
- New simplified methods to impose essential and Neumann boundary conditions.
- Fix several bugs.

>> From **Veamy 1.0** to **Veamy v1.1.1**:

- Add documentation.
- Add method to include custom precision for printing output data.
- Add plane stress material formulation.
- Update installation instructions.
- Include more tests and mesh examples.
- Fix several bugs.

Browse the source code on GitHub

Get involved: subscribe to Veamy’s Users Mailing List

web statistic

Since August 10, 2017

## Recent News

- Release of VEMLab v2.0
VEMLab: a MATLAB library for the virtual element method Release of VEMLab v2.0 From VEMLab v1.0 to VEMLab v2.0: the…

Read More » - Accepted Paper: Modal Strain Energy-Based Debonding Assessment of Sandwich Panels Using a Linear Approximation with Maximum Entropy
Paper Accepted for Publication in Entropy V. Meruane, Matias Lasen, E. López Droguett, A. Ortiz-Bernardin, “Modal strain energy-based debonding assessment…

Read More » - Consistent and Stable Meshfree Galerkin Methods Using The Virtual Element Decomposition
A talk given by A. Ortiz-Bernardin at POEMS 2017: Workshop on Polytopal Element Methods in Mathematics and Engineering, July 6, 2017,…

Read More »

## Recent Publications

- Modal strain energy-based debonding assessment of sandwich panels using a linear approximation with maximum entropy
Entropy 2017, 19(11), 619 V. Meruane, Matias Lasen, E. López Droguett, A. Ortiz-Bernardin Abstract Sandwich structures are very attractive due to…

Read More » - Impact location and quantification on an aluminum sandwich panel using principal component analysis and linear approximation with maximum entropy
Entropy 2017, 19(4), 137 V. Meruane, P. Véliz, E. López Droguett, A. Ortiz-Bernardin Abstract To avoid structural failures it is of…

Read More » - Consistent and stable meshfree Galerkin methods using the virtual element decomposition
International Journal for Numerical Methods in Engineering Volume 112, Issue 7, 2017, pp 655-684 A. Ortiz-Bernardin, A. Russo, N. Sukumar Abstract Over…

Read More »