Skip to content
Snippets Groups Projects
Commit a0934547 authored by Oliver Sander's avatar Oliver Sander Committed by sander
Browse files

Allow to set resolution/bbox of structured grids from the parameter file

[[Imported from SVN: r10001]]
parent 71eb11cb
No related branches found
No related tags found
No related merge requests found
......@@ -106,23 +106,27 @@ int main (int argc, char *argv[]) try
const bool instrumented = parameterSet.get<bool>("instrumented");
std::string resultPath = parameterSet.get("resultPath", "");
// read problem settings
std::string path = parameterSet.get<std::string>("path");
std::string gridFile = parameterSet.get<std::string>("gridFile");
// ///////////////////////////////////////
// Create the grid
// ///////////////////////////////////////
typedef std::conditional<dim==1,OneDGrid,UGGrid<dim> >::type GridType;
shared_ptr<GridType> gridPtr;
if (parameterSet.get<std::string>("gridType")=="structured") {
array<unsigned int,dim> elements;
elements.fill(3);
gridPtr = StructuredGridFactory<GridType>::createSimplexGrid(FieldVector<double,dim>(0),
FieldVector<double,dim>(1),
elements);
FieldVector<double,dim> lower(0), upper(1);
if (parameterSet.get<bool>("structuredGrid")) {
lower = parameterSet.get<FieldVector<double,dim> >("lower");
upper = parameterSet.get<FieldVector<double,dim> >("upper");
array<unsigned int,dim> elements = parameterSet.get<array<unsigned int,dim> >("elements");
gridPtr = StructuredGridFactory<GridType>::createCubeGrid(lower, upper, elements);
} else {
std::string path = parameterSet.get<std::string>("path");
std::string gridFile = parameterSet.get<std::string>("gridFile");
gridPtr = shared_ptr<GridType>(AmiraMeshReader<GridType>::read(path + gridFile));
}
......
......@@ -39,11 +39,16 @@ instrumented = 0
############################
# 2d problem
#gridType = unstructured
#structuredGrid = false
#path = /home/sander/data/richards/twosquares/
#gridFile = twosquares0.grid
# 3d problem
gridType = unstructured
path = /home/sander/data/contact/tetracubes/
gridFile = tetracube0.grid
#structuredGrid = false
#path = /home/sander/data/contact/tetracubes/
#gridFile = tetracube0.grid
structuredGrid = true
lower = -10 -10
upper = 10 10
elements = 100 100
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