Page MenuHomec4science

test_mesh_interface.py
No OneTemporary

File Metadata

Created
Sun, Jun 30, 11:24

test_mesh_interface.py

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
__author__ = "Lucas Frérot"
__copyright__ = "Copyright (C) 2016-2018, EPFL (Ecole Polytechnique Fédérale" \
" de Lausanne) Laboratory (LSMS - Laboratoire de Simulation" \
" en Mécanique des Solides)"
__credits__ = ["Lucas Frérot"]
__license__ = "L-GPLv3"
__maintainer__ = "Lucas Frérot"
__email__ = "lucas.frerot@epfl.ch"
# ------------------------------------------------------------------------------
from __future__ import print_function
import sys
import os
import akantu as aka
def main():
aka.initialize()
mesh = aka.Mesh(2)
mesh.read('mesh_dcb_2d.msh')
# Tests the getNbElement() function
if mesh.getNbElement(aka._quadrangle_8) != mesh.getNbElementByDimension(2):
print("Number of elements wrong, should be {}".format(mesh.getNbElementByDimension(2)))
return -1
# TODO test the other functions in Mesh
aka.finalize()
return 0
if __name__ == "__main__":
sys.exit(main())

Event Timeline