[cig-commits] commit: Add manually specified dt

Mercurial hg at geodynamics.org
Sun Jan 10 20:25:54 PST 2010


changeset:   662:c6a18b0988de
tag:         tip
user:        Walter Landry <wlandry at caltech.edu>
date:        Sun Jan 10 20:24:44 2010 -0800
files:       SLE/ProvidedSystems/StokesFlow/src/UpdateDt.c
description:
Add manually specified dt


diff -r c517a82bb05f -r c6a18b0988de SLE/ProvidedSystems/StokesFlow/src/UpdateDt.c
--- a/SLE/ProvidedSystems/StokesFlow/src/UpdateDt.c	Sun Dec 20 14:24:23 2009 -0800
+++ b/SLE/ProvidedSystems/StokesFlow/src/UpdateDt.c	Sun Jan 10 20:24:44 2010 -0800
@@ -57,17 +57,27 @@ double Stokes_SLE_UpdateDt( Stokes_SLE* 
 	FeVariable*             velFeVar      = NULL;
 	double			localDt;
 	double			globalDt;
+        Dictionary*             dictionary = context->dictionary;
+        double factor;
 	
-	velFeVar = self->uSolnVec->feVariable;
-	velMax = FieldVariable_GetMaxGlobalFieldMagnitude( velFeVar );
+        globalDt=Dictionary_GetDouble_WithDefault(dictionary,"dt",0.0);
+        
+        if(globalDt==0.0)
+          {
+            velFeVar = self->uSolnVec->feVariable;
+            velMax = FieldVariable_GetMaxGlobalFieldMagnitude( velFeVar );
+            
+            Journal_DPrintf( self->debug, "In func %s for SLE '%s' - Maximum global magnitude for field '%s' = %g.\n",
+                             __func__, self->name, velFeVar->name, velMax );
+            
+            FeVariable_GetMinimumSeparation( velFeVar, &minSeparation, minSeparationEachDim );
+            
+            factor=Dictionary_GetDouble_WithDefault(dictionary,"dtFactor",1.0);
+            localDt = factor*0.5 * minSeparation / velMax;
 
-	Journal_DPrintf( self->debug, "In func %s for SLE '%s' - Maximum global magnitude for field '%s' = %g.\n",
-		__func__, self->name, velFeVar->name, velMax );
+            printf("dt %g %g %g %g\n",localDt,factor,minSeparation,velMax);
 
-	FeVariable_GetMinimumSeparation( velFeVar, &minSeparation, minSeparationEachDim );
-
-	localDt = 0.5 * minSeparation / velMax;
-	MPI_Allreduce( &localDt, &globalDt, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD );
-
+            MPI_Allreduce( &localDt, &globalDt, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD );
+          }
 	return globalDt;
 }



More information about the CIG-COMMITS mailing list