... | ... | @@ -4,35 +4,34 @@ |
|
|
| **command**| **description**|
|
|
|
|:-----------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------|
|
|
|
| `int main(int argc, char *argv[]){ ` | main function. |
|
|
|
| `DamageTestParam test_param; ` | an object to dispatch parameters. |
|
|
|
| `DamageTestContext<DamageTestMesh> driver(argc,argv,test_param); ` | an object to drive the TLS problem. `DamageTestMesh` is for classical mesh problem (gmsh). For octree mesh, use `DamageTestOctree` |
|
|
|
| `xParseData & damageinfo = test_param.getDamParam(); ` | parse the file *damageinfo.dat * . |
|
|
|
| ` double distance_L = 0.6; ` | some geometrical parameters (dimension of the model) that can not be evaluated easily automatically. |
|
|
|
| `double ouverture_damage= driver.getDamageOpening(); ` | an initial opening must be evaluated, even if the part is virgin. |
|
|
|
| `double lc = damageinfo.getDouble("lc"); ` | return a parameter read by the parser. |
|
|
|
| (...) | ... |
|
|
|
| `xAcceptRangeXY filterF(xmid-distance_c/2.,xmid+distance_c/2.,distance_h+distance_c-epsilon,distance_h+distance_c+epsilon); ` | create a filter to evaluate a mean displacement on a physical zone ( will be a parameter of `curveWriter` below). |
|
|
|
| `test_param.setRefLoadFactor(distance_c * specimen_thickness); ` | resize the reference load factor, here for 2D problem : pressure has to be converted to force. |
|
|
|
| `curveWriter effdep(filterF); ` | declaration of an output curve: the definition of `curveWriter` is given in the *main.h*. |
|
|
|
| `// test_param.setCurveWriter(effdep); ` | set the CurveWriter objet to the driver of the TLS problem. |
|
|
|
| `xPointToDouble initial_crack=xOppositeP2Double(xSphere(mPoint(xmid , 0.,0.), ouverture_damage)); ` | declare an initial level set: it must be a pre-damaged zone or a fictivious zone, but the declaration is mandatory. |
|
|
|
| `test_param.setLsInDef(initial_crack); ` | set the initial level set to the driver of the TLS problem. |
|
|
|
| `mPoint point1(xmid-distance_a/2.,0.,0.); ` | create two points arround the crack lips to evaluate the opening (if the initiation zone is known a fortiori) |
|
|
|
| `mPoint point2(xmid+distance_a/2.,0.,0.); ` | - |
|
|
|
| `std::map < int, Trellis_Util::mPoint > points; ` | declaration of a `map` of point. This map will be a parameter of ` xeExportSensors sensors` below. |
|
|
|
| `points[0] = point1; ` | - |
|
|
|
| `points[1] = point2; ` | - |
|
|
|
| `xeExportSensors sensors(0, points); ` | declaration of a sensor in the first direction (x) = direction 0 |
|
|
|
| `double young_modulus = 0.; ` | material parameters must be set in the main file. The main.dat is not used at now. |
|
|
|
| `double poisson = 0.; ` | - |
|
|
|
| `readYoungPoisson("data/matrix.mat", young_modulus, poisson); ` | after declaration, the parameters are read in a file. For multiple material problem, this had to be done as such as their are materials. |
|
|
|
| `xEvalConstant < double > eval_Yc(damageinfo.getDouble("Yc")); ` | declare a evaluator for the energy release rate of the material, initialized with the parameter given in the *damageinfo.dat* |
|
|
|
| `xEvalYoungModulus eval_young(young_modulus); ` | the same for the Young modulus . The definition of the `xEvalYoungModulus ` is given in the `main.h`. |
|
|
|
| `xEvalConstant < double > eval_poisson(poisson); ` | the same for the Poisson ratio |
|
|
|
| `test_param.setCaractEval(eval_young,eval_poisson,eval_Yc); ` | set the evaluators to the driver of the TLS problem. |
|
|
|
| `driver.init_test(); ` | initialize the TLS problem. |
|
|
|
| `river.run_test(); ` | run the TLS problem. |
|
|
|
| `river.end_test(); ` | end the TLS problem. |
|
|
|
| `DamageTestParam test_param;` | an object to dispatch parameters. |
|
|
|
| `DamageTestContext<DamageTestMesh> driver(argc,argv,test_param);` | an object to drive the TLS problem. `DamageTestMesh` is for classical mesh problem (gmsh). For octree mesh, use `DamageTestOctree` |
|
|
|
| `xParseData & damageinfo = test_param.getDamParam();` | parse the file *damageinfo.dat * . |
|
|
|
| ` double distance_L = ...; ` | some geometrical parameters (dimension of the model) that can not be evaluated easily automatically. |
|
|
|
| `double ouverture_damage= driver.getDamageOpening();` | if the initial opening is needed, it can be evaluate with the function `getDamageOpening()` |
|
|
|
| `double lc = damageinfo.getDouble("lc");` | return a parameter read by the parser. |
|
|
|
| `xAcceptRangeXY filterF(xmid-distance_c/2.,xmid+distance_c/2.,distance_h+distance_c-epsilon,distance_h+distance_c+epsilon);` | create a filter to evaluate a mean displacement on a physical zone ( will be a parameter of `curveWriter` below). |
|
|
|
| `test_param.setRefLoadFactor(distance_c * specimen_thickness);` | resize the reference load factor, here for 2D problem : pressure has to be converted to force. |
|
|
|
| `curveWriter effdep(filterF);` | declaration of an output curve: the definition of `curveWriter` is given in the *main.h*. |
|
|
|
| `// test_param.setCurveWriter(effdep);` | set the CurveWriter objet to the driver of the TLS problem. |
|
|
|
| `xPointToDouble initial_crack=xOppositeP2Double(xSphere(mPoint(xmid , 0.,0.), ouverture_damage));` | declare an initial level set: it must be a pre-damaged zone or a fictivious zone, but the declaration is mandatory. |
|
|
|
| `test_param.setLsInDef(initial_crack);` | set the initial level set to the driver of the TLS problem. |
|
|
|
| `mPoint point1(xmid-distance_a/2.,0.,0.);` | create two points arround the crack lips to evaluate the opening (if the initiation zone is known a fortiori) |
|
|
|
| `mPoint point2(xmid+distance_a/2.,0.,0.);` | - |
|
|
|
| `std::map < int, Trellis_Util::mPoint > points;` | declaration of a `map` of point. This map will be a parameter of ` xeExportSensors sensors` below. |
|
|
|
| `points[0] = point1;` | - |
|
|
|
| `points[1] = point2;` | - |
|
|
|
| `xeExportSensors sensors(0, points);` | declaration of a sensor in the first direction (x) = direction 0 |
|
|
|
| `double young_modulus = 0.;` | material parameters must be set in the main file. The main.dat is not used at now. |
|
|
|
| `double poisson = 0.;` | - |
|
|
|
| `readYoungPoisson("data/matrix.mat", young_modulus, poisson);` | after declaration, the parameters are read in a file. For multiple material problem, this had to be done as such as their are materials. |
|
|
|
| `xEvalConstant < double > eval_Yc(damageinfo.getDouble("Yc"));` | declare a evaluator for the energy release rate of the material, initialized with the parameter given in the *damageinfo.dat* |
|
|
|
| `xEvalYoungModulus eval_young(young_modulus);` | the same for the Young modulus . The definition of the `xEvalYoungModulus ` is given in the `main.h`. |
|
|
|
| `xEvalConstant < double > eval_poisson(poisson);` | the same for the Poisson ratio |
|
|
|
| `test_param.setCaractEval(eval_young,eval_poisson,eval_Yc);` | set the evaluators to the driver of the TLS problem. |
|
|
|
| `driver.init_test();` | initialize the TLS problem. |
|
|
|
| `river.run_test();` | run the TLS problem. |
|
|
|
| `river.end_test();` | end the TLS problem. |
|
|
|
| `} ` | - |
|
|
|
|
|
|
|