CArl
Code Arlequin / C++ implementation
CArl_FETI_solution.cpp File Reference

Program responsible to calculate the coupled system solution of the FETI algorithm. More...

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Program responsible to calculate the coupled system solution of the FETI algorithm.

This program's input file description can be found at the documentation of the function carl::get_input_params(GetPot& field_parser, feti_set_sol_params& input_params).

It will use the following files from the input_params.scratch_folder_path folder:

  • solutions $u_{0,1}$ and $u_{0,}2$, from the system $K_l * u_{0,l} = F_l$. Files:
    ext_solver_u0_A_sys_sol_vec.petscvec
    ext_solver_u0_B_sys_sol_vec.petscvec
    
  • solutions $x_1(kkk) and $x_2(kkk), from the system $K_l * x_l(kkk) = C_l^t*phi(kkk)$. Files:
    ext_solver_A_sys_sol_vec.petscvec
    ext_solver_B_sys_sol_vec.petscvec
    
  • rigid body mode correction vector. Files:
    [RB] FETI_RB_correction.petscvec
    

The items marked with a [RB] are only needed if the rigid body modes projectors are used. In the last two cases, [nb. of vectors] is the number of rigid body mode vectors (given by input_params.nb_of_rb_vectors) and [iii] is an integer going from 0 to input_params.nb_of_rb_vectors - 1 (following C++ notation).

This program outputs the solution vectors inside the input_params.output_base folder. Files:

[input_params.output_base]_coupled_sol_A.petscvec
[input_params.output_base]_coupled_sol_B.petscvec

Definition in file CArl_FETI_solution.cpp.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 33 of file CArl_FETI_solution.cpp.

33  {
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
87  feti_op.calculate_coupled_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...
Class containing the operations needed for the FETI solver.
bool bUseRigidBodyModes
[RB] Use the rigid body modes for the micro system?
std::string output_folder
Path to the coupled outup folder.
Structure containing the parameters for the setup initialization of the FETI solver.