Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ef7a33b64d | ||
|
|
abaa73e4dc |
@@ -50,6 +50,7 @@ examples/ex1[04-9]
|
||||
examples/ex1[0-9]p
|
||||
examples/ex2[0-9]
|
||||
examples/ex2[0-9]p
|
||||
examples/ex25-gpu
|
||||
|
||||
examples/refined.mesh
|
||||
examples/displaced.mesh
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+18
-4
@@ -134,7 +134,7 @@ OperatorJacobiSmoother::OperatorJacobiSmoother(const BilinearForm &a,
|
||||
|
||||
OperatorJacobiSmoother::OperatorJacobiSmoother(const Vector &d,
|
||||
const Array<int> &ess_tdofs,
|
||||
const double dmpng)
|
||||
const double dmpng, const bool inverse)
|
||||
:
|
||||
Solver(d.Size()),
|
||||
N(d.Size()),
|
||||
@@ -143,16 +143,30 @@ OperatorJacobiSmoother::OperatorJacobiSmoother(const Vector &d,
|
||||
ess_tdof_list(ess_tdofs),
|
||||
residual(N)
|
||||
{
|
||||
Setup(d);
|
||||
Setup(d, inverse);
|
||||
}
|
||||
|
||||
void OperatorJacobiSmoother::Setup(const Vector &diag)
|
||||
void OperatorJacobiSmoother::Setup(const Vector &diag, const bool inverse)
|
||||
{
|
||||
residual.UseDevice(true);
|
||||
const double delta = damping;
|
||||
auto D = diag.Read();
|
||||
auto DI = dinv.Write();
|
||||
MFEM_FORALL(i, N, DI[i] = delta / D[i]; );
|
||||
if (inverse)
|
||||
{
|
||||
if (delta > 0.0)
|
||||
{
|
||||
MFEM_FORALL(i, N, DI[i] = delta * D[i]; );
|
||||
}
|
||||
else
|
||||
{
|
||||
MFEM_FORALL(i, N, DI[i] = D[i]; );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MFEM_FORALL(i, N, DI[i] = delta / D[i]; );
|
||||
}
|
||||
auto I = ess_tdof_list.Read();
|
||||
MFEM_FORALL(i, ess_tdof_list.Size(), DI[I[i]] = delta; );
|
||||
}
|
||||
|
||||
+3
-2
@@ -125,13 +125,14 @@ public:
|
||||
the matrix-free setting. */
|
||||
OperatorJacobiSmoother(const Vector &d,
|
||||
const Array<int> &ess_tdof_list,
|
||||
const double damping=1.0);
|
||||
const double damping=1.0,
|
||||
const bool inverse=false);
|
||||
~OperatorJacobiSmoother() {}
|
||||
|
||||
void Mult(const Vector &x, Vector &y) const;
|
||||
void MultTranspose(const Vector &x, Vector &y) const { Mult(x, y); }
|
||||
void SetOperator(const Operator &op) { oper = &op; }
|
||||
void Setup(const Vector &diag);
|
||||
void Setup(const Vector &diag, const bool inverse=false);
|
||||
|
||||
private:
|
||||
const int N;
|
||||
|
||||
Reference in New Issue
Block a user