Skip to content
Snippets Groups Projects
Metavoxel GPU Validation 4.ipynb 299 KiB
Newer Older
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
    "\n",
    "    function direction_cosine(vec1, vec2)\n",
    "        return dot(vec1,vec2) / (norm(vec1) * norm(vec2))\n",
    "    end\n",
    "\n",
    "    function rotation_matrix(element_vector, x_axis, y_axis,z_axis)\n",
    "        # find the direction cosines\n",
    "        x_proj = direction_cosine(element_vector, x_axis)\n",
    "        y_proj = direction_cosine(element_vector, y_axis)\n",
    "        z_proj = direction_cosine(element_vector, z_axis);\n",
    "        return [[x_proj y_proj z_proj 0 0 0];[0 0 0 x_proj y_proj z_proj]]\n",
    "    end\n",
    "\n",
    "    function rotation_matrix(element_vector, x_axis, y_axis,z_axis)\n",
    "        # find the direction cosines\n",
    "        L=norm(element_vector)\n",
    "        l = (element_vector[1])/L\n",
    "        m = (element_vector[2])/L\n",
    "        n = (element_vector[3])/L\n",
    "        D = ( l^2+ m^2+n^2)^0.5\n",
    "\n",
    "        transMatrix=[[l m  n  0  0  0  0  0  0  0  0  0];[-m/D l/D  0  0  0  0  0  0  0  0  0  0];[ -l*n/D  -m*n/D  D  0  0  0  0  0  0  0  0  0];[ 0  0  0       l       m  n  0  0  0  0  0  0];[ 0  0  0    -m/D     l/D  0  0  0  0  0  0  0];[ 0  0  0  -l*n/D  -m*n/D  D  0  0  0  0  0  0];[ 0  0  0  0  0  0       l       m  n  0  0  0];[ 0  0  0  0  0  0    -m/D     l/D  0  0  0  0];[ 0  0  0  0  0  0  -l*n/D  -m*n/D  D  0  0  0];[ 0  0  0  0  0  0  0  0  0       l       m  n];[ 0  0  0  0  0  0  0  0  0    -m/D     l/D  0];[ 0  0  0  0  0  0  0  0  0  -l*n/D  -m*n/D  D]]\n",
    "\n",
    "        return transMatrix\n",
    "    end\n",
    "    \n",
    "    #######################################################\n",
    "    function get_matrices(setup)\n",
    "\n",
    "        nodes      = setup[\"nodes\"]\n",
    "        edges      = setup[\"edges\"]\n",
    "        ndofs      = length(nodes)*6\n",
    "\n",
    "        x_axis     = [1 0 0]\n",
    "        y_axis     = [0 1 0]\n",
    "        z_axis     = [0 0 1]\n",
    "\n",
    "        M = zeros((ndofs,ndofs))\n",
    "        K = zeros((ndofs,ndofs))\n",
    "        \n",
    "        \n",
    "        for edge in edges\n",
    "            #degrees_of_freedom = properties[\"degrees_of_freedom\"]\n",
    "\n",
    "            element=parse(Int,edge[\"id\"][2:end])\n",
    "\n",
    "            # find the nodes that the lements connects\n",
    "            fromNode = nodes[edge[\"source\"]+1]\n",
    "            toNode = nodes[edge[\"target\"]+1]\n",
    "            \n",
    "\n",
    "            # the coordinates for each node\n",
    "            fromPoint = [fromNode[\"position\"][\"x\"]*15.0 fromNode[\"position\"][\"y\"]*15.0 fromNode[\"position\"][\"z\"]*15.0]\n",
    "            toPoint = [toNode[\"position\"][\"x\"]*15.0 toNode[\"position\"][\"y\"]*15.0 toNode[\"position\"][\"z\"]*15.0]\n",
    "\n",
    "            # find the degrees of freedom for each node\n",
    "            dofs = convert(Array{Int}, fromNode[\"degrees_of_freedom\"])\n",
    "            dofs=vcat(dofs,convert(Array{Int}, toNode[\"degrees_of_freedom\"]))\n",
    "\n",
    "            element_vector=toPoint-fromPoint\n",
    "\n",
    "            # find element mass and stifness matrices\n",
    "            length   = norm(element_vector)\n",
    "            rho      = edge[\"density\"]\n",
    "            area     = edge[\"area\"]\n",
    "            E        = edge[\"stiffness\"]# youngs modulus\n",
    "\n",
    "            A = edge[\"area\"]\n",
    "            G=1.0#todo shear_modulus\n",
    "            ixx = 1.0#todo section ixx\n",
    "            iyy = 1.0#todo section.iyy#\n",
    "            l0=length\n",
    "            j=1.0;#todo check\n",
    "            l02 = l0 * l0\n",
    "            l03 = l0 * l0 * l0\n",
    "            \n",
    "            # find element mass and stifness matrices\n",
    "            length   = norm(element_vector)\n",
    "            rho      = edge[\"density\"]\n",
    "            area     = edge[\"area\"]\n",
    "            E        = edge[\"stiffness\"]# youngs modulus\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388
    "            \n",
    "            \n",
    "    \n",
    "            A = edge[\"area\"]\n",
    "            G=1.0#todo shear_modulus\n",
    "            ixx = 1.0#todo section ixx\n",
    "            iyy = 1.0#todo section.iyy#\n",
    "            j=1.0;#todo check\n",
    "            \n",
    "            \n",
    "            h = 2.38 # mm\n",
    "            b = 2.38  # mm\n",
    "            E = 2000  # MPa\n",
    "            rho = 7.85e-9 / 3  # kg/mm^3\n",
    "            G = E * 1 / 3  # MPa\n",
    "            A=h*b\n",
    "            Q = 1 / 3 - 0.2244 / (min(h / b, b / h) + 0.1607)\n",
    "            J = Q * min(h * b^3, b * h^3)\n",
    "            I= b*h^3/12\n",
    "            ixx=I\n",
    "            iyy=I\n",
    "            j=J\n",
    "            \n",
    "            l0=length\n",
    "            l02 = l0 * l0\n",
    "            l03 = l0 * l0 * l0\n",
    "\n",
    "            # Cm = rho * area * length /6.0\n",
    "            # Ck= E * area / length \n",
    "\n",
    "            # m = [[2 1];[1 2]]\n",
    "            # k = [[1 -1];[-1 1]]\n",
    "\n",
    "            k = [[E*A/l0  0  0  0  0  0  -E*A/l0  0  0  0  0  0];[0  12*E*ixx/l03  0  0  0  6*E*ixx/l02  0  -12*E*ixx/l03  0  0  0  6*E*ixx/l02];[0  0  12*E*iyy/l03  0  -6*E*iyy/l02  0  0  0  -12*E*iyy/l03  0  -6*E*iyy/l02  0];[0  0  0  G*j/l0  0  0  0  0  0  -G*j/l0  0  0];[0  0  -6*E*iyy/l02  0  4*E*iyy/l0  0  0  0  6*E*iyy/l02  0  2*E*iyy/l0  0];[0  6*E*ixx/l02  0  0  0  4*E*ixx/l0  0  -6*E*ixx/l02  0  0  0  2*E*ixx/l0];[-E*A/l0  0  0  0  0  0  E*A/l0  0  0  0  0  0];[0  -12*E*ixx/l03  0  0  0  -6*E*ixx/l02  0  12*E*ixx/l03  0  0  0  -6*E*ixx/l02];[0  0  -12*E*iyy/l03  0  6*E*iyy/l02  0  0  0  12*E*iyy/l03  0  6*E*iyy/l02  0];[0  0  0  -G*j/l0  0  0  0  0  0  G*j/l0  0  0];[0  0  -6*E*iyy/l02  0  2*E*iyy/l0  0  0  0  6*E*iyy/l02  0  4*E*iyy/l0  0];[0  6*E*ixx/l02  0  0  0  2*E*ixx/l0  0  -6*E*ixx/l02  0  0  0  4*E*ixx/l0]]\n",
    "\n",
    "            \n",
    "            ################################\n",
    "#             mass=10\n",
    "#             nu=0.35\n",
    "#             W = 75\n",
    "#             L = W/sqrt(2)\n",
    "#             L=length\n",
    "#             n_min = 1\n",
    "#             n_max = 7\n",
    "#             # Cross Section inputs, must be floats\n",
    "#             E = 2000  # MPa\n",
    "#             G = E * 1 / 3  # MPa\n",
    "#             h = 2.38  # mm\n",
    "#             b = 2.38  # mm\n",
    "#             rho = 7.85e-9 / 3  # kg/mm^3\n",
    "#             S = h * b\n",
    "#             Sy = (S * (6 + 12 * nu + 6 * nu^2)/ (7 + 12 * nu + 4 * nu^2))\n",
    "#             # For solid rectangular cross section (width=b, depth=d & ( b < d )):\n",
    "#             Q = 1 / 3 - 0.2244 / (min(h / b, b / h) + 0.1607)\n",
    "#             J = Q * min(h * b^3, b * h^3)\n",
    "            \n",
    "            \n",
    "#             ##if voxels\n",
    "#             #nu=0\n",
    "#             #L=l\n",
    "#             #a1 = E*L # EA/L : Units of N/m\n",
    "#             #a2 = E * L*L*L / (12.0*(1+nu)) # GJ/L : Units of N-m\n",
    "#             #b1 = E*L # 12EI/L^3 : Units of N/m\n",
    "#             #b2 = E*L*L/2.0 # 6EI/L^2 : Units of N (or N-m/m: torque related to linear distance)\n",
    "#             #b3 = E*L*L*L/6.0 # 2EI/L : Units of N-m\n",
    "            \n",
    "#             I= b*h^3/12\n",
    "# #             J=b*h*(b*b+h*h)/12\n",
    "#             a1=E*b*h/L\n",
    "#             a2=G*J/L\n",
    "#             b1=12*E*I/(L^3)\n",
    "#             b2=6*E*I/(L^2)\n",
    "#             b3=2*E*I/(L)\n",
    "\n",
    "            \n",
    "\n",
    "#             k = [[E*A/l0  0  0  0  0  0  -E*A/l0  0  0  0  0  0];[0  12*E*ixx/l03  0  0  0  6*E*ixx/l02  0  -12*E*ixx/l03  0  0  0  6*E*ixx/l02];[0  0  12*E*iyy/l03  0  -6*E*iyy/l02  0  0  0  -12*E*iyy/l03  0  -6*E*iyy/l02  0];[0  0  0  G*j/l0  0  0  0  0  0  -G*j/l0  0  0];[0  0  -6*E*iyy/l02  0  4*E*iyy/l0  0  0  0  6*E*iyy/l02  0  2*E*iyy/l0  0];[0  6*E*ixx/l02  0  0  0  4*E*ixx/l0  0  -6*E*ixx/l02  0  0  0  2*E*ixx/l0];[-E*A/l0  0  0  0  0  0  E*A/l0  0  0  0  0  0];[0  -12*E*ixx/l03  0  0  0  -6*E*ixx/l02  0  12*E*ixx/l03  0  0  0  -6*E*ixx/l02];[0  0  -12*E*iyy/l03  0  6*E*iyy/l02  0  0  0  12*E*iyy/l03  0  6*E*iyy/l02  0];[0  0  0  -G*j/l0  0  0  0  0  0  G*j/l0  0  0];[0  0  -6*E*iyy/l02  0  2*E*iyy/l0  0  0  0  6*E*iyy/l02  0  4*E*iyy/l0  0];[0  6*E*ixx/l02  0  0  0  2*E*ixx/l0  0  -6*E*ixx/l02  0  0  0  4*E*ixx/l0]]\n",
    "#             k= [[ a1  0  0  0   0   0  -a1  0   0   0   0   0  ];\n",
    "#                 [  0 b1  0  0   0   b2  0  -b1  0   0   0   b2 ];\n",
    "#                 [  0  0  b1 0  -b2  0   0   0  -b1  0  -b2  0  ];\n",
    "#                 [  0  0  0  a2  0   0   0   0   0  -a2  0   0  ];\n",
    "#                 [  0  0  0  0  2b3  0   0   0   b2  0   b3  0  ];\n",
    "#                 [  0  0  0  0   0  2b3  0  -b2  0   0   0   b3 ];\n",
    "#                 [  0  0  0  0   0   0   a1  0   0   0   0   0  ];\n",
    "#                 [  0  0  0  0   0   0   0   b1  0   0   0  -b2 ];\n",
    "#                 [  0  0  0  0   0   0   0   0   b1  0   b2  0  ];\n",
    "#                 [  0  0  0  0   0   0   0   0   0   a2  0   0  ];\n",
    "#                 [  0  0  0  0   0   0   0   0   0    0 2b3  0  ];\n",
    "#                 [  0  0  0  0   0   0   0   0   0    0  0  2b3 ]]\n",
    "            # find rotated mass and stifness matrices\n",
    "            tau = rotation_matrix(element_vector, x_axis,y_axis,z_axis)\n",
    "\n",
    "            # m_r=transpose(tau)*m*tau\n",
    "            k_r=transpose(tau)*k*tau\n",
    "\n",
    "            # change from element to global coordinate\n",
    "            index= dofs.+1\n",
    "\n",
    "            B=zeros((12,ndofs))\n",
    "            for i in 1:12\n",
    "                  B[i,index[i]]=1.0\n",
    "            end\n",
    "\n",
    "\n",
    "            # M_rG= transpose(B)*m_r*B\n",
    "            K_rG= transpose(B)*k_r*B\n",
    "\n",
    "            # M += Cm .* M_rG\n",
    "            # K += Ck .* K_rG\n",
    "            K +=  K_rG\n",
    "\n",
    "        end\n",
    "        \n",
    "        \n",
    "        # construct the force vector\n",
    "        F=zeros(ndofs)\n",
    "        remove_indices=[];\n",
    "        for node in nodes\n",
    "            #insert!(F,i, value);\n",
    "            #F=vcat(F,value)\n",
    "            \n",
    "            \n",
    "            i=parse(Int,node[\"id\"][2:end])\n",
    "            f=node[\"force\"]\n",
    "            \n",
    "            # println(f)\n",
    "            F[(i)*6+1]+=f[\"x\"]\n",
    "            F[(i)*6+2]+=f[\"y\"]\n",
    "            F[(i)*6+3]+=f[\"z\"]\n",
    "            F[(i)*6+4]+=0\n",
    "            F[(i)*6+5]+=0\n",
    "            F[(i)*6+6]+=0\n",
    "            Load+=f[\"y\"]\n",
    "            if (F[(i)*6+2]!=0)\n",
    "                append!(topNodesIndices,i+1)\n",
    "            end\n",
    "            \n",
    "            dofs = convert(Array{Int}, node[\"degrees_of_freedom\"]).+1\n",
    "            restrained_dofs=node[\"restrained_degrees_of_freedom\"]\n",
    "            for (index, value) in enumerate(dofs)\n",
    "                if restrained_dofs[index]\n",
    "                    append!( remove_indices, value)\n",
    "                end\n",
    "            end\n",
    "            \n",
    "        end\n",
    "\n",
    "        #println(remove_indices)\n",
    "        #print(K)\n",
    "        #print(F)\n",
    "        \n",
    "\n",
    "        #M = M[setdiff(1:end, remove_indices), :]\n",
    "        K = K[setdiff(1:end, remove_indices), :]\n",
    "\n",
    "        #M = M[:,setdiff(1:end, remove_indices)]\n",
    "        K = K[:,setdiff(1:end, remove_indices)]\n",
    "\n",
    "        F = F[setdiff(1:end, remove_indices)]\n",
    "        \n",
    "        U=zeros(ndofs)\n",
    "        \n",
    "        return M,K,F,U,remove_indices\n",
    "    end\n",
    "\n",
    "    \n",
    "    function updateDisplacement(setup, X)\n",
    "        nodes= setup[\"nodes\"]\n",
    "        i=0\n",
    "        for node in nodes\n",
    "            \n",
    "#             if !node[\"restrained_degrees_of_freedom\"][2]\n",
    "                #i=parse(Int,node[\"id\"][2:end])\n",
    "                node[\"displacement\"][\"x\"]=X[(i)*6+1]/15\n",
    "                node[\"displacement\"][\"y\"]=X[(i)*6+2]/15\n",
    "                node[\"displacement\"][\"z\"]=X[(i)*6+3]/15\n",
    "                node[\"angle\"][\"x\"]=X[(i)*6+4]\n",
    "                node[\"angle\"][\"y\"]=X[(i)*6+5]\n",
    "                node[\"angle\"][\"z\"]=X[(i)*6+6]\n",
    "                append!(displacementFEA,[Vector3(X[(i)*6+1],X[(i)*6+2],X[(i)*6+3])])\n",
    "                i=i+1\n",
    "#             else\n",
    "#                 append!(displacementFEA,[Vector3(0,0,0)])\n",
    "#             end\n",
    "        end\n",
    "    end\n",
    "    \n",
    "    #######################################################\n",
    "\n",
    "    function get_stresses(setup)\n",
    "        nodes      = setup[\"nodes\"]\n",
    "        edges      = setup[\"edges\"]\n",
    "        ndofs      = length(nodes)*6\n",
    "\n",
    "        x_axis     = [1 0 0]\n",
    "        y_axis     = [0 1 0]\n",
    "        z_axis     = [0 0 1]\n",
    "\n",
    "        # find the stresses in each member\n",
    "        stresses=zeros(length(edges))\n",
    "        max11=-10e6\n",
    "        min11=10e6\n",
    "        for edge in edges\n",
    "            #degrees_of_freedom = properties[\"degrees_of_freedom\"]\n",
    "\n",
    "            element=parse(Int,edge[\"id\"][2:end])\n",
    "\n",
    "            # find the nodes that the lements connects\n",
    "            fromNode = nodes[edge[\"source\"]+1]\n",
    "            toNode = nodes[edge[\"target\"]+1]\n",
    "\n",
    "            # the coordinates for each node\n",
    "            fromPoint = [fromNode[\"position\"][\"x\"]*15.0 fromNode[\"position\"][\"y\"]*15.0 fromNode[\"position\"][\"z\"]*15.0]\n",
    "            toPoint = [toNode[\"position\"][\"x\"]*15.0 toNode[\"position\"][\"y\"]*15.0 toNode[\"position\"][\"z\"]*15.0]\n",
    "\n",
    "            # find the degrees of freedom for each node\n",
    "            dofs = convert(Array{Int}, fromNode[\"degrees_of_freedom\"])\n",
    "            dofs=vcat(dofs,convert(Array{Int}, toNode[\"degrees_of_freedom\"]))\n",
    "\n",
    "            element_vector=toPoint-fromPoint\n",
    "\n",
    "\n",
    "            # find rotated mass and stifness matrices\n",
    "            tau = rotation_matrix(element_vector, x_axis,y_axis,z_axis)\n",
    "\n",
    "            # i1=parse(Int,fromNode[\"id\"][2:end])\n",
    "            # i2=parse(Int,toNode[\"id\"][2:end])\n",
    "\n",
    "            # global_displacements=[X[(i1)*6+1] X[(i1)*6+2] X[(i1)*6+3] X[(i1)*6+4] X[(i1)*6+5] X[(i1)*6+6] X[(i2)*6+1] X[(i2)*6+2] X[(i2)*6+3] X[(i2)*6+4] X[(i2)*6+5] X[(i2)*6+6]] # todo change\n",
    "            global_displacements=[fromNode[\"displacement\"][\"x\"]*15 fromNode[\"displacement\"][\"y\"]*15 fromNode[\"displacement\"][\"z\"]*15 fromNode[\"angle\"][\"x\"] fromNode[\"angle\"][\"y\"] fromNode[\"angle\"][\"z\"] toNode[\"displacement\"][\"x\"]*15 toNode[\"displacement\"][\"y\"]*15 toNode[\"displacement\"][\"z\"]*15 toNode[\"angle\"][\"x\"] toNode[\"angle\"][\"y\"] toNode[\"angle\"][\"z\"]] # todo change\n",
    "\n",
    "            # nodal displacement\n",
    "\n",
    "            q=tau*transpose(global_displacements)\n",
    "            # println(q)\n",
    "            # calculate the strain and stresses\n",
    "            strain =(q[7]-q[1])/norm(element_vector)\n",
    "            E = edge[\"stiffness\"]# youngs modulus\n",
    "            E=2000\n",
    "            stress=E.*strain\n",
    "            edge[\"stress\"]=stress\n",
    "            if stress>max11\n",
    "                max11=stress\n",
    "            end\n",
    "            if stress<min11\n",
    "                min11=stress\n",
    "            end\n",
    "            # println(element)\n",
    "            # println(stress)\n",
    "        end\n",
    "\n",
    "\n",
    "\n",
    "        setup[\"viz\"][\"minStress\"]=min11\n",
    "        setup[\"viz\"][\"maxStress\"]=max11\n",
    "        return stresses\n",
    "    end\n",
    "    \n",
    "    function initialize(setup)\n",
    "        nodes      = setup[\"nodes\"]\n",
    "        ndofs      = length(nodes)*6\n",
    "        \n",
    "        i=0\n",
    "        for node in nodes\n",
    "            dg=[]\n",
    "            for ii in 0:5\n",
    "                append!(dg,i+ii) \n",
    "            end\n",
    "            i+=6\n",
    "            node[\"degrees_of_freedom\"]=dg\n",
    "        end\n",
    "    end\n",
    "\n",
    "    #######################################################\n",
    "    function solveFea(setup)\n",
    "        // # determine the global matrices\n",
    "        initialize(setup)\n",
    "        \n",
    "        M,K,F,U,ind=get_matrices(setup)\n",
    "        \n",
    "        #println(M)\n",
    "        #println(K)\n",
    "        #println(F)\n",
    "\n",
    "        #evals=eigvals(K,M)\n",
    "        #evecs=eigvecs(K,M)\n",
    "        #frequencies=sqrt.(evals)\n",
    "        X=inv(K)*F\n",
    "        U[setdiff(1:end, ind)]=X\n",
    "\n",
    "        updateDisplacement(setup, U)\n",
    "\n",
    "        # determine the stresses in each element\n",
    "        stresses=get_stresses(setup)\n",
    "    end\n",
    "    #######################################################\n",
    "    displacementFEA=[]\n",
    "    Load=0\n",
    "    topNodesIndices=[]\n",
    "    solveFea(setup)\n",
    "    return displacementFEA,Load,topNodesIndices\n",
    "end"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 138,
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "getYoungsModulus (generic function with 1 method)"
      ]
     },
     "execution_count": 138,
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "function getYoungsModulus(latticeSize,voxelSize,disp,Load,topNodesIndices)\n",
    "    F=-Load\n",
    "    l0=voxelSize*latticeSize\n",
    "    A=l0*l0\n",
    "\n",
    "    δl1=-mean( x.y for x in disp[topNodesIndices])\n",
    "        \n",
    "    stresses=F/A\n",
    "    strain=δl1/l0\n",
    "    println(\"Load=$Load\")\n",
    "    println(\"stress=$stresses\")\n",
    "\n",
    "    E=stresses/strain \n",
    "\n",
    "    return E\n",
    "end\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 139,
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "getSetup (generic function with 1 method)"
      ]
     },
     "execution_count": 139,
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "function getSetup(latticeSize)\n",
    "    setup = Dict()\n",
    "    name=string(\"../../json/setupTestUni$latticeSize\",\".json\")\n",
    "#     name=string(\"../../json/canteliver\",\".json\")\n",
    "    \n",
    "#     open(\"../../json/setupValid2.json\", \"r\") do f\n",
    "#     open(\"../../json/setupTest.json\", \"r\") do f\n",
    "    # open(\"../../json/trialJulia.json\", \"r\") do f\n",
    "#     open(\"../../json/setupTestUni4.json\", \"r\") do f\n",
    "    # open(\"../../json/setupChiral.json\", \"r\") do f\n",
    "#     open(\"../../json/setupTestCubeUni10.json\", \"r\") do f\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
    "    open(name, \"r\") do f\n",
    "#         global setup\n",
    "        dicttxt = String(read(f))  # file information to string\n",
    "        setup=JSON.parse(dicttxt)  # parse and transform data\n",
    "    end\n",
    "\n",
    "    setup=setup[\"setup\"]\n",
    "    return setup\n",
    "end"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 140,
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
     ]
    },
    {
     "data": {
      "text/plain": [
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
      ]
     },
     "execution_count": 140,
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "latticeSize=2\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
    "setup=getSetup(latticeSize)\n",
    "displacementFEA,Load,topNodesIndices=fea(setup)\n",
    "topNodesIndices\n",
    "println(length(setup[\"nodes\"]))\n",
    "length(setup[\"edges\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 141,
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "5-element Array{Float64,1}:\n",
       " 0.0\n",
       " 0.0\n",
       " 0.0\n",
       " 0.0\n",
       " 0.0"
      ]
     },
     "execution_count": 141,
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "DDisplacements=[[],[],[],[],[]]\n",
    "DDisplacementsFEA=[[],[],[],[],[]]\n",
    "Loads=[0.0,0,0,0,0]\n",
    "EsFEA=[0.0,0,0,0,0]\n",
    "Es=[0.0,0,0,0,0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 142,
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Dict{String,Any} with 8 entries:\n",
       "  \"nodes\"        => Any[Dict{String,Any}(\"degrees_of_freedom\"=>Any[0, 1, 2, 3, …\n",
       "  \"voxelSize\"    => 5\n",
       "  \"numTimeSteps\" => 100\n",
       "  \"hierarchical\" => false\n",
       "  \"animation\"    => Dict{String,Any}(\"exaggeration\"=>2000,\"speed\"=>3,\"showDispl…\n",
       "  \"viz\"          => Dict{String,Any}(\"colorMap\"=>0,\"exaggeration\"=>10000,\"color…\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"edges\"        => Any[Dict{String,Any}(\"source\"=>0,\"area\"=>1,\"density\"=>0.028…\n",
       "  \"ndofs\"        => 324"
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
      ]
     },
     "execution_count": 142,
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "setup"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 145,
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
      ]
     },
     "execution_count": 145,
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "latticeSize=3\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
    "setup=getSetup(latticeSize)\n",
    "displacementFEA,Load,topNodesIndices=fea(setup)\n",
    "# displacementFEA,Load,topNodesIndices=feaDisplacement(setup,latticeSize)\n",
    "updateDataAndSaveFEA!(setup,\"../../json/trialJuliaParallelGPU.json\")\n"
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 146,
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "dt: 0.007294855212986816\n",
      "first timestep took 0.000645101 seconds\n",
      "ran latticeSize 3 with 144 voxels and 432 edges for 6000 time steps took 2.0397974 seconds\n",
      "Load=-900.0\n",
      "stress=0.017777777777777778\n",
      "Load=-900.0\n",
      "stress=0.017777777777777778\n",
      "EsFEA:[0.0, 1.3631163779051199, 1.4928557096014121, 0.0, 0.0]\n",
      "Es:[0.0, 1.3636389591522067, 1.4821324986526747, 0.0, 0.0]\n",
      "FEA displacement= -3.161875031059339,converged displacement= -3.199251807603066\n"
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
     ]
    },
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n",
       "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"600\" height=\"400\" viewBox=\"0 0 2400 1600\">\n",
       "<defs>\n",
       "  <clipPath id=\"clip3900\">\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "    <rect x=\"0\" y=\"0\" width=\"2400\" height=\"1600\"/>\n",
       "  </clipPath>\n",
       "</defs>\n",
       "<path clip-path=\"url(#clip3900)\" d=\"\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "M0 1600 L2400 1600 L2400 0 L0 0  Z\n",
       "  \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
       "<defs>\n",
       "  <clipPath id=\"clip3901\">\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "    <rect x=\"480\" y=\"0\" width=\"1681\" height=\"1600\"/>\n",
       "  </clipPath>\n",
       "</defs>\n",
       "<path clip-path=\"url(#clip3900)\" d=\"\n",
       "M203.721 1425.62 L2352.76 1425.62 L2352.76 121.675 L203.721 121.675  Z\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
       "<defs>\n",
       "  <clipPath id=\"clip3902\">\n",
       "    <rect x=\"203\" y=\"121\" width=\"2150\" height=\"1305\"/>\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  </clipPath>\n",
       "</defs>\n",
       "<polyline clip-path=\"url(#clip3902)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
       "  261.163,1425.62 261.163,121.675 \n",
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip3902)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
       "  599.062,1425.62 599.062,121.675 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip3902)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
       "  936.961,1425.62 936.961,121.675 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip3902)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
       "  1274.86,1425.62 1274.86,121.675 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip3902)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
       "  1612.76,1425.62 1612.76,121.675 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip3902)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
       "  1950.66,1425.62 1950.66,121.675 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip3902)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
       "  2288.56,1425.62 2288.56,121.675 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip3902)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
       "  203.721,1249.44 2352.76,1249.44 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip3902)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
       "  203.721,885.818 2352.76,885.818 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip3902)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
       "  203.721,522.199 2352.76,522.199 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip3902)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
       "  203.721,158.579 2352.76,158.579 \n",
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip3900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  203.721,1425.62 2352.76,1425.62 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip3900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  203.721,1425.62 203.721,121.675 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip3900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  261.163,1425.62 261.163,1409.97 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip3900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  599.062,1425.62 599.062,1409.97 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip3900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  936.961,1425.62 936.961,1409.97 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip3900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  1274.86,1425.62 1274.86,1409.97 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip3900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  1612.76,1425.62 1612.76,1409.97 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip3900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  1950.66,1425.62 1950.66,1409.97 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip3900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  2288.56,1425.62 2288.56,1409.97 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip3900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  203.721,1249.44 229.509,1249.44 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip3900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  203.721,885.818 229.509,885.818 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip3900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  203.721,522.199 229.509,522.199 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip3900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  203.721,158.579 229.509,158.579 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<g clip-path=\"url(#clip3900)\">\n",
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 261.163, 1479.62)\" x=\"261.163\" y=\"1479.62\">0</text>\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "</g>\n",
       "<g clip-path=\"url(#clip3900)\">\n",
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 599.062, 1479.62)\" x=\"599.062\" y=\"1479.62\">100</text>\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "</g>\n",
       "<g clip-path=\"url(#clip3900)\">\n",
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 936.961, 1479.62)\" x=\"936.961\" y=\"1479.62\">200</text>\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "</g>\n",
       "<g clip-path=\"url(#clip3900)\">\n",
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1274.86, 1479.62)\" x=\"1274.86\" y=\"1479.62\">300</text>\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "</g>\n",
       "<g clip-path=\"url(#clip3900)\">\n",
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1612.76, 1479.62)\" x=\"1612.76\" y=\"1479.62\">400</text>\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "</g>\n",
       "<g clip-path=\"url(#clip3900)\">\n",
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1950.66, 1479.62)\" x=\"1950.66\" y=\"1479.62\">500</text>\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "</g>\n",
       "<g clip-path=\"url(#clip3900)\">\n",
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 2288.56, 1479.62)\" x=\"2288.56\" y=\"1479.62\">600</text>\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "</g>\n",
       "<g clip-path=\"url(#clip3900)\">\n",
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 179.721, 1266.94)\" x=\"179.721\" y=\"1266.94\">-3</text>\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "</g>\n",
       "<g clip-path=\"url(#clip3900)\">\n",
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 179.721, 903.318)\" x=\"179.721\" y=\"903.318\">-2</text>\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "</g>\n",
       "<g clip-path=\"url(#clip3900)\">\n",
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 179.721, 539.699)\" x=\"179.721\" y=\"539.699\">-1</text>\n",
       "</g>\n",
       "<g clip-path=\"url(#clip3900)\">\n",
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 179.721, 176.079)\" x=\"179.721\" y=\"176.079\">0</text>\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "</g>\n",
       "<g clip-path=\"url(#clip3900)\">\n",
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:84px; text-anchor:middle;\" transform=\"rotate(0, 1278.24, 73.2)\" x=\"1278.24\" y=\"73.2\">3 Voxel Convergence Study</text>\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "</g>\n",
       "<g clip-path=\"url(#clip3900)\">\n",
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:66px; text-anchor:middle;\" transform=\"rotate(0, 1278.24, 1559.48)\" x=\"1278.24\" y=\"1559.48\">timestep</text>\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "</g>\n",
       "<g clip-path=\"url(#clip3900)\">\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:66px; text-anchor:middle;\" transform=\"rotate(-90, 89.2861, 773.647)\" x=\"89.2861\" y=\"773.647\">displacement</text>\n",
       "</g>\n",
       "<polyline clip-path=\"url(#clip3902)\" style=\"stroke:#009af9; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  264.542,158.579 602.441,1096.87 940.34,1350.79 1278.24,1388.71 1616.14,1360.7 1954.04,1333.81 2291.93,1321.89 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip3902)\" style=\"stroke:#e26f46; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  264.542,1308.3 602.441,1308.3 940.34,1308.3 1278.24,1308.3 1616.14,1308.3 1954.04,1308.3 2291.93,1308.3 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<path clip-path=\"url(#clip3900)\" d=\"\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "M1853.56 386.635 L2280.76 386.635 L2280.76 205.195 L1853.56 205.195  Z\n",
       "  \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
       "<polyline clip-path=\"url(#clip3900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  1853.56,386.635 2280.76,386.635 2280.76,205.195 1853.56,205.195 1853.56,386.635 \n",
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip3900)\" style=\"stroke:#009af9; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  1877.56,265.675 2021.56,265.675 \n",
       "  \"/>\n",
       "<g clip-path=\"url(#clip3900)\">\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:start;\" transform=\"rotate(0, 2045.56, 283.175)\" x=\"2045.56\" y=\"283.175\">Dynamic</text>\n",
       "</g>\n",
       "<polyline clip-path=\"url(#clip3900)\" style=\"stroke:#e26f46; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  1877.56,326.155 2021.56,326.155 \n",
       "  \"/>\n",
       "<g clip-path=\"url(#clip3900)\">\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:start;\" transform=\"rotate(0, 2045.56, 343.655)\" x=\"2045.56\" y=\"343.655\">FEA</text>\n",
       "</g>\n",
       "</svg>\n"
      ]
     },
     "execution_count": 146,
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\n",
    "setup=getSetup(latticeSize)\n",
    "numTimeSteps=6000\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
    "displacements=[]\n",
    "save=true\n",
    "returnEvery=10\n",
    "runMetavoxelGPU!(setup,numTimeSteps,latticeSize,displacements,returnEvery,true)\n",
    "\n",
    "numTimeStepsRecorded=length(displacements)\n",
    "d=[]\n",
    "dFEA=[]\n",
    "j=length(displacements[end])\n",
    "step=100\n",
    "for i in 1:step:numTimeStepsRecorded\n",
    "    append!(d,displacements[i][j].y)\n",
    "    append!(dFEA,displacementFEA[j].y)\n",
    "end\n",
    "Loads[latticeSize]=Load\n",
    "DDisplacements[latticeSize]=d\n",
    "DDisplacementsFEA[latticeSize]=dFEA\n",
    "\n",
    "E1=getYoungsModulus(latticeSize,75,displacementFEA,Load,topNodesIndices)\n",
    "E2=getYoungsModulus(latticeSize,75,displacements[end],Load,topNodesIndices)\n",
    "\n",
    "EsFEA[latticeSize]=E1\n",
    "Es[latticeSize]=E2\n",
    "\n",
    "print(\"EsFEA:\" )\n",
    "println(EsFEA)\n",
    "print(\"Es:\" )\n",
    "println(Es)\n",
    "\n",
    "println(\"FEA displacement= $(displacementFEA[j].y),converged displacement= $(displacements[numTimeStepsRecorded][j].y)\")\n",
    "plot(1:step:numTimeStepsRecorded,d,label=\"Dynamic\",xlabel=\"timestep\",ylabel=\"displacement\",title=\"$latticeSize Voxel Convergence Study\")\n",
    "plot!(1:step:numTimeStepsRecorded,dFEA,label=\"FEA\")\n",
    "# savefig(\"4_voxel_convergence\")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 147,
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n",
       "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"600\" height=\"400\" viewBox=\"0 0 2400 1600\">\n",
       "<defs>\n",
       "  <clipPath id=\"clip4300\">\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "    <rect x=\"0\" y=\"0\" width=\"2400\" height=\"1600\"/>\n",
       "  </clipPath>\n",
       "</defs>\n",
       "<path clip-path=\"url(#clip4300)\" d=\"\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "M0 1600 L2400 1600 L2400 0 L0 0  Z\n",
       "  \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
       "<defs>\n",
       "  <clipPath id=\"clip4301\">\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "    <rect x=\"480\" y=\"0\" width=\"1681\" height=\"1600\"/>\n",
       "  </clipPath>\n",
       "</defs>\n",
       "<path clip-path=\"url(#clip4300)\" d=\"\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "M203.721 1425.62 L2352.76 1425.62 L2352.76 121.675 L203.721 121.675  Z\n",
       "  \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
       "<defs>\n",
       "  <clipPath id=\"clip4302\">\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "    <rect x=\"203\" y=\"121\" width=\"2150\" height=\"1305\"/>\n",
       "  </clipPath>\n",
       "</defs>\n",
       "<polyline clip-path=\"url(#clip4302)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
       "  250.365,1425.62 250.365,121.675 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip4302)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
       "  675.692,1425.62 675.692,121.675 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip4302)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
       "  1101.02,1425.62 1101.02,121.675 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip4302)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
       "  1526.35,1425.62 1526.35,121.675 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip4302)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
       "  1951.67,1425.62 1951.67,121.675 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip4302)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
       "  203.721,1311.05 2352.76,1311.05 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip4302)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
       "  203.721,926.892 2352.76,926.892 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip4302)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
       "  203.721,542.736 2352.76,542.736 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip4302)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  203.721,158.579 2352.76,158.579 \n",
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip4300)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  203.721,1425.62 2352.76,1425.62 \n",
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip4300)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  203.721,1425.62 203.721,121.675 \n",
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip4300)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  250.365,1425.62 250.365,1409.97 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip4300)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  675.692,1425.62 675.692,1409.97 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip4300)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  1101.02,1425.62 1101.02,1409.97 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip4300)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  1526.35,1425.62 1526.35,1409.97 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip4300)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  1951.67,1425.62 1951.67,1409.97 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip4300)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  203.721,1311.05 229.509,1311.05 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip4300)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  203.721,926.892 229.509,926.892 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip4300)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  203.721,542.736 229.509,542.736 \n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip4300)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "  203.721,158.579 229.509,158.579 \n",
       "  \"/>\n",
       "<g clip-path=\"url(#clip4300)\">\n",
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 250.365, 1479.62)\" x=\"250.365\" y=\"1479.62\">0</text>\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "</g>\n",
       "<g clip-path=\"url(#clip4300)\">\n",
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 675.692, 1479.62)\" x=\"675.692\" y=\"1479.62\">30</text>\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "</g>\n",
       "<g clip-path=\"url(#clip4300)\">\n",
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1101.02, 1479.62)\" x=\"1101.02\" y=\"1479.62\">60</text>\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "</g>\n",
       "<g clip-path=\"url(#clip4300)\">\n",
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1526.35, 1479.62)\" x=\"1526.35\" y=\"1479.62\">90</text>\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "</g>\n",
       "<g clip-path=\"url(#clip4300)\">\n",
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1951.67, 1479.62)\" x=\"1951.67\" y=\"1479.62\">120</text>\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "</g>\n",
       "<g clip-path=\"url(#clip4300)\">\n",
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 179.721, 1328.55)\" x=\"179.721\" y=\"1328.55\">-3</text>\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "</g>\n",
       "<g clip-path=\"url(#clip4300)\">\n",
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 179.721, 944.392)\" x=\"179.721\" y=\"944.392\">-2</text>\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "</g>\n",
       "<g clip-path=\"url(#clip4300)\">\n",
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 179.721, 560.236)\" x=\"179.721\" y=\"560.236\">-1</text>\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "</g>\n",
       "<g clip-path=\"url(#clip4300)\">\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 179.721, 176.079)\" x=\"179.721\" y=\"176.079\">0</text>\n",
       "</g>\n",
       "<g clip-path=\"url(#clip4300)\">\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:84px; text-anchor:middle;\" transform=\"rotate(0, 1278.24, 73.2)\" x=\"1278.24\" y=\"73.2\">Node Displacement</text>\n",
       "</g>\n",
       "<g clip-path=\"url(#clip4300)\">\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:66px; text-anchor:middle;\" transform=\"rotate(0, 1278.24, 1559.48)\" x=\"1278.24\" y=\"1559.48\">Node ID</text>\n",
       "</g>\n",
       "<g clip-path=\"url(#clip4300)\">\n",
Amira Abdel-Rahman's avatar
Amira Abdel-Rahman committed
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:66px; text-anchor:middle;\" transform=\"rotate(-90, 89.2861, 773.647)\" x=\"89.2861\" y=\"773.647\">displacement</text>\n",
       "</g>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"264.542\" cy=\"158.579\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"278.72\" cy=\"158.579\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"292.898\" cy=\"158.579\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"307.075\" cy=\"158.579\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"321.253\" cy=\"463.982\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"335.43\" cy=\"301.992\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"349.608\" cy=\"253.252\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"363.785\" cy=\"591.902\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"377.963\" cy=\"594.83\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"392.14\" cy=\"461.458\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"406.318\" cy=\"470.265\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"420.496\" cy=\"299.627\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"434.673\" cy=\"158.579\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"448.851\" cy=\"158.579\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"463.028\" cy=\"158.579\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"477.206\" cy=\"360.914\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"491.383\" cy=\"252.711\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"505.561\" cy=\"325.286\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"519.739\" cy=\"464.058\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"533.916\" cy=\"301.914\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"548.094\" cy=\"158.579\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"562.271\" cy=\"158.579\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"576.449\" cy=\"158.579\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"590.626\" cy=\"461.834\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"604.804\" cy=\"299.857\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"618.982\" cy=\"596.162\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"633.159\" cy=\"592.222\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"647.337\" cy=\"470.868\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"661.514\" cy=\"705.691\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"675.692\" cy=\"615.716\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"689.869\" cy=\"593.798\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"704.047\" cy=\"606.538\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"718.224\" cy=\"599.106\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"732.402\" cy=\"705.454\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"746.58\" cy=\"591.219\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"760.757\" cy=\"616.947\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"774.935\" cy=\"862.346\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"789.112\" cy=\"593.858\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"803.29\" cy=\"986.748\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"817.467\" cy=\"703.031\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"831.645\" cy=\"616.689\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"845.823\" cy=\"704.65\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"860\" cy=\"616.425\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"874.178\" cy=\"596.581\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"888.355\" cy=\"603.512\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"902.533\" cy=\"589.104\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"916.71\" cy=\"1248.47\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"930.888\" cy=\"968.845\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"945.066\" cy=\"958.789\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"959.243\" cy=\"1384.28\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"973.421\" cy=\"1385.42\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"987.598\" cy=\"1255.23\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"1001.78\" cy=\"982.605\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"1015.95\" cy=\"974.963\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"1030.13\" cy=\"984.667\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"1044.31\" cy=\"956.756\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"1058.49\" cy=\"907.998\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"1072.66\" cy=\"1253.92\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"1086.84\" cy=\"968.189\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"1101.02\" cy=\"1251.49\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"1115.2\" cy=\"972.822\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"1129.37\" cy=\"1384.47\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"1143.55\" cy=\"1381.57\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"1157.73\" cy=\"978.779\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"1171.91\" cy=\"158.579\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"1186.08\" cy=\"158.579\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"1200.26\" cy=\"158.579\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",
       "<circle clip-path=\"url(#clip4302)\" cx=\"1214.44\" cy=\"465.045\" r=\"14\" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"3.2\"/>\n",