Skip to content
Snippets Groups Projects
Commit 41b4d44a authored by Oliver Sander's avatar Oliver Sander Committed by sander@PCPOOL.MI.FU-BERLIN.DE
Browse files

use the ConfigParser

[[Imported from SVN: r9850]]
parent c19ab699
No related branches found
No related tags found
No related merge requests found
#include <config.h>
#include <dune/common/bitfield.hh>
#include <dune/common/configparser.hh>
#include <dune/grid/uggrid.hh>
#include <dune/grid/io/file/amirameshwriter.hh>
......@@ -28,64 +29,35 @@
// The grid dimension
const int dim = 3;
// Number of grid levels
const int numLevels = 1;
// Number of steps for the boundary data homotopy
const int numHomotopySteps = 1;
// Number of Newton steps
const int numNewtonSteps = 1;
// Number of multigrid iterations per time step
const int numIt = 1000;
// Number of presmoothing steps
const int nu1 = 3;
// Number of postsmoothing steps
const int nu2 = 3;
// Number of coarse grid corrections
const int mu = 1;
// Number of base solver iterations
const int baseIt = 100;
// Tolerance of the solver
const double tolerance = 1e-5;
// Tolerance of the base grid solver
const double baseTolerance = -1;
using namespace Dune;
// ////////////////////////////////////
// Problem specifications
// ////////////////////////////////////
// std::string gridFile = "data_1b/unithexacube.am";
// std::string dnFile = "data_1b/unithexacube.x.dn";
// std::string dvFile = "data_1b/unithexacube.x.vectors";
// double obs(const FieldVector<double, dim>& x) {return -(x[0]-1.005);}
// double obsDistance = 0.01;
std::string gridFile = "/home/haile/sander/data/elasticity/cubus27/Cubus27.grid";
std::string dnFile = "/home/haile/sander/data/elasticity/cubus27/cubus27.dn";
std::string dvFile = "/home/haile/sander/data/elasticity/cubus27/cubus27.dv";
// std::string gridFile = "data_1b/sphere.coarse.grid";
// std::string dnFile = "data_1b/sphere.coarse.dn";
// std::string dvFile = "data_1b/sphere.coarse.vectors";
// double obs(const FieldVector<double, dim>& x) {return -(x[0]-1);}
// double obsDistance = 0.2;
int main (int argc, char *argv[]) try
{
// Some types that I need
typedef BCRSMatrix<FieldMatrix<double, dim, dim> > OperatorType;
typedef BlockVector<FieldVector<double, dim> > VectorType;
// parse data file
ConfigParser parameterSet;
parameterSet.parseFile("nonlinelast.parset");
// read solver settings
const int numLevels = parameterSet.get<int>("numLevels");
const int numHomotopySteps = parameterSet.get<int>("numHomotopySteps");
const int numNewtonSteps = parameterSet.get<int>("numNewtonSteps");
const int numIt = parameterSet.get("numIt", int(0));
const int nu1 = parameterSet.get("nu1", int(0));
const int nu2 = parameterSet.get("nu2", int(0));
const int mu = parameterSet.get("mu", int(0));
const int baseIt = parameterSet.get("baseIt", int(0));
const double tolerance = parameterSet.get("tolerance", double(0));
const double baseTolerance = parameterSet.get("baseTolerance", double(0));
// read problem settings
std::string gridFile = parameterSet.get<std::string>("gridFile");
std::string dnFile = parameterSet.get<std::string>("dnFile");
std::string dvFile = parameterSet.get<std::string>("dvFile");
// /////////////////////////////
// Generate the grid
// /////////////////////////////
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment