Commits

Anonymous committed 3468943

added the cylinder kernel to ProblemType_RotatingCylinder.C. This involved adding some new parameters that should make the cylinder problem more versatile.

Comments (0)

Files changed (1)

src/enzo/ProblemType_RotatingCylinder.C

         float RotatingCylinderVelocity[3];   // gas initally at rest
         float RotatingCylinderBField[3];   // gas initally at rest
         FLOAT RotatingCylinderRadius;
+        FLOAT RotatingCylinderLength;
+        int RotatingCylinderAxis;
         float RotatingCylinderLambda;
         float RotatingCylinderOverdensity;
         float RotatingCylinderDensity;
         this->RotatingCylinderBField[1] =
         this->RotatingCylinderBField[2] = 0.0; // gas initally at rest
       this->RotatingCylinderRadius = 0.3;
+      this->RotatingCylinderLength = 0.6; // make it a "square" cylinder
+      this->RotatingCylinderAxis = 2; // orient it along the z-axis
       this->RotatingCylinderLambda = 0.05;
       this->RotatingCylinderOverdensity = 20.0;
       this->RotatingCylinderDensity = 1.0;
             new InitializationKernelConstant(&background_fields);
 
         this->AddKernel(static_cast<InitializationKernel*>(background));
+
+        CylindricalRegion *cylinder = 
+            new CylindricalRegion(RotatingCylinderRadius, RotatingCylinderLength,
+            RotatingCylinderCenterPosition, RotatingCylinderAxis);
+
+        this->AddKernel(static_cast<InitializationKernel*>(cylinder));
     }
 
     void ReadConfig(FILE *fptr)
                 this->RotatingCylinderTotalEnergy);
             ret += sscanf(line, "RotatingCylinderRadius = %"PSYM,
                 this->RotatingCylinderRadius);
+            ret += sscanf(line, "RotatingCylinderLength = %"PSYM,
+                this->RotatingCylinderLength);
             ret += sscanf(line, "RotatingCylinderCenterPosition = %"PSYM" %"PSYM" %"PSYM,
                 this->RotatingCylinderCenterPosition, (this->RotatingCylinderCenterPosition)+1,
                 (this->RotatingCylinderCenterPosition)+2);
+            ret += sscanf(line, "RotatingCylinderAxis = %"ISYM,
+                this->RotatingCylinderAxis);
 
             ret += sscanf(line, "TestProblemUseMetallicityField  = %"ISYM, TestProblemData.UseMetallicityField);
             ret += sscanf(line, "TestProblemInitialMetallicityFraction  = %"FSYM, TestProblemData.MetallicityField_Fraction);
         fprintf(Outfptr, "RotatingCylinderLambda         = %"FSYM"\n"  , this->RotatingCylinderLambda);
         fprintf(Outfptr, "RotatingCylinderTotalEnergy         = %"FSYM"\n"  , this->RotatingCylinderTotalEnergy);
         fprintf(Outfptr, "RotatingCylinderRadius         = %"PSYM"\n"  , this->RotatingCylinderRadius);
+        fprintf(Outfptr, "RotatingCylinderLength         = %"PSYM"\n"  , this->RotatingCylinderLength);
         fprintf(Outfptr, "RotatingCylinderCenterPosition = %"PSYM" %"PSYM" %"PSYM"\n",
                 this->RotatingCylinderCenterPosition, (this->RotatingCylinderCenterPosition)+1,
                 (this->RotatingCylinderCenterPosition)+2);
+        fprintf(Outfptr, "RotatingCylinderAxis         = %"PISYM"\n"  , this->RotatingCylinderAxis);
+
         fprintf(Outfptr, "TestProblemUseMetallicityField  = %"ISYM"\n", TestProblemData.UseMetallicityField);
         fprintf(Outfptr, "TestProblemInitialMetallicityFraction  = %"FSYM"\n", TestProblemData.MetallicityField_Fraction);
     }