(Draf, Dl, n, e) = np.load('poutrecourbe.npy', allow_pickle=True) (Dl, n, e) = np.load('poutrecourbeQ9.npy', allow_pickle=True) n = n.T m = px.Mesh(e, n) m.Plot(facecolor='#888888') #%% #nr=np.array([1132,1131,1130,1129,1128,1094,1054,1053,1052,1019,978,977,976,944,902,870,828,796,754,753,752,721,678,647,604,605,606,607,608,575,534,535,536,576,610,650,684,685,686,725,760,761,762,800,836,874,910,948,984,1022,1058,1096]) #nr2=nr[np.arange(0,52,2)] #m2.Plot() #plt.plot(m2.n[nr2,0],m2.n[nr2,1],'r.') #for i in range(len(nr2)): # print('Point(%2d) = {%6.10e, %6.10e, 0, .1};' % (i+9,m.n[nr2[i],0],m.n[nr2[i],1])) mf = px.ReadMeshGMSH('fish.msh') mf.Plot(facecolor='r') #m.PlotElemLabels() #mf.PlotNodeLabels() #%% # liste des elements recouverts par le patch er = np.array([ 322, 321, 320, 296, 272, 248, 247, 223, 222, 198, 199, 200, 176, 224, 225, 249, 273, 274, 298, 297, 250, 295, 271, 345, 346 ]) ### Création du maillage du modèle complémentaire et du maillage du modèle local m2 = m.Copy()
### Definition of parameters E = 210000 # Young modulus nu = 0.3 # Poisson ratio rho = 7800e-9 # Volumic mass ### Proportional coefficients for damping a = 2e-4 b = 1. ### Plane stress model hooke = E / (1-nu**2) * np.array([[1,nu,0],[nu,1,0],[0,0,0.5*(1-nu)]]) #%% #### Loading the mesh mesh = px.ReadMeshGMSH('support-1.msh') #mesh.Plot() #### Computing the mass and stiffness matrices mesh.Connectivity() # Computation of the connectivity K = mesh.Stiffness(hooke).tocsc() # Assembling of the stiffness matrix M = mesh.Mass(rho).tocsc() # Assembling of the mass matrix #%% #### Elimination of boundary conditions ### Loading the numbering of the blocked nodes. bc = np.loadtxt('bc-1.txt').astype(int) ### Obtaining the numbering of the eliminated dofs dofBC = np.sort(mesh.conn[bc,:].ravel())
import scipy.sparse.linalg as splalg import scipy as sp import pyxel as px #%% ============================================================================ # Datafiles, images and mesh ================================================= # ============================================================================== imnums=np.array([53,54,57,58,61,62,65,66,69,70,75]) imagefile='./data/dic_composite/zoom-0%03d_1.tif' imref = imagefile % imnums[0] f=px.Image(imref).Load() f.Show() # Triangular Mesh in milimeter m=px.ReadMeshGMSH('./data/dic_composite/gmsh_t3_mm.msh') #cam=px.MeshCalibration(f,m,[1,2]) cam=px.Camera(np.array([10.49882137, 51.07774613, -6.53402857, 1.56607077])) l0=1 # regularization length # Quadrilateral Mesh in meter m=px.ReadMeshINP('./data/dic_composite/abaqus_q4_m.inp') #cam=px.MeshCalibration(f,m,[1,2]) cam=px.Camera(np.array([ 1.05168768e+04, 5.13737634e-02, -9.65935782e-02, -2.65443047e-03])) l0=0.005 # regularization length # Visualization of the mesh using Matplotlib m.Plot() # Or Visualization of the mesh using Paraview m.VTKMesh('dic_composite/Mesh')
ls.NewCircle() ls.NewLine() ls.NewLine() ls.FineTuning() cam = ls.Calibration() # cam = px.Camera(np.array([-10.528098,-50.848452,6.430594,-1.574282])) if PLOT: px.PlotMeshImage(f, m, cam) #%% ONE RECTANGLE m.e[3] = m.e[3][[0], :] one_element_integration_test(m, cam) #%% TRI3 mesh m = px.ReadMeshGMSH('gmsh_t3_mm.msh') cam = px.Camera(np.array([-10.528098, -50.848452, 6.430594, -1.574282])) if PLOT: m.Plot() m.Connectivity() m.DICIntegration(cam) U = px.MultiscaleInit(f, g, m, cam, scales=[3, 2, 1]) print('Iter # 8 | std(res)=5.40 gl | dU/U=7.95e-04') print('Iter # 5 | std(res)=7.48 gl | dU/U=5.09e-04') print('Iter # 4 | std(res)=6.53 gl | dU/U=2.39e-04') U, res = px.Correlate(f, g, m, cam, U0=U) print('Iter # 2 | std(res)=2.29 gl | dU/U=6.17e-04') postpro_test(f, g, m, cam, U, res)