27template <
typename Inputs,
typename Outputs,
typename CollPts =
void>
46 inline constexpr const auto &
lhs()
const {
return lhs_; }
49 inline constexpr auto &
lhs() {
return lhs_; }
52 inline constexpr const auto &
rhs()
const {
return rhs_; }
55 inline constexpr auto &
rhs() {
return rhs_; }
79 inline void pretty_print(std::ostream &os)
const noexcept override {
80 os <<
name() <<
"(\n";
82 os <<
"inputs[" << Base::ninputs() <<
"] = (";
83 std::apply([&os](
const auto &...elems) { ((os << elems <<
"\n"), ...); },
87 os <<
"outputs [" << Base::noutputs() <<
"]= (";
88 std::apply([&os](
const auto &...elems) { ((os << elems <<
"\n"), ...); },
92 os <<
"collPts [" << Base::ncollPts() <<
"]= (";
93 std::apply([&os](
const auto &...elems) { ((os << elems <<
"\n"), ...); },
100template <
typename Inputs,
typename Outputs,
typename CollPts>
IgA base class.
Definition iganet.hpp:46
IgA solver.
Definition igasolver.hpp:29
torch::Tensor lhs_
Left-hand side tensor.
Definition igasolver.hpp:33
torch::Tensor rhs_
Right-hand side tensor.
Definition igasolver.hpp:36
virtual void assembleLhs()=0
Assembles the left-hand side of the solver.
constexpr const auto & rhs() const
Returns a constant reference to the right-hand side object.
Definition igasolver.hpp:52
virtual void assembleRhs()=0
Assembles the right-hand side of the solver.
virtual void assemble()
Assembles the solver.
Definition igasolver.hpp:61
torch::Tensor solve() const
Computes the solution vector.
Definition igasolver.hpp:73
constexpr auto & rhs()
Returns a non-constant reference to the right-hand side object.
Definition igasolver.hpp:55
constexpr const auto & lhs() const
Returns a constant reference to the left-hand side object.
Definition igasolver.hpp:46
constexpr auto & lhs()
Returns a non-constant reference to the left-hand side object.
Definition igasolver.hpp:49
virtual void init()=0
Initializes the solver.
void pretty_print(std::ostream &os) const noexcept override
Returns a string representation of the IgASolver object.
Definition igasolver.hpp:79
Full qualified name descriptor.
Definition fqn.hpp:22
virtual const std::string & name() const noexcept
Returns the full qualified name of the object.
Definition fqn.hpp:28
auto solve_bicgstab(const torch::Tensor &A, const torch::Tensor b, int max_iter=1000, double tol=1e-10)
Solves the linear system A * x = b using the Bi-Conjugate Gradient Stabilized (BiCGStab) method.
Definition solver.hpp:57
std::ostream & operator<<(std::ostream &os, const MemoryDebugger< id > &obj)
Print (as string) a memory debugger object.
Definition memory.hpp:125
Solver utility functions.