Commit 74db31d9 authored by GILLES Sebastien's avatar GILLES Sebastien

#356 Update the main XCode template.

parent 2a23636b
......@@ -20,36 +20,28 @@ using namespace HappyHeart;
int main(int argc, char ** argv)
{
Wrappers::Mpi::InitEnvironment(argc, argv);
Wrappers::Mpi::shared_ptr mpi_world_ptr =
try
{
Wrappers::Mpi::InitEnvironment(argc, argv);
Wrappers::Mpi::shared_ptr mpi_world_ptr =
std::make_shared<Wrappers::Mpi>(0, Wrappers::MpiNS::Comm::World); // must be called before Petsc RAII
std::string input_parameter_file =
std::string input_parameter_file =
Utilities::CommandLineOptions::InputParameterFileFromCommandLine(argc, argv, __FILE__, __LINE__);
Wrappers::Petsc::Petsc raii_over_petsc(__FILE__, __LINE__);
std::string time_log_filename;
___VARIABLE_problemName:identifier___::InputParameterList
input_parameter_data(input_parameter_file, mpi_world_ptr);
{
std::ostringstream oconv;
oconv << "/Volumes/Data/sebastien/HappyHeart/Results/___VARIABLE_problemName:identifier___/TimeLogs/time_log."
<< mpi_world_ptr->Rank<int>() << ".txt";
time_log_filename = std::move(oconv.str());
}
auto time_keep_stream = InitTimeKeepLog(*mpi_world_ptr, input_parameter_data);
// this line is required if TimeKeep facility is used.
std::ofstream log_time_elapsed(time_log_filename);
TimeKeep::CreateOrGetInstance(log_time_elapsed);
Wrappers::Petsc::Petsc raii_over_petsc(__FILE__, __LINE__);
try
{
___VARIABLE_problemName:identifier___NS::InputParameterList
input_parameter_data(input_parameter_file, mpi_world_ptr);
___VARIABLE_problemName:identifier___NS::___VARIABLE_problemName:identifier___Model model(mpi_world_ptr, input_parameter_data);
___VARIABLE_problemName:identifier___::Model model(mpi_world_ptr, input_parameter_data);
model.Run(input_parameter_data);
input_parameter_data.PrintUnused(std::cout);
}
input_parameter_data.PrintUnused(std::cout);
}
catch(const std::exception& e)
{
std::cerr << "Exception caught: " << e.what() << std::endl;
......
......@@ -24,13 +24,12 @@ int main(int argc, char ** argv)
Utilities::CommandLineOptions::InputParameterFileFromCommandLine(argc, argv, __FILE__, __LINE__);
Wrappers::Petsc::Petsc raii_over_petsc(__FILE__, __LINE__);
ElasticityNS::InputParameterList
input_parameter_data(input_parameter_file, mpi_world_ptr);
auto time_keep_stream = InitTimeKeepLog(*mpi_world_ptr,
input_parameter_data);
auto time_keep_stream = InitTimeKeepLog(*mpi_world_ptr, input_parameter_data);
// this line is required if TimeKeep facility is used.
ElasticityNS::ElasticityModel model(mpi_world_ptr, input_parameter_data);
model.Run(input_parameter_data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment