예제 #1
0
    in Engineering, 119(6), p.453-468, 2019.

    """

import numpy as np
import scipy.sparse.linalg as splalg
import pyxel as px

f = px.Image('zoom-0053_1.tif').Load()
g = px.Image('zoom-0070_1.tif').Load()

m = px.ReadMeshINP('abaqus_q4_m.inp')

p = np.array(
    [1.05449047e+04, 5.12335842e-02, -9.63541211e-02, -4.17489457e-03])
cam = px.Camera(p)

m.Connectivity()
m.DICIntegration(cam, G=True)

U0 = px.MultiscaleInit(f, g, m, cam, scales=[3, 2, 1], l0=0.002)

#%% ICGN

dic = px.DICEngine()
U = U0.copy()
H = dic.ComputeLHS(f, m, cam)
H_LU = splalg.splu(H)
repx = np.arange(m.ndof // 2)
repy = np.arange(m.ndof // 2, m.ndof)
phi = m.phix[:, repx]
예제 #2
0
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')

#%% ============================================================================
예제 #3
0
imnums = np.array([53, 54, 57, 58, 61, 62, 65, 66, 69, 70, 75])
testcase = 'dic_composite'
imagefile = os.path.join('data', testcase, 'zoom-0%03d_1.tif')
imref = imagefile % imnums[0]
f = px.Image(imref).Load()
f.Show()

#%% ============================================================================
# Mesh and Camera model  =======================================================
# ==============================================================================
''' Example2: Quadrilateral ABAQUS Mesh in meter '''
meshfile = os.path.join('data', testcase, 'abaqus_q4_m.inp')
m = px.ReadMeshINP(meshfile)
#cam=px.MeshCalibration(f,m,[1,2])
cam = px.Camera(
    np.array(
        [1.05168768e+04, 5.13737634e-02, -9.65935782e-02, -2.65443047e-03]))

# Plot Mesh on the reference image
px.PlotMeshImage(f, m, cam)
# Visualization of the mesh alone
m.Plot()

#%% ============================================================================
# Pre-processing  ==============================================================
# ==============================================================================

# Build the connectivity table
m.Connectivity()
# Build the quadrature rule; compute FE basis functions and derivatives
m.DICIntegration(cam)
예제 #4
0
        m.PlotResidualMap(res, cam, 1e5)

    m.VTKMesh('unitary_test_0')
    m.VTKSol('unitary_test_1', U)


#%% Standard test Q4
imagefile = 'zoom-0%03d_1.tif'
imref = imagefile % 53
f = px.Image(imref).Load()
imdef = imagefile % 70
g = px.Image(imdef).Load()
m = px.ReadMeshINP('abaqus_q4_m.inp')
p = np.array(
    [1.05449047e+04, 5.12335842e-02, -9.63541211e-02, -4.17489457e-03])
cam = px.Camera(p)

m.Connectivity()
conn = np.c_[np.arange(1500), np.arange(1500) + 1500]
res, _ = np.where(m.conn != conn)
if m.ndof != 3000 or len(res) != 0:
    print('************** PB in Connectivity')

m.GaussIntegration()
if m.npg != 5616 \
or int(np.sum(m.wdetJ) * 1e12) != 2623910771 \
or int(np.std(m.wdetJ) * 1e15) != 520884059:
    print('************** PB in GaussIntegration')

K = m.Stiffness(px.Hooke([11, 0.33]))
if int(np.sum(K.diagonal()) * 1e10) != 664248104871388 \
예제 #5
0
m = px.ReadMeshGMSH('gmsh_t3_mm.msh')
m.Plot()

#%% CAMERA MODEL

do_calibration = False

if do_calibration:
    ls = px.LSCalibrator(f, m)
    ls.NewCircle()
    ls.NewLine()
    ls.NewLine()
    ls.FineTuning()
    cam = ls.Calibration()
else:
    # reuse previous calibration parameters
    cam = px.Camera(np.array([-10.509228, -51.082099, 6.440112, -1.573678]))

px.PlotMeshImage(f, m, cam)

#%%

m.Connectivity()
m.DICIntegration(cam)
m.DICIntegrationFast(cam)

U = px.MultiscaleInit(f, g, m, cam, scales=[3, 2, 1])
U, res = px.Correlate(f, g, m, cam, U0=U)

m.PlotContourDispl(U, s=30)