Commits

Matthew Turk committed 28c1f91

Forgot to add the kernel .C file

  • Participants
  • Parent commits b7b6c8d

Comments (0)

Files changed (1)

src/enzo/InitializationKernel.C

+/***********************************************************************
+/
+/  KERNELS FOR INITIALIZATION OF DATA
+/
+/  written by: Matthew Turk, Devin Silvia
+/  date:       January 2012
+/
+/  PURPOSE:
+/
+************************************************************************/
+
+#ifdef NEW_PROBLEM_TYPES
+#include <string.h>
+#include <vector>
+#include <stdio.h>
+#include <math.h>
+#include <iostream>
+#include "ErrorExceptions.h"
+#include "macros_and_parameters.h"
+#include "typedefs.h"
+#include "global_data.h"
+#include "Fluxes.h"
+#include "GridList.h"
+#include "ExternalBoundary.h"
+#include "Grid.h"
+#include "Hierarchy.h"
+#include "TopGridData.h"
+#include "ProblemType.h"
+#include "EventHooks.h"
+
+InitializationKernelConstant::InitializationKernelConstant(
+    FieldContainer *constants, int additive = FALSE)
+{
+    this->constants = constants;
+    this->additive = additive;
+}
+
+void InitializationKernelConstant::apply(FieldContainer &fields,
+                FLOAT x, FLOAT y, FLOAT z,
+                FLOAT dx, FLOAT dy, FLOAT dz)
+{
+    std::map<std::string, float>::iterator it;
+    for(it = this->constants->defaults_start();
+        it != this->constants->defaults_end();
+        it++)
+    {
+      if (this->additive == TRUE) {
+        fields[(*it).first] += (*it).second;
+      } else {
+        fields[(*it).first] = (*it).second;
+      }
+    }
+    return;
+}
+
+#endif