From: Joerg Frohne Date: Wed, 13 Feb 2013 18:16:39 +0000 (+0000) Subject: comments for the class Input X-Git-Tag: v8.0.0~1299 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4727ca935d2bb747d270483b83bd2e9bd1dd0b9;p=dealii.git comments for the class Input git-svn-id: https://svn.dealii.org/trunk@28389 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/examples/step-42/step-42.cc b/deal.II/examples/step-42/step-42.cc index eb3057a17d..bd1f20eb76 100644 --- a/deal.II/examples/step-42/step-42.cc +++ b/deal.II/examples/step-42/step-42.cc @@ -68,8 +68,16 @@ namespace Step42 { using namespace dealii; + // @sect3{The PlasticityContactProblem class template} + // This class has only the purpose + // to read in data from a picture file + // that has to be stored as a pbm ascii + // format. This data will be bilinear + // interpolated and provides in this way + // a function which describes an obstacle. + template class Input; // This class provides an interface @@ -159,6 +167,27 @@ namespace Step42 double nu; // Poisson ratio }; + // As explained above this class + // allocates the obstacle which + // will come into contact with our + // deformable body. + // The data which we read in by the + // function read_obstacle () from the file + // "obstacle_file.pbm" will be stored + // in a double std::vector named + // obstacle_data. + // This vector composes the base + // to calculate a piecewise bilinear + // function as a polynomial interpolation. + // This will be done by obstacle_function (). + // In the function run () of the class + // PlasticityContactProblem we create + // an object of the class Input which will + // be used in the class Obstacle to + // supply the obstacle function in + // update_solution_and_constraints () of + // the class PlasticityContactProblem. + template class Input { @@ -175,13 +204,13 @@ namespace Step42 hy (0), nx (0), ny (0) - {read_surface (name);} + {read_obstacle (name);} - double hv(int i, int j); + double hv (int i, int j); - double mikro_height(double x,double y); + double obstacle_function (double x,double y); - void read_surface(const char* name); + void read_obstacle (const char* name); private: const char* name; @@ -194,17 +223,15 @@ namespace Step42 }; template - double Input::hv(int i, int j) + double Input::hv (int i, int j) { assert(i>=0 && i=0 && j25200) -// std::cout<< i << ", " << j << ", " << nx*(ny-1-j)+i < - double Input::mikro_height(double x,double y) + double Input::obstacle_function (double x,double y) { int ix = (int)(x/hx); int iy = (int)(y/hy); @@ -272,7 +299,7 @@ namespace Step42 } template - void Input::read_surface(const char* name) + void Input::read_obstacle (const char* name) { int SZ = 100000; FILE* fp = fopen (name, "r"); @@ -545,7 +572,7 @@ namespace Step42 return_value = p(1); if (component == 2) { - return_value = 1.999 - input_obstacle_copy->mikro_height (p(0), p(1)); + return_value = 1.999 - input_obstacle_copy->obstacle_function (p(0), p(1)); } return return_value; }