hp-FEM
Adaptive hp-FEM suite for nano-optics
Loading...
Searching...
No Matches
device_stepper.hpp
Go to the documentation of this file.
1#pragma once
14
15#include <memory>
16
17#include "hpfem/core/types.hpp"
19
20namespace hpfem::solvers {
21
23 public:
26 [[nodiscard]] static bool available(const LinearSolver& newmark) noexcept;
27
35 DeviceStepper(LinearSolver& newmark, const SparseMatrix* damping, const SparseMatrix& stiffness,
36 const Vector* load, Real dt, Real beta, Real gamma);
38 DeviceStepper(const DeviceStepper&) = delete;
40
42 void set_state(const Vector& u, const Vector& v, const Vector& a);
44 void step(Real load_scale);
46 void get_state(Vector& u, Vector& v, Vector& a) const;
47 [[nodiscard]] Index size() const noexcept { return size_; }
48
49 private:
50 struct Impl;
51 std::unique_ptr<Impl> impl_;
52 Index size_ = 0;
53};
54
55} // namespace hpfem::solvers
Definition device_stepper.hpp:22
Index size() const noexcept
Definition device_stepper.hpp:47
DeviceStepper & operator=(const DeviceStepper &)=delete
void set_state(const Vector &u, const Vector &v, const Vector &a)
Uploads the state (reduced vectors of the free DoFs).
static bool available(const LinearSolver &newmark) noexcept
void step(Real load_scale)
One Newmark step with the load (load_scale = ).
void get_state(Vector &u, Vector &v, Vector &a) const
Downloads the state (synchronises the device).
DeviceStepper(LinearSolver &newmark, const SparseMatrix *damping, const SparseMatrix &stiffness, const Vector *load, Real dt, Real beta, Real gamma)
DeviceStepper(const DeviceStepper &)=delete
Factorise once, solve for many right-hand sides.
Definition linear_solver.hpp:17
Definition device_arnoldi.hpp:23
double Real
Definition types.hpp:15
Eigen::SparseMatrix< Complex, Eigen::RowMajor, Index > SparseMatrix
Definition types.hpp:24
std::int64_t Index
global indices (DoFs, entities)
Definition types.hpp:17
Eigen::Matrix< Complex, Eigen::Dynamic, 1 > Vector
Definition types.hpp:20