diff --git a/test/single_scale/AKANTU/test_static/apply_strain.py b/test/single_scale/AKANTU/test_static/apply_strain.py deleted file mode 100644 index f0239d5..0000000 --- a/test/single_scale/AKANTU/test_static/apply_strain.py +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env python -import numpy as np - - -name = "bound_pos" - -shift = (0., .1, 0.) -length = 1. - -def compute(**kwargs): - keys = kwargs.keys() - if name in keys: - key = name - try: - pos0 = kwargs[key] - except UnboundLocalError as err: - raise UnboundLocalError( - "{0}\nThe only available keys are {1}. The key '{2}' wasn't found!".format(err, keys, name)) - #disp = np.array(np.matrix(pos0) * grad_u) + solid_body_disp - disp = np.zeros(pos0.shape) - - if pos0.shape[0] == 0: - return disp - - for i in range(3): - disp[:,i] = shift[i]*pos0[:, i] - print("When dealing with {0}, computed displacement within the ranges:".format(key)) - print(" u_x_min = {0}, \tu_x_max = {1}".format(disp.min(0)[0], disp.max(0)[0])) - print(" u_y_min = {0}, \tu_y_max = {1}".format(disp.min(0)[1], disp.max(0)[1])) - print(" u_z_min = {0}, \tu_z_max = {1}".format(disp.min(0)[2], disp.max(0)[2])) - - return disp diff --git a/test/single_scale/AKANTU/test_static/check_strain.py b/test/single_scale/AKANTU/test_static/check_strain.py deleted file mode 100644 index 11827ec..0000000 --- a/test/single_scale/AKANTU/test_static/check_strain.py +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env python -import numpy as np -import sys - -from LMUnitsModule import * - -from apply_strain import shift, length - -disp_name = "disp_extr" -name = "all_pos" - -tol_mean = 1e-8 -tol_max = 1e-7 - -def compute( **kwargs): - keys = kwargs.keys() - if name in keys: - key = name - try: - pos0 = kwargs[key] - except UnboundLocalError as err: - raise UnboundLocalError( - "{0}\nThe only available keys are {1}. The key '{2}' wasn't found!".format(err, keys, name)) - - if pos0.shape[0] == 0: - return pos0 - - print (pos0.shape) - - if disp_name in keys: - key = disp_name - try: - real_disp = kwargs[key] - except UnboundLocalError as err: - raise UnboundLocalError( - "{0}\nThe only available keys are {1}. The key '{2}' wasn't found!".format(err, keys, disp_name)) - - grad_u = np.matrix([[0, shift[0]/length, 0], - [0, shift[1]/length, 0], - [0, shift[2]/length, 0]]) - - theoretical_disp = np.array(np.matrix(pos0)*grad_u) - - try: - real_diff = theoretical_disp - real_disp - except ValueError as err: - raise ValueError( - "{0}\n theoretical_disp.shape = {1}\n real_disp.shape = {2}".format( - err, theoretical_disp.shape, real_disp.shape)); - - print("Real {0}, Th {1}".format(real_disp.shape, theoretical_disp.shape)) - - dists = (real_diff**2).sum(1)**.5 - max_err = dists.max() - mean_err = dists.mean() - - print ("\n") - print ("the tolerances on mean and max displacement " - "are {0} and {1}, respectively".format(tol_mean, tol_max)) - def symbol(val, tol): - if val < tol: - return "<" - elif val == tol: - return "=" - else: - return ">" - mean_ok = mean_err < tol_mean - max_ok = max_err < tol_max - print ("the maximum error on displacement = {0} {1} tol: {2}".format( - max_err, symbol(max_err, tol_max), - "passed" if max_ok else "FAILED")) - print ("the mean error on displacement = {0} {1} tol: {2}".format( - mean_err, symbol(mean_err, tol_mean), - "passed" if mean_ok else "FAILED")) - - if max_ok and mean_ok: - print("Test succesful") - lm_exit(0) - return pos0 - - print("the theoretical displacements are:\n{0}".format(theoretical_disp)) - print("the measured displacements are:\n{0}".format(real_disp)) - print("Test failed") - lm_exit(2) - return pos0 - diff --git a/test/single_scale/AKANTU/test_static/material.dat b/test/single_scale/AKANTU/test_static/material.dat deleted file mode 100644 index a809799..0000000 --- a/test/single_scale/AKANTU/test_static/material.dat +++ /dev/null @@ -1,34 +0,0 @@ -material elastic [ - name = nimporte - rho = 1.6465129043044597 #gramm/mol/Å^3 - E = 0.42442264461332484984 # eV/Å^3 - nu = 0.3068034044 -] - - - -# material anisotropic [ -# name = anisotropic_mendelev_aluminum -# rho = 1.6465129043044597 #gramm/mol/Å^3 -# C11 = 0.704900709218 # eV/Å^3 -# C12 = 0.338498502279 # eV/Å^3 -# C13 = 0.354821115208 # eV/Å^3 -# C14 = -0.0230836605725 # eV/Å^3 -# C15 = -2.79403897311e-12 # eV/Å^3 -# C16 = 1.1599374516e-12 # eV/Å^3 -# C22 = 0.721223322135 # eV/Å^3 -# C23 = 0.338498502281 # eV/Å^3 -# C24 = -1.96666053374e-12 # eV/Å^3 -# C25 = 1.30679781754e-12 # eV/Å^3 -# C26 = 2.06979318692e-12 # eV/Å^3 -# C33 = 0.704900709216 # eV/Å^3 -# C34 = 0.0230836605742 # eV/Å^3 -# C35 = -1.33369523923e-12 # eV/Å^3 -# C36 = -1.23504179396e-12 # eV/Å^3 -# C44 = 0.158717184079 # eV/Å^3 -# C45 = 5.91831974447e-14 # eV/Å^3 -# C46 = -5.23535141127e-13 # eV/Å^3 -# C55 = 0.175039797006 # eV/Å^3 -# C56 = -0.023083660572 # eV/Å^3 -# C66 = 0.158717184076 # eV/Å^3 -# ] \ No newline at end of file diff --git a/test/single_scale/AKANTU/test_static/mesh.msh b/test/single_scale/AKANTU/test_static/mesh.msh deleted file mode 100644 index 6e1cb31..0000000 --- a/test/single_scale/AKANTU/test_static/mesh.msh +++ /dev/null @@ -1,258 +0,0 @@ -$MeshFormat -2.1 0 8 -$EndMeshFormat -$Nodes -42 -1 0 0 0 -2 1 0 0 -3 0 1 0 -4 1 1 0 -5 0 0 1 -6 1 0 1 -7 0 1 1 -8 1 1 1 -9 0.4999999999990217 1 1 -10 1 1 0.5000000000013878 -11 0.5000000000013878 1 0 -12 0 1 0.4999999999990217 -13 0 0 0.4999999999990217 -14 0.4999999999990217 0 1 -15 1 0 0.5000000000013878 -16 0.5000000000013878 0 0 -17 0 0.5000000000013878 0 -18 0 0.5000000000013878 1 -19 1 0.5000000000013878 1 -20 1 0.5000000000013878 0 -21 0.6428571428567235 0.5000000000003965 1 -22 0.2785714285710512 0.3500000000004956 1 -23 0.2842857142853593 0.670000000000456 1 -24 0.6840722533465502 1 0.2675114780935685 -25 0.5886704076322169 1 0.6013773593859361 -26 0.354548532196031 1 0.2737777674957053 -27 0.5000000000000585 0 0.6428571428572305 -28 0.3500000000004281 0 0.2785714285713892 -29 0.670000000000375 0 0.2842857142860015 -30 0.3571428571434519 0.5000000000003965 0 -31 0.7214285714291068 0.3500000000004956 0 -32 0.7157142857147892 0.670000000000456 0 -33 0 0.6428571428577375 0.4999999999997205 -34 0 0.2785714285719638 0.6499999999996506 -35 0 0.2842857142862178 0.3299999999996786 -36 1 0.3571428571434519 0.5000000000003965 -37 1 0.7214285714291068 0.3500000000004956 -38 1 0.7157142857147892 0.670000000000456 -39 0.4662426486062489 0.682365878613488 0.6247385391772754 -40 0.3928508996147502 0.6783805460075457 0.2231924003785042 -41 0.4834868113081788 0.3674115946766319 0.2900665800443959 -42 0.4329296945943543 0.3181780964219008 0.5652619629649539 -$EndNodes -$Elements -207 -1 15 3 0 1 0 1 -2 15 3 0 2 0 2 -3 15 3 0 3 0 3 -4 15 3 0 4 0 4 -5 15 3 0 5 0 5 -6 15 3 0 6 0 6 -7 15 3 0 7 0 7 -8 15 3 0 8 0 8 -9 1 3 0 1 0 7 9 -10 1 3 0 1 0 9 8 -11 1 3 0 2 0 8 10 -12 1 3 0 2 0 10 4 -13 1 3 0 3 0 4 11 -14 1 3 0 3 0 11 3 -15 1 3 0 4 0 3 12 -16 1 3 0 4 0 12 7 -17 1 3 0 5 0 1 13 -18 1 3 0 5 0 13 5 -19 1 3 0 6 0 5 14 -20 1 3 0 6 0 14 6 -21 1 3 0 7 0 6 15 -22 1 3 0 7 0 15 2 -23 1 3 0 8 0 2 16 -24 1 3 0 8 0 16 1 -25 1 3 0 9 0 3 17 -26 1 3 0 9 0 17 1 -27 1 3 0 10 0 7 18 -28 1 3 0 10 0 18 5 -29 1 3 0 11 0 8 19 -30 1 3 0 11 0 19 6 -31 1 3 0 12 0 4 20 -32 1 3 0 12 0 20 2 -33 2 3 0 14 0 21 9 8 -34 2 3 0 14 0 19 21 8 -35 2 3 0 14 0 14 21 6 -36 2 3 0 14 0 21 19 6 -37 2 3 0 14 0 22 14 5 -38 2 3 0 14 0 18 22 5 -39 2 3 0 14 0 14 22 21 -40 2 3 0 14 0 9 23 7 -41 2 3 0 14 0 23 18 7 -42 2 3 0 14 0 23 9 21 -43 2 3 0 14 0 23 22 18 -44 2 3 0 14 0 21 22 23 -45 2 3 0 16 0 24 4 11 -46 2 3 0 16 0 10 4 24 -47 2 3 0 16 0 25 8 10 -48 2 3 0 16 0 9 8 25 -49 2 3 0 16 0 25 10 24 -50 2 3 0 16 0 11 3 26 -51 2 3 0 16 0 26 3 12 -52 2 3 0 16 0 24 11 26 -53 2 3 0 16 0 25 24 26 -54 2 3 0 16 0 12 7 9 -55 2 3 0 16 0 9 25 12 -56 2 3 0 16 0 25 26 12 -57 2 3 0 18 0 15 27 6 -58 2 3 0 18 0 27 14 6 -59 2 3 0 18 0 27 13 5 -60 2 3 0 18 0 14 27 5 -61 2 3 0 18 0 13 28 1 -62 2 3 0 18 0 28 16 1 -63 2 3 0 18 0 28 13 27 -64 2 3 0 18 0 29 15 2 -65 2 3 0 18 0 16 29 2 -66 2 3 0 18 0 15 29 27 -67 2 3 0 18 0 28 29 16 -68 2 3 0 18 0 28 27 29 -69 2 3 0 20 0 11 3 30 -70 2 3 0 20 0 30 3 17 -71 2 3 0 20 0 30 1 16 -72 2 3 0 20 0 17 1 30 -73 2 3 0 20 0 16 2 31 -74 2 3 0 20 0 31 2 20 -75 2 3 0 20 0 31 30 16 -76 2 3 0 20 0 32 4 11 -77 2 3 0 20 0 20 4 32 -78 2 3 0 20 0 11 30 32 -79 2 3 0 20 0 31 20 32 -80 2 3 0 20 0 31 32 30 -81 2 3 0 22 0 33 17 3 -82 2 3 0 22 0 12 33 3 -83 2 3 0 22 0 33 12 7 -84 2 3 0 22 0 18 33 7 -85 2 3 0 22 0 34 18 5 -86 2 3 0 22 0 18 34 33 -87 2 3 0 22 0 13 34 5 -88 2 3 0 22 0 35 13 1 -89 2 3 0 22 0 35 17 33 -90 2 3 0 22 0 17 35 1 -91 2 3 0 22 0 35 34 13 -92 2 3 0 22 0 33 34 35 -93 2 3 0 24 0 36 19 6 -94 2 3 0 24 0 15 36 6 -95 2 3 0 24 0 36 15 2 -96 2 3 0 24 0 20 36 2 -97 2 3 0 24 0 37 20 4 -98 2 3 0 24 0 20 37 36 -99 2 3 0 24 0 10 37 4 -100 2 3 0 24 0 38 10 8 -101 2 3 0 24 0 38 19 36 -102 2 3 0 24 0 19 38 8 -103 2 3 0 24 0 38 37 10 -104 2 3 0 24 0 36 37 38 -105 4 3 0 26 0 38 25 37 39 -106 4 3 0 26 0 12 3 26 33 -107 4 3 0 26 0 4 20 37 32 -108 4 3 0 26 0 31 40 41 37 -109 4 3 0 26 0 28 35 41 1 -110 4 3 0 26 0 31 20 32 37 -111 4 3 0 26 0 40 3 26 11 -112 4 3 0 26 0 12 33 26 39 -113 4 3 0 26 0 9 12 25 39 -114 4 3 0 26 0 7 18 33 23 -115 4 3 0 26 0 42 33 34 39 -116 4 3 0 26 0 22 42 34 39 -117 4 3 0 26 0 42 29 36 27 -118 4 3 0 26 0 40 3 17 33 -119 4 3 0 26 0 21 36 6 27 -120 4 3 0 26 0 18 33 23 34 -121 4 3 0 26 0 22 18 23 34 -122 4 3 0 26 0 36 38 37 39 -123 4 3 0 26 0 22 21 39 23 -124 4 3 0 26 0 13 35 28 1 -125 4 3 0 26 0 5 22 34 18 -126 4 3 0 26 0 25 12 26 39 -127 4 3 0 26 0 30 3 17 40 -128 4 3 0 26 0 35 42 41 33 -129 4 3 0 26 0 22 34 23 39 -130 4 3 0 26 0 16 28 41 1 -131 4 3 0 26 0 21 38 9 8 -132 4 3 0 26 0 31 30 40 32 -133 4 3 0 26 0 36 29 2 15 -134 4 3 0 26 0 31 29 2 36 -135 4 3 0 26 0 35 40 17 33 -136 4 3 0 26 0 42 29 28 41 -137 4 3 0 26 0 36 31 41 37 -138 4 3 0 26 0 21 9 39 23 -139 4 3 0 26 0 13 5 27 34 -140 4 3 0 26 0 35 42 28 41 -141 4 3 0 26 0 31 30 41 40 -142 4 3 0 26 0 16 29 41 28 -143 4 3 0 26 0 24 10 37 4 -144 4 3 0 26 0 30 3 40 11 -145 4 3 0 26 0 42 36 41 39 -146 4 3 0 26 0 24 4 37 32 -147 4 3 0 26 0 40 35 41 33 -148 4 3 0 26 0 24 40 32 37 -149 4 3 0 26 0 16 31 41 29 -150 4 3 0 26 0 36 29 15 27 -151 4 3 0 26 0 21 38 19 36 -152 4 3 0 26 0 38 21 19 8 -153 4 3 0 26 0 12 7 39 9 -154 4 3 0 26 0 40 24 32 11 -155 4 3 0 26 0 24 40 26 11 -156 4 3 0 26 0 21 36 19 6 -157 4 3 0 26 0 4 24 11 32 -158 4 3 0 26 0 21 22 39 42 -159 4 3 0 26 0 20 31 2 36 -160 4 3 0 26 0 16 31 29 2 -161 4 3 0 26 0 21 42 36 27 -162 4 3 0 26 0 38 10 37 25 -163 4 3 0 26 0 10 24 37 25 -164 4 3 0 26 0 14 21 6 27 -165 4 3 0 26 0 20 31 36 37 -166 4 3 0 26 0 42 29 27 28 -167 4 3 0 26 0 10 38 8 25 -168 4 3 0 26 0 42 29 41 36 -169 4 3 0 26 0 42 35 34 33 -170 4 3 0 26 0 15 36 27 6 -171 4 3 0 26 0 34 33 23 39 -172 4 3 0 26 0 29 31 41 36 -173 4 3 0 26 0 31 16 41 30 -174 4 3 0 26 0 38 9 8 25 -175 4 3 0 26 0 30 40 32 11 -176 4 3 0 26 0 9 7 39 23 -177 4 3 0 26 0 30 16 41 1 -178 4 3 0 26 0 33 40 26 39 -179 4 3 0 26 0 33 42 41 39 -180 4 3 0 26 0 3 40 26 33 -181 4 3 0 26 0 40 33 41 39 -182 4 3 0 26 0 40 31 32 37 -183 4 3 0 26 0 27 34 28 13 -184 4 3 0 26 0 28 34 27 42 -185 4 3 0 26 0 34 35 28 13 -186 4 3 0 26 0 28 35 34 42 -187 4 3 0 26 0 30 1 35 17 -188 4 3 0 26 0 35 1 30 41 -189 4 3 0 26 0 30 35 40 17 -190 4 3 0 26 0 40 35 30 41 -191 4 3 0 26 0 41 37 39 36 -192 4 3 0 26 0 39 37 41 40 -193 4 3 0 26 0 36 39 21 38 -194 4 3 0 26 0 21 39 36 42 -195 4 3 0 26 0 26 39 24 25 -196 4 3 0 26 0 24 39 26 40 -197 4 3 0 26 0 39 37 24 25 -198 4 3 0 26 0 24 37 39 40 -199 4 3 0 26 0 7 39 33 12 -200 4 3 0 26 0 33 39 7 23 -201 4 3 0 26 0 27 21 22 14 -202 4 3 0 26 0 27 22 21 42 -203 4 3 0 26 0 34 22 27 42 -204 4 3 0 26 0 9 39 38 21 -205 4 3 0 26 0 38 39 9 25 -206 4 3 0 26 0 27 5 22 34 -207 4 3 0 26 0 27 22 5 14 -$EndElements diff --git a/test/single_scale/AKANTU/test_static/test_static.config b/test/single_scale/AKANTU/test_static/test_static.config deleted file mode 100644 index ac89cc4..0000000 --- a/test/single_scale/AKANTU/test_static/test_static.config +++ /dev/null @@ -1,69 +0,0 @@ -Section MultiScale RealUnits -DIMENSION 3 -UNITCODE RealUnits - -LET L = 1 -LET TOL = 1e-3 -LET LTOL = L+TOL -LET FTOL = L-TOL - -LET SHIFTX = 0. -LET SHIFTY = .1 -LET SHIFTZ = 0 - - -ELAST_CODE AKANTU fe - -################################################################################ -## geometries -GEOMETRY 1 CUBE BBOX 0 L 0 L 0 L -GEOMETRY lower CUBE BBOX -TOL TOL -TOL LTOL -TOL LTOL -GEOMETRY upper CUBE BBOX FTOL LTOL -TOL LTOL -TOL LTOL -GEOMETRY left CUBE BBOX -TOL LTOL -TOL TOL -TOL LTOL -GEOMETRY right CUBE BBOX -TOL LTOL FTOL LTOL -TOL LTOL -GEOMETRY back CUBE BBOX -TOL LTOL -TOL LTOL -TOL TOL -GEOMETRY front CUBE BBOX -TOL LTOL -TOL LTOL FTOL LTOL - -GEOMETRY xdir UNION IDS lower upper -GEOMETRY ydir UNION IDS left right -GEOMETRY zdir UNION IDS back front -GEOMETRY xy UNION IDS xdir ydir - -GEOMETRY boundary UNION IDS xy zdir - -################################################################################ -## filters and computes -#FILTER upper_bound GEOM INPUT fe GEOMETRY upper BASED_ON_NODES -#FILTER lower_bound GEOM INPUT fe GEOMETRY lower BASED_ON_NODES -FILTER bound GEOM INPUT fe GEOMETRY boundary BASED_ON_NODES - -#COMPUTE upper_pos EXTRACT INPUT upper_bound FIELD position0 -COMPUTE bound_pos EXTRACT INPUT bound FIELD position0 -COMPUTE all_pos EXTRACT INPUT fe FIELD position0 - -COMPUTE disp_extr EXTRACT INPUT fe FIELD displacement -COMPUTE disp_comp PYTHON INPUT bound_pos FILENAME apply_strain - -COMPUTE error PYTHON INPUT all_pos FILENAME check_strain ADD_COMPUTE disp_extr - -################################################################################ -## stimulators -STIMULATION disp FIELD INPUT bound FIELD displacement COMPUTE disp_comp ONESHOT 0 -STIMULATION lower_block BLOCK INPUT bound DIR 1 1 1 ONESHOT 0 - -STIMULATION error FIELD INPUT fe FIELD velocity COMPUTE error ONESHOT 3 - - -################################################################################ -## dumpers -DUMPER para PARAVIEW INPUT fe DISP VEL FORCE FREQ 1 PREFIX ./ - -endSection - -Section AKANTU:fe RealUnits -IS_STATIC -DOMAIN_GEOMETRY 1 -MESH_FILENAME mesh.msh -MATERIAL_FILENAME material.dat -TIMESTEP 1e-2 -endSection diff --git a/test/single_scale/AKANTU/test_static/test_static.pconfig b/test/single_scale/AKANTU/test_static/test_static.pconfig deleted file mode 100644 index 47f5976..0000000 --- a/test/single_scale/AKANTU/test_static/test_static.pconfig +++ /dev/null @@ -1,7 +0,0 @@ -Section MultiScale RealUnits - -COM DISTRIBUTED -PROCESSORS fe $NPROC - -INCLUDE test_static.config MultiScale -endSection