Example #1
0
# ==============================================================================

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')

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

# Build the connectivity table
Example #2
0
    Implement the inverse compositional Gauss Newton

    [REF] JC. Passieux and R. Bouclier. Classic and Inverse Compositional 
    Gauss-Newton in Global DIC. International Journal for Numerical Methods
    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)
Example #3
0
# Datafiles, images  ===========================================================
# ==============================================================================

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