CArl
Code Arlequin / C++ implementation
carl_assemble_coupling_input_parser.cpp
Go to the documentation of this file.
1 /*
2  * carl_assemble_coupling_input_parser.h
3  *
4  * Created on: Feb 14, 2017
5  * Author: Thiago Milanetto Schlittler
6  */
7 
9 
10 namespace carl
11 {
12 
13 void get_assemble_coupling_input_params(GetPot& field_parser,
15 
16  // Set mesh files
17  if (field_parser.search(3, "--meshA", "-mA", "MeshA")) {
18  input_params.mesh_BIG_file = field_parser.next(
19  input_params.mesh_BIG_file);
20  } else {
21  homemade_error_msg("Missing the A mesh file!");
22  }
23 
24  if (field_parser.search(3, "--meshB", "-mB", "MeshB")) {
25  input_params.mesh_micro_file = field_parser.next(
26  input_params.mesh_micro_file);
27  } else {
28  homemade_error_msg("Missing the B mesh file!");
29  }
30 
31  if (field_parser.search(3, "--meshI", "-mI", "InterBase")) {
32  input_params.common_inter_file = field_parser.next(
33  input_params.common_inter_file);
34  } else {
35  homemade_error_msg("Missing the path to the intersection files!");
36  }
37 
38  // Set coupling parameters
39  if( field_parser.search(2, "--ce","CouplingWidth") )
40  {
41  input_params.coupling_width = field_parser.next(input_params.coupling_width);
42  } else {
43  homemade_error_msg("Missing the coupling region width!");
44  }
45 
46  if( field_parser.search(2, "--ck","CouplingRigidity") )
47  {
48  input_params.coupling_rigidity = field_parser.next(input_params.coupling_rigidity);
49  } else {
50  homemade_error_msg("Missing the coupling rigidity!");
51  }
52 
53  // Output
54  if (field_parser.search(3, "--output", "-mO", "OutputFolder"))
55  {
56  input_params.output_folder = field_parser.next(
57  input_params.output_folder);
58  } else {
59  input_params.output_folder = "";
60  }
61 
62  if (field_parser.search(3, "--meshAR", "-mAR", "Mesh_A_Restriction")) {
63  input_params.mesh_restrict_BIG_file = field_parser.next(
64  input_params.mesh_restrict_BIG_file);
65  } else {
66  input_params.mesh_restrict_BIG_file = input_params.common_inter_file + "_A_restriction.msh";
67  }
68 
69  if (field_parser.search(3, "--meshBR", "-mBR", "Mesh_B_Restriction")) {
70  input_params.mesh_restrict_micro_file = field_parser.next(
71  input_params.mesh_restrict_micro_file);
72  } else {
73  input_params.mesh_restrict_micro_file = input_params.common_inter_file + "_B_restriction.msh";
74  }
75 
76  // Set the equivalence tables
77  if (field_parser.search(2, "--tableRA", "Mesh_A_RestrictionEquivalenceTable")) {
78  input_params.equivalence_table_restrict_BIG_file = field_parser.next(
80  } else {
81  input_params.equivalence_table_restrict_BIG_file = input_params.common_inter_file + "_A_restriction_restrict.dat";
82  }
83 
84  if (field_parser.search(2, "--tableRB", "Mesh_B_RestrictionEquivalenceTable")) {
85  input_params.equivalence_table_restrict_micro_file = field_parser.next(
87  } else {
88  input_params.equivalence_table_restrict_micro_file = input_params.common_inter_file + "_B_restriction_restrict.dat";
89  }
90 
91  // Set the mediator mesh
93  input_params.mesh_mediator_file = input_params.mesh_restrict_BIG_file;
94 
95  std::string mediator_type;
96  if (field_parser.search(1,"MediatorMesh"))
97  {
98  mediator_type = field_parser.next(mediator_type);
99 
100  if(mediator_type == "UseRestricted_A")
101  {
103  input_params.mesh_mediator_file = input_params.mesh_restrict_BIG_file;
104  }
105  else if(mediator_type == "UseRestricted_B")
106  {
108  input_params.mesh_mediator_file = input_params.mesh_restrict_micro_file;
109  }
110  }
111 };
112 
113 };
Structure containing the parameters for the construction of the coupling matrices.
#define homemade_error_msg(msg)
Definition: common_header.h:73
std::string equivalence_table_restrict_BIG_file
Equivalence table between the macro (BIG) system mesh and its restriction mesh.
std::string equivalence_table_restrict_micro_file
Equivalence table between the micro system mesh and its restriction mesh.
void get_assemble_coupling_input_params(GetPot &field_parser, coupling_assemble_coupling_input_params &input_params)
Parser function for the construction of the coupling matrices.
carl::MediatorType mediator_type
Use which mesh as the mediator mesh? Values: carl::MediatorType::USE_MACRO, carl::MediatorType::USE_M...
double coupling_rigidity
Rigidity used for the coupling matrix.
std::string mesh_micro_file
Path to the micro system mesh.
std::string common_inter_file
Common path to the intersection meshes and tables.
std::string mesh_restrict_micro_file
Path to the restricted micro system mesh.
std::string mesh_BIG_file
Path to the macro (BIG) system mesh.
std::string mesh_restrict_BIG_file
Path to the restricted macro (BIG) system mesh.
std::string mesh_mediator_file
Path to the mediator system mesh.