Skip to content
Snippets Groups Projects
Commit 7c870f03 authored by Sander, Oliver's avatar Sander, Oliver
Browse files

Introduce a separate 'dimworld' variable

You never know, we may be doing dim!=dimworld grids eventually.
parent 4ac6d164
No related branches found
No related tags found
No related merge requests found
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
// grid dimension // grid dimension
const int dim = 1; const int dim = 1;
const int dimworld = dim;
// Image space of the geodesic fe functions // Image space of the geodesic fe functions
// typedef Rotation<double,2> TargetSpace; // typedef Rotation<double,2> TargetSpace;
...@@ -115,13 +116,13 @@ int main (int argc, char *argv[]) try ...@@ -115,13 +116,13 @@ int main (int argc, char *argv[]) try
typedef std::conditional<dim==1,OneDGrid,UGGrid<dim> >::type GridType; typedef std::conditional<dim==1,OneDGrid,UGGrid<dim> >::type GridType;
std::shared_ptr<GridType> grid; std::shared_ptr<GridType> grid;
FieldVector<double,dim> lower(0), upper(1); FieldVector<double,dimworld> lower(0), upper(1);
std::array<unsigned int,dim> elements; std::array<unsigned int,dim> elements;
if (parameterSet.get<bool>("structuredGrid")) if (parameterSet.get<bool>("structuredGrid"))
{ {
lower = parameterSet.get<FieldVector<double,dim> >("lower"); lower = parameterSet.get<FieldVector<double,dimworld> >("lower");
upper = parameterSet.get<FieldVector<double,dim> >("upper"); upper = parameterSet.get<FieldVector<double,dimworld> >("upper");
elements = parameterSet.get<array<unsigned int,dim> >("elements"); elements = parameterSet.get<array<unsigned int,dim> >("elements");
grid = StructuredGridFactory<GridType>::createCubeGrid(lower, upper, elements); grid = StructuredGridFactory<GridType>::createCubeGrid(lower, upper, elements);
...@@ -162,7 +163,7 @@ int main (int argc, char *argv[]) try ...@@ -162,7 +163,7 @@ int main (int argc, char *argv[]) try
//////////////////////////// ////////////////////////////
// Read initial iterate into a PythonFunction // Read initial iterate into a PythonFunction
typedef PythonFunction<FieldVector<double, dim>, TargetSpace::CoordinateType> FBase; typedef PythonFunction<FieldVector<double, dimworld>, TargetSpace::CoordinateType> FBase;
Python::Module module = Python::import(parameterSet.get<std::string>("initialIterate")); Python::Module module = Python::import(parameterSet.get<std::string>("initialIterate"));
auto pythonInitialIterate = module.get("f").toC<std::shared_ptr<FBase>>(); auto pythonInitialIterate = module.get("f").toC<std::shared_ptr<FBase>>();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment