Skip to content

Commit

Permalink
Switch solver for PETSc 64-bit int
Browse files Browse the repository at this point in the history
  • Loading branch information
garth-wells committed Nov 12, 2024
1 parent ff2aeea commit 1358c40
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 4 additions & 2 deletions cpp/demo/mixed_poisson/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,10 @@ int main(int argc, char* argv[])
la::petsc::KrylovSolver lu(MPI_COMM_WORLD);
la::petsc::options::set("ksp_type", "preonly");
la::petsc::options::set("pc_type", "lu");
// la::petsc::options::set("pc_factor_mat_solver_type", "superlu_dist");
la::petsc::options::set("pc_factor_mat_solver_type", "mumps");
if (sizeof(PETSC_INT) == 32)
la::petsc::options::set("pc_factor_mat_solver_type", "mumps");
else
la::petsc::options::set("pc_factor_mat_solver_type", "superlu_dist");
lu.set_from_options();

// Solve linear system Ax = b
Expand Down
7 changes: 4 additions & 3 deletions cpp/dolfinx/fem/FiniteElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ _build_element_list(std::vector<BasixElementData<T>> elements)
std::ranges::transform(elements, std::back_inserter(_e),
[](auto data)
{
auto [e, bs, symm] = data;
// int _bs = bs ? bs->front() : 1;
// TODO: Check bs and symm, bs should be empty?
auto& [e, bs, symm] = data;
return std::make_shared<fem::FiniteElement<T>>(e, bs,
symm);
});
Expand Down Expand Up @@ -314,6 +312,9 @@ int FiniteElement<T>::value_size() const
{
int vs = std::accumulate(_value_shape->begin(), _value_shape->end(), 1,
std::multiplies{});

// See comments in constructor on why special handling for the
// symmetric case is required.
if (_symmetric)
{
if (vs == 3)
Expand Down

0 comments on commit 1358c40

Please sign in to comment.