Skip to content
Snippets Groups Projects
Commit a9d113fb authored by Philipp Wissmann's avatar Philipp Wissmann
Browse files

Remove redundant policy parameter

parent 7ece5ace
No related branches found
No related tags found
No related merge requests found
......@@ -52,8 +52,6 @@
namespace cpppetsc = ae108::cpppetsc;
namespace elements = ae108::elements;
namespace solve = ae108::solve;
namespace assembly = ae108::assembly;
namespace plugins = ae108::assembly::plugins;
using Policy = cpppetsc::ParallelComputePolicy;
using Context = cpppetsc::Context<Policy>;
......@@ -155,7 +153,7 @@ using StiffnessMatrixAssembler = ae108::assembly::StiffnessMatrixAssembler<
/// Solver templated on Mesh and Policy (assembler is not part of the class
/// interface)
using Solver = solve::NonlinearSolver<Mesh, Policy>;
using Solver = solve::NonlinearSolver<Mesh>;
int main(int argc, char **argv) {
// MPI/PETSc/cpppetsc must be initialized before using it.
......
......@@ -29,7 +29,7 @@
namespace ae108::solve {
template <typename Mesh, typename Policy> class NonlinearSolver {
template <typename Mesh> class NonlinearSolver {
public:
using size_type = typename Mesh::size_type;
using value_type = typename Mesh::value_type;
......@@ -161,16 +161,14 @@ void applyBoundaryConditionsToForces(
}
} // namespace detail
template <typename Mesh, typename Policy>
NonlinearSolver<Mesh, Policy>::NonlinearSolver(const Mesh *mesh)
: _mesh(mesh) {}
template <typename Mesh>
NonlinearSolver<Mesh>::NonlinearSolver(const Mesh *mesh) : _mesh(mesh) {}
template <typename mesh_type_type, typename Policy>
template <typename Mesh>
template <ForceVectorAssemblerLike ForceAssembler,
StiffnessAssemblerLike StiffnessAssembler>
cpppetsc::distributed<
typename NonlinearSolver<mesh_type_type, Policy>::vector_type>
NonlinearSolver<mesh_type_type, Policy>::computeSolution(
cpppetsc::distributed<typename NonlinearSolver<Mesh>::vector_type>
NonlinearSolver<Mesh>::computeSolution(
const BoundaryConditionContainer &boundaryConditions,
cpppetsc::distributed<vector_type> initialGuess, const double time,
const ForceAssembler &forceAssembler,
......@@ -207,9 +205,9 @@ NonlinearSolver<mesh_type_type, Policy>::computeSolution(
distributedStiffnessMatrixAssembler);
}
template <typename Mesh, typename Policy>
cpppetsc::distributed<typename NonlinearSolver<Mesh, Policy>::vector_type>
NonlinearSolver<Mesh, Policy>::computeSolution(
template <typename Mesh>
cpppetsc::distributed<typename NonlinearSolver<Mesh>::vector_type>
NonlinearSolver<Mesh>::computeSolution(
const BoundaryConditionContainer &boundaryConditions,
cpppetsc::distributed<vector_type> initialGuess, const double time,
DistributedForceVectorAssembler assembleForceVector,
......@@ -234,7 +232,7 @@ NonlinearSolver<Mesh, Policy>::computeSolution(
detail::applyBoundaryConditionsToMatrix(boundaryConditions, output);
};
const cpppetsc::NonlinearSolver<Policy> solver{
const cpppetsc::NonlinearSolver<typename Mesh::policy_type> solver{
matrix_type::fromMesh(*_mesh), vector_type::fromGlobalMesh(*_mesh)};
return solver.solve(std::move(function), std::move(jacobian),
std::move(initialGuess));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment