dune-composites (2.5.1)

geneo_core.hh
1
2#include "conbase_fork.hh"
3#include "cg_fork.hh"
4#include "neumann_boundary_condition.hh"
5
6#include "two_level_schwarz.hh"
7
8#include "subdomainprojectedcoarsespace.hh"
9
10#include "partitionofunity.hh"
11#include "localoperator_ovlp_region.hh"
12
13#include "geneobasis.hh"
14#include "liptonbabuskabasis.hh"
15#include "partitionofunitybasis.hh"
16#include "zembasis.hh"
17
18namespace Dune{
19namespace Geneo{
20
21template<class GFS, class C, class VV, class CON, template<typename> class Solver>
22 class OVLP_GenEO_UMFPack_Base
23 : public Dune::PDELab::OVLPScalarProductImplementation<GFS>,
24 public Dune::PDELab::LinearResultStorage
25 {
26 public:
27
28 typedef typename GFS::template ConstraintsContainer<double>::Type CC;
29
30
38 OVLP_GenEO_UMFPack_Base (const GFS& gfs_, const C& c_, const CON& constraints_,unsigned maxiter_=5000,
39 int verbose_=1)
40 : Dune::PDELab::OVLPScalarProductImplementation<GFS>(gfs_),
41 gfs(gfs_), c(c_), constraints(constraints_),
42 maxiter(maxiter_),
43 verbose(verbose_)
44 {
45
46 // Constraint Containers
47 CC cg; cg.clear();
48 CC cg_ext; cg_ext.clear();
49
50 // Setup Preconditioner
51
52 Dune::PDELab::constraints_exterior(constraints,gfs,cg_ext);
53 auto cc_bnd_neu_int_dir = CC();
55 cc_bnd_neu_int_dir.clear();
56 Dune::PDELab::constraints(pnbc,gfs,cc_bnd_neu_int_dir);
57 }
58
66 template<class M, class V, class W>
67 void apply(M& A, V& z, W& r, typename Dune::template FieldTraits<typename V::ElementType >::real_type reduction)
68 {
69 typedef Dune::PDELab::OverlappingOperator<C,M,V,W> POP;
70 POP pop(c,A);
71 typedef Dune::PDELab::OVLPScalarProduct<GFS,V> PSP;
72 PSP psp(*this);
73#if HAVE_SUITESPARSE_UMFPACK || DOXYGEN
74 typedef Dune::PDELab::UMFPackSubdomainSolver<GFS,M,V,W> PREC;
75 PREC prec(gfs,A);
76 int verb=0;
77 if (gfs.gridView().comm().rank()==0) verb=verbose;
78 Solver<V> solver(pop,psp,prec,reduction,maxiter,verb);
79 Dune::InverseOperatorResult stat;
80 solver.apply(z,r,stat);
81 res.converged = stat.converged;
82 res.iterations = stat.iterations;
83 res.elapsed = stat.elapsed;
84 res.reduction = stat.reduction;
85 res.conv_rate = stat.conv_rate;
86#else
87 std::cout << "No UMFPack support, please install and configure it." << std::endl;
88#endif
89 }
90
91 private:
92 const GFS& gfs;
93 const C& c;
94 const CON& constraints;
95 unsigned maxiter;
96 int verbose;
97 };
98
99 }
100}
Definition: neumann_boundary_condition.hh:13
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden & Uni Heidelberg  |  generated with Hugo v0.111.3 (Sep 5, 22:35, 2025)