[19049] | 1 | #Test Name: SquareBamgMesh
|
---|
[21408] | 2 | import numpy as np
|
---|
[13437] | 3 | import time
|
---|
| 4 | from model import *
|
---|
| 5 | from bamg import *
|
---|
| 6 |
|
---|
[21408] | 7 |
|
---|
[13437] | 8 | #Simple mesh
|
---|
[23793] | 9 | md = bamg(model(), 'domain', '../Exp/Square.exp', 'hmax', 100000.)
|
---|
| 10 | x1 = md.mesh.x
|
---|
| 11 | y1 = md.mesh.y
|
---|
[13437] | 12 |
|
---|
| 13 | #hVertices
|
---|
[24214] | 14 | md = bamg(model(), 'domain', '../Exp/Square.exp', 'hmax', 300000., 'hVertices', np.array([10000., 100000., 400000., 100000.]).reshape(- 1, 1))
|
---|
[23793] | 15 | x2 = md.mesh.x
|
---|
| 16 | y2 = md.mesh.y
|
---|
[13437] | 17 |
|
---|
| 18 | #big mesh
|
---|
[23793] | 19 | t0 = time.time()
|
---|
| 20 | md = bamg(model(), 'domain', '../Exp/Square.exp', 'hmax', 3000.)
|
---|
| 21 | nbelements = md.mesh.numberofelements
|
---|
| 22 | elapsedtime = time.time() - t0
|
---|
| 23 | if nbelements > 267895 - 50 and nbelements < 267895 + 50:
|
---|
| 24 | nbewithinrange = 1.
|
---|
[17088] | 25 | else:
|
---|
[23793] | 26 | nbewithinrange = 0.
|
---|
[13437] | 27 |
|
---|
| 28 | #Fields and tolerances to track changes
|
---|
[23793] | 29 | field_names = ['x1', 'y1', 'x2', 'y2', 'nbelements', 'elapsed time']
|
---|
[23692] | 30 | # NOTE: Elapsed time tolerance has been increased to 7.0 for this test, but not the MATLBAB one
|
---|
[23793] | 31 | field_tolerances = [2e-9, 2e-9, 1e-13, 1e-13, 1e-13, 7.0]
|
---|
| 32 | field_values = [x1, y1, x2, y2, nbewithinrange, elapsedtime]
|
---|