Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix minor example issues #1069

Merged
merged 5 commits into from Jul 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ void AdvectionProblem<dim>::solve()
preconditioner);
*******************************************************/

// Give the solution back to deall.ii
// Distribute the possible hanging nodes constraints
hanging_node_constraints.distribute(solution);
}

Expand Down
7 changes: 5 additions & 2 deletions examples/poisson-solver/poisson-solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,12 @@ int main(int argc, char* argv[])
}

// Get number of discretization points
const auto executor_string = argc >= 2 ? argv[1] : "reference";
const unsigned int discretization_points =
argc >= 3 ? std::atoi(argv[2]) : 100;

// Get the executor string
const auto executor_string = argc >= 2 ? argv[1] : "reference";

// Figure out where to run the code
std::map<std::string, std::function<std::shared_ptr<gko::Executor>()>>
exec_map{
Expand All @@ -162,7 +164,8 @@ int main(int argc, char* argv[])
// executor used by the application
const auto app_exec = exec->get_master();

// problem:
// Set up the problem: define the exact solution, the right hand side and
// the Dirichlet boundary condition.
auto correct_u = [](ValueType x) { return x * x * x; };
auto f = [](ValueType x) { return ValueType(6) * x; };
auto u0 = correct_u(0);
Expand Down
3 changes: 2 additions & 1 deletion examples/simple-solver/simple-solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ int main(int argc, char* argv[])
// Print the ginkgo version information.
std::cout << gko::version_info::get() << std::endl;

// Print help on how to execute this example.
if (argc == 2 && (std::string(argv[1]) == "--help")) {
std::cerr << "Usage: " << argv[0] << " [executor] " << std::endl;
std::exit(-1);
Expand Down Expand Up @@ -114,7 +115,7 @@ int main(int argc, char* argv[])
// the hood call the required smart pointer functions to manage object
// ownership. The gko::share , gko::give and gko::lend are the functions
// that you would need to use.
auto A = share(gko::read<mtx>(std::ifstream("data/A.mtx"), exec));
auto A = gko::share(gko::read<mtx>(std::ifstream("data/A.mtx"), exec));
auto b = gko::read<vec>(std::ifstream("data/b.mtx"), exec);
auto x = gko::read<vec>(std::ifstream("data/x0.mtx"), exec);

Expand Down