[cig-commits] r6595 - in short/3D/PyLith/branches/pylith-0.8/pylith3d: libpylith3d module

leif at geodynamics.org leif at geodynamics.org
Tue Apr 17 17:38:35 PDT 2007


Author: leif
Date: 2007-04-17 17:38:35 -0700 (Tue, 17 Apr 2007)
New Revision: 6595

Modified:
   short/3D/PyLith/branches/pylith-0.8/pylith3d/libpylith3d/libpylith3d.pxd
   short/3D/PyLith/branches/pylith-0.8/pylith3d/libpylith3d/viscos_step.F
   short/3D/PyLith/branches/pylith-0.8/pylith3d/module/PyLithLib.pyx
Log:
Fixed VTK output.


Modified: short/3D/PyLith/branches/pylith-0.8/pylith3d/libpylith3d/libpylith3d.pxd
===================================================================
--- short/3D/PyLith/branches/pylith-0.8/pylith3d/libpylith3d/libpylith3d.pxd	2007-04-17 23:13:09 UTC (rev 6594)
+++ short/3D/PyLith/branches/pylith-0.8/pylith3d/libpylith3d/libpylith3d.pxd	2007-04-18 00:38:35 UTC (rev 6595)
@@ -973,6 +973,7 @@
     char *,            # files
     int *,             # 90: PETSC logging
     int *,
+    int *,             # New args
     int *,
     int *,
     int *,

Modified: short/3D/PyLith/branches/pylith-0.8/pylith3d/libpylith3d/viscos_step.F
===================================================================
--- short/3D/PyLith/branches/pylith-0.8/pylith3d/libpylith3d/viscos_step.F	2007-04-17 23:13:09 UTC (rev 6594)
+++ short/3D/PyLith/branches/pylith-0.8/pylith3d/libpylith3d/viscos_step.F	2007-04-18 00:38:35 UTC (rev 6595)
@@ -48,8 +48,8 @@
      & iprint,ncodat,nunits,nprint,istatout,nstatout,                   ! ioinfo
      & ucdroot,                                                         ! files
      & viscousStage, iterateEvent,                                      ! PETSc logging
-     & ntot,pyltim,indexx,jcyc,i,j,pyskc,nfirst,pynstep,time,           ! New args
-     & pydeltp,lgdefp,gtol,                                             !   more new args
+     & ntot,pyltim,indexx,jcyc,i,j,pyskc,nfirst,pynstep,fulout,         ! New args
+     & time,pydeltp,lgdefp,gtol,                                        !   more new args
      & ierr,errstrng)                                                   ! errcode
 c
 c...subroutine to solve the time dependent problem and perform the
@@ -94,6 +94,7 @@
       integer iprint(*)
       integer istatout(*),nstatout(*)
       integer ntot, pyltim, indexx, jcyc, i, j, pyskc, nfirst, pynstep
+      integer fulout
       double precision bextern(*),btraction(*),bgravity(*),bconcforce(*)
       double precision bintern(*),bresid(*),bwink(*),bwinkx(*)
       double precision dispvec(*),dprev(*),grav(*)
@@ -141,7 +142,7 @@
       integer iprestress
       integer nen,ngauss,nee,nec
       double precision tminmax
-      logical reform,skc,ltim,fulout,unlck,unlckf
+      logical reform,skc,ltim,unlck,unlckf
 c
 c...  included variable definitions
 c
@@ -156,6 +157,7 @@
       include "rtimdat_def.inc"
       include "rgiter_def.inc"
 c
+c
 c     Outside loops
 c
       nen=infetype(1)
@@ -214,16 +216,16 @@
       ntimdat(9)=ireform
 cdebug            write(6,*) "ntdinitp,reform,ireform,ltim:",
 cdebug     &       ntdinitp,reform,ireform,ltim
-      fulout=.false.
-      if(ntot.eq.iprint(indexx)) fulout=.true.
+      fulout=izero
+      if(ntot.eq.iprint(indexx)) fulout=ione
 c
       if(idout.gt.ione) write(kw,1000) time,ntot,jcyc
 C***********************************
-      if(fulout.and.idsk.eq.ione) write(kp,700) ntot
+      if(fulout.eq.ione.and.idsk.eq.ione) write(kp,700) ntot
 C***********************************
-      if(fulout.and.idsk.eq.ione) write(kp,4000) time
-      if(fulout.and.idsk.eq.itwo) write(kp) ntot
-      if(fulout.and.idsk.eq.itwo) write(kp) time
+      if(fulout.eq.ione.and.idsk.eq.ione) write(kp,4000) time
+      if(fulout.eq.ione.and.idsk.eq.itwo) write(kp) ntot
+      if(fulout.eq.ione.and.idsk.eq.itwo) write(kp) time
       write(kto,5000) time,ntot,lastep*ncycle
       call flush(kto)
 c*            call flush(kw)
@@ -577,7 +579,7 @@
 c
 c...  print displacements at all nodes when requested.
 c
-      if(fulout) then
+      if(fulout.eq.ione) then
          call printd(d,deld,deltp,idslp,numnp,numnp,ione,
      &        idout,idsk,kto,kw,kp)
          call write_ucd_node_vals(d,deld,tfault,dfault,nfault,
@@ -593,7 +595,7 @@
 c
 c...  print stresses and strains in all elements when requested
 c
-      if(fulout) then
+      if(fulout.eq.ione) then
          call write_state_drv(
      &        state,dstate,ivfamily,nvfamilies,numelv,nstatesz, ! elemnt
      &        infmatmod,        ! materl
@@ -603,7 +605,7 @@
      &        idout,idsk,iucd,kw,kp,kucd,ucdroot,iprestress, ! ioinfo
      &        ierr,errstrng)    ! errcode
       end if
-      if(fulout) indexx=indexx+1
+      if(fulout.eq.ione) indexx=indexx+1
 c
  650  format(//,"Reforming the stiffness matrix:",/)
  700  format('STEP ',i7)

Modified: short/3D/PyLith/branches/pylith-0.8/pylith3d/module/PyLithLib.pyx
===================================================================
--- short/3D/PyLith/branches/pylith-0.8/pylith3d/module/PyLithLib.pyx	2007-04-17 23:13:09 UTC (rev 6594)
+++ short/3D/PyLith/branches/pylith-0.8/pylith3d/module/PyLithLib.pyx	2007-04-18 00:38:35 UTC (rev 6595)
@@ -2443,7 +2443,7 @@
         # Perform time-dependent solution, if requested.
 
         cdef int numCycles, numTimeStepGroups, numslp
-        cdef int iskopt, icontr, indexx, totalSteps
+        cdef int iskopt, icontr, indexx, ntot
         
         cdef int nextStartStep, timeStep, startStep
         cdef double time
@@ -2451,7 +2451,7 @@
         cdef int maxitp, ntdinitp, lgdefp, itmaxp
         cdef double dt, alfap, gtol[3]
 
-        cdef int ltim, cycle, tsGroup, j, skc
+        cdef int ltim, cycle, tsGroup, j, skc, fulout
         
         if self.icode == 3 and self.nintg > 1:
             if self.pythonTimestep:
@@ -2463,7 +2463,7 @@
                 iskopt            = self.nsysdat[10]
                 icontr            = self.nprint[0]
                 indexx            = 1 # Fortran index
-                totalSteps        = 0 # This is ntot
+                ntot              = 0
                 
                 for cycle from 0 <= cycle < numCycles:
                     
@@ -2497,11 +2497,12 @@
                         ltim = 1
 
                         for j from startStep <= j < nextStartStep+1:
-                            totalSteps = totalSteps + 1
+                            ntot = ntot + 1
                             timeStep   = timeStep  + 1
                             self.ntimdat[0] = timeStep
                             time = time + dt
                             skc   = (numslp != 0 and (iskopt == 2 or (iskopt <= 0 and abs(iskopt) == timeStep)))
+                            fulout = 0
 
                             libpylith3d.viscos_step(
                                 &self._mesh.A,         # sparse
@@ -2593,7 +2594,7 @@
                                 self.ucdroot,          # files
                                 &self.viscousStage,    # PETSc logging
                                 &self.iterateEvent,
-                                &totalSteps,
+                                &ntot,
                                 &ltim,
                                 &indexx,
                                 &cycle,
@@ -2602,6 +2603,7 @@
                                 &skc,
                                 &startStep,
                                 &timeStep,
+                                &fulout,
                                 &time,
                                 &dt,
                                 &lgdefp,
@@ -2613,11 +2615,12 @@
                             exceptionhandler(errorcode, errorstring)
                             
                             ltim = 0
-                            if (totalSteps == self.iprint.ptr[indexx-1]):
-                                self._mesh.outputMesh(self.fileRoot+'.'+str(totalSteps))
-                                indexx = indexx +  1
-                            if (indexx > icontr): indexx = icontr
+                            if fulout:
+                                self._mesh.outputMesh(self.fileRoot+'.'+str(ntot))
+                            if indexx > icontr:
+                                indexx = icontr
 
+
                 print " Total number of equilibrium iterations        =",self.ntimdat[5]
                 print " Total number of stiffness matrix reformations =",self.ntimdat[6]
                 print " Total number of displacement subiterations    =",self.ntimdat[7]



More information about the cig-commits mailing list