CArl
Code Arlequin / C++ implementation
carl_feti_iterate_input_parser.cpp
Go to the documentation of this file.
1 /*
2  * carl_feti_iterate_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_input_params(GetPot& field_parser,
14  feti_iterate_params& input_params) {
15 
16  if (field_parser.search(1, "ClusterSchedulerType")) {
17  std::string cluster_scheduler_type;
18  cluster_scheduler_type = field_parser.next(cluster_scheduler_type);
19  if(cluster_scheduler_type == "LOCAL")
20  {
21  std::cout << " !!! WARNING: " << std::endl;
22  std::cout << " Using the LOCAL job 'scheduler'. You will have to launch each script" << std::endl;
23  std::cout << " MANUALLY!!! Reason: MPI does not support recursive 'mpirun' calls" << std::endl;
25  }
26  else if(cluster_scheduler_type == "PBS")
28  else if(cluster_scheduler_type == "SLURM")
30  else
31  homemade_error_msg("Invalid scheduler type!");
32  } else {
33  homemade_error_msg("Missing the scheduler type!");
34  }
35 
36  if (field_parser.search(1, "ScratchFolderPath")) {
37  input_params.scratch_folder_path = field_parser.next(
38  input_params.scratch_folder_path);
39  } else {
40  homemade_error_msg("Missing the external scratch folder path!");
41  }
42 
43  if (field_parser.search(1, "CouplingMatricesFolder")) {
44  input_params.coupling_folder_path = field_parser.next(
45  input_params.coupling_folder_path);
46  } else {
47  homemade_error_msg("Missing the coupling matrices path!");
48  }
49 
50  if (field_parser.search(1,"UseRigidBodyModesB"))
51  {
52  input_params.bUseRigidBodyModes = true;
53  if (field_parser.search(1, "RBVectorBase")) {
54  input_params.RB_vectors_base = field_parser.next(
55  input_params.RB_vectors_base);
56  } else {
57  homemade_error_msg("Missing the system B's rigid body mode vectors!");
58  }
59 
60  if (field_parser.search(1, "NbOfRBVectors")) {
61  input_params.nb_of_rb_vectors = field_parser.next(
62  input_params.nb_of_rb_vectors);
63  } else {
64  input_params.nb_of_rb_vectors = 6;
65  }
66  }
67  else
68  {
69  input_params.bUseRigidBodyModes = false;
70  }
71 
72  // Set CG coupling solver convergence
73  input_params.CG_coupled_conv_abs = 1e-20;
74  input_params.CG_coupled_conv_rel = 1e-5;
75  input_params.CG_coupled_div = 1e5;
76  input_params.CG_coupled_conv_max = 1e4;
77  input_params.CG_coupled_conv_corr =1e-5;
78 
79  if( field_parser.search(1,"CoupledConvAbs") )
80  {
81  input_params.CG_coupled_conv_abs = field_parser.next(input_params.CG_coupled_conv_abs);
82  }
83  if( field_parser.search(1,"CoupledConvRel") )
84  {
85  input_params.CG_coupled_conv_rel = field_parser.next(input_params.CG_coupled_conv_rel);
86  }
87  if( field_parser.search(1,"CoupledCorrConvRel") )
88  {
89  input_params.CG_coupled_conv_corr = field_parser.next(input_params.CG_coupled_conv_corr);
90  }
91  if( field_parser.search(1,"CoupledDiv") )
92  {
93  input_params.CG_coupled_div = field_parser.next(input_params.CG_coupled_div);
94  }
95  if( field_parser.search(1,"CoupledIterMax") )
96  {
97  input_params.CG_coupled_conv_max = field_parser.next(input_params.CG_coupled_conv_max);
98  }
99 
100  if ( field_parser.search(1, "CGPreconditionerType") )
101  {
102  std::string CG_precond_type_string = field_parser.next(CG_precond_type_string);
103  if(CG_precond_type_string == "NONE")
105  else if(CG_precond_type_string == "Coupling_operator")
107  else if(CG_precond_type_string == "Coupling_operator_jacobi")
109  else
110  homemade_error_msg("Invalid preconditionner type!");
111  } else {
112  homemade_error_msg("Missing preconditionner type!");
113  }
114 };
115 
116 };
117 
double CG_coupled_conv_rel
[CG] Relative residual convergence.
#define homemade_error_msg(msg)
Definition: common_header.h:73
void get_input_params(GetPot &field_parser, feti_iterate_params &input_params)
Parser function for the coupled solver test programs.
int CG_coupled_conv_max
[CG] Maximum number of iterations.
double CG_coupled_div
[CG] Residual divergence.
bool bUseRigidBodyModes
[RB] Use the rigid body modes for the micro system?
carl::BaseCGPrecondType CG_precond_type
[CG] Type of preconditionner.
double CG_coupled_conv_abs
[CG] Absolute residual convergence.
std::string scratch_folder_path
Path to the folder which will be used to save the temporary files during the solve operation...
std::string coupling_folder_path
Folder containing the coupling matrices.
Structure containing the parameters for the setup initialization of the FETI solver.
std::string RB_vectors_base
[RB] Common path base for the micro system's rigid body mode vectors.
double CG_coupled_conv_corr
[CG] Relative rigid body mode convergence.
ClusterSchedulerType scheduler
Cluster scheduler software type. Values: PBS, SLURM (code not implemented for the later yet)...
int nb_of_rb_vectors
[RB] Number of RB mode vectors.