CArl
Code Arlequin / C++ implementation
CArl_FETI_solution.cpp
Go to the documentation of this file.
1 #include "CArl_FETI_solution.h"
2 
33 int main(int argc, char** argv) {
34 
35  // --- Initialize libMesh
36  libMesh::LibMeshInit init(argc, argv);
37 
38  // Do performance log?
39  libMesh::PerfLog perf_log("Main program");
40 
41  // libMesh's C++ / MPI communicator wrapper
42  libMesh::Parallel::Communicator& WorldComm = init.comm();
43 
44  // Number of processors and processor rank.
45  int rank = WorldComm.rank();
46  int nodes = WorldComm.size();
47 
48  // --- Set up inputs
49 
50  // Command line parser
51  GetPot command_line(argc, argv);
52 
53  // File parser
54  GetPot field_parser;
55 
56  // If there is an input file, parse it to get the parameters. Else, parse the command line
57  std::string input_filename;
58  if (command_line.search(2, "--inputfile", "-i")) {
59  input_filename = command_line.next(input_filename);
60  field_parser.parse_input_file(input_filename, "#", "\n", " \t\n");
61  } else {
62  field_parser = command_line;
63  }
64 
65  carl::feti_set_sol_params input_params;
66  get_input_params(field_parser, input_params);
67 
68  // Object containing the FETI operations
69  carl::FETI_Operations feti_op(WorldComm,input_params.scratch_folder_path);
70 
71  // --- Define if the rb modes will be used or not
72  feti_op.using_rb_modes(input_params.bUseRigidBodyModes);
73 
74  // Read the decoupled solutions, K_i * u_0,i = F_i
75  feti_op.read_decoupled_solutions();
76 
77  // Read the solutions of K_i * x_i(FINAL) = C_i^t * phi(FINAL)
78  feti_op.read_ext_solver_output();
79 
80  // Read the rb modes correction, 'RB_corr(FINAL)'
81  if(input_params.bUseRigidBodyModes)
82  {
83  feti_op.read_rb_corr();
84  }
85 
86  // Calculate the solution
88 
89  // Export it (finallly!)
90  feti_op.export_coupled_solution(input_params.output_folder);
91 
92  return 0;
93 }
void get_input_params(GetPot &field_parser, feti_iterate_params &input_params)
Parser function for the coupled solver test programs.
std::string scratch_folder_path
Path to the folder which will be used to save the temporary files during the solve operation...
void read_rb_corr()
Read the rigid body modes correction vector.
Class containing the operations needed for the FETI solver.
void calculate_coupled_solution()
Calculate the final coupled solution.
bool bUseRigidBodyModes
[RB] Use the rigid body modes for the micro system?
void using_rb_modes(bool bUseRigidBodyModes)
Set up the.
void export_coupled_solution(std::string output_base)
void read_decoupled_solutions()
Read the decoupled solutions, .
int main(int argc, char **argv)
std::string output_folder
Path to the coupled outup folder.
void read_ext_solver_output()
Read the latest external solver output.
Structure containing the parameters for the setup initialization of the FETI solver.