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