Exemple #1
0
#/usr/bin/ipython

import pylab
from Network import *
from Folder import *
import os

#------------------Liste des donnees d'entre---------------
SimNum = 1
repertoir = "/data/H.Le/simulation" + str(SimNum) + "/S/network/"
NumFile = len(os.listdir(repertoir))
NumPlot = 2

Zoom = 2
Border = 0

#----------------------------------------------------------
Fold = Folder(Folder=repertoir,
              ParameterFile="Parameters.log",
              ResFile="Positions",
              Ext=".res")
N = Network(filename=Fold.OpenDataFile(NumPlot),
            time=NumPlot * Fold.dt,
            sizex=Fold.Lx,
            sizey=Fold.Ly,
            sizez=Fold.Lz,
            distance=Fold.eps)
N.plot2D_fiber(cracking=Fold.PCrack)
N.AdjustWindows(zoom=Zoom, border=Border)
N.show()
Exemple #2
0
    for num in range(0, Nimage):
        n = NumFile - num - 2
        print(n)
        time = n * Fold.dt
        try:
            N = Network(filename=Fold.OpenDataFile(n),
                        time=time,
                        sizex=Fold.Lx,
                        sizey=Fold.Ly,
                        sizez=Fold.Lz,
                        distance=Fold.eps)
        except:
            print("fin de la boucle pour " + str(n))
            break
        N.plot2D_fiber(cracking=Fold.PCrack)
        N.AdjustWindows(zoom=1.8, border=0)
        if num == numshow:
            N.show()
        #for i in range(0,Fold.pas):
        numero = str(n)  #+i)
        if len(numero) == 1:
            numero = "000" + numero
        if len(numero) == 2:
            numero = "00" + numero
        if len(numero) == 3:
            numero = "0" + numero

        N.save("./cracking/hole" + str(S) + "/" + numero + ".png")
        N.close()
        del (N)
        time = time - Fold.dt * Fold.pas
                #C[i].OpenVector(n,i)
                C[i].PlotCell(n)
            #C[i].PlotVect(n)
            #except:
            #  break
        #-------------------------------------------------
        numero = str(n)
        if len(numero) == 1:
            numero = "000" + numero
        if len(numero) == 2:
            numero = "00" + numero
        if len(numero) == 3:
            numero = "0" + numero
        if (Fold.evolvcell == 1 and follow == 1):
            N.AdjustWindows(zoom=zoom,
                            Cell=1,
                            Xcell=C[0].Xcell,
                            Ycell=C[0].Ycell)
        #else:
        #N.AdjustWindows(zoom=zoom,Xcell=37.4, Ycell=55.42, Cell=1)
        #N.AdjustWindows(zoom=zoom,Cell=1,Xcell=0,Ycell=0)
        if save == 1 and n >= nbeg:
            N.save("../Res/simulation" + str(SimNum) + "/S" + str(S) +
                   "/Image/network_" + numero + ".png")
        if show == 1 and n >= nbeg:
            N.show()
        #-----------------------a modifier--------------------------
        #---------------------------------------------------------------
        N.close()
        del (N)
        n += 1