Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions palace/linalg/mumps.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ class MumpsSolver : public mfem::MUMPSSolver
iodata.problem.type == ProblemType::ELECTROSTATIC ||
iodata.problem.type == ProblemType::MAGNETOSTATIC)
? mfem::MUMPSSolver::SYMMETRIC_POSITIVE_DEFINITE
: iodata.solver.linear.complex_coarse_solve
? mfem::MUMPSSolver::UNSYMMETRIC
: mfem::MUMPSSolver::SYMMETRIC_INDEFINITE,
: iodata.boundaries.periodic.wave_vector == std::array<double, 3>{0.0, 0.0, 0.0}
? mfem::MUMPSSolver::SYMMETRIC_INDEFINITE
: mfem::MUMPSSolver::UNSYMMETRIC,
iodata.solver.linear.sym_factorization,
(iodata.solver.linear.strumpack_compression_type == SparseCompression::BLR)
? iodata.solver.linear.strumpack_lr_tol
Expand Down
11 changes: 7 additions & 4 deletions palace/linalg/solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,19 @@ void MfemWrapperSolver<ComplexOperator>::SetOperator(const ComplexOperator &op)
{
if (complex_matrix)
{
// A = [Ar, -Ai]
// [Ai, Ar]
// A = [Ar, Ai]
// [Ai, -Ar]
// We solve A [xr; -xi] = [br; bi]
mfem::Array2D<const mfem::HypreParMatrix *> blocks(2, 2);
mfem::Array2D<double> block_coeffs(2, 2);
blocks(0, 0) = hAr;
blocks(0, 1) = hAi;
blocks(1, 0) = hAi;
blocks(1, 1) = hAr;
block_coeffs(0, 0) = 1.0;
block_coeffs(0, 1) = -1.0;
block_coeffs(0, 1) = 1.0;
block_coeffs(1, 0) = 1.0;
block_coeffs(1, 1) = 1.0;
block_coeffs(1, 1) = -1.0;
A.reset(mfem::HypreParMatrixFromBlocks(blocks, &block_coeffs));
}
else
Expand Down Expand Up @@ -168,6 +169,8 @@ void MfemWrapperSolver<ComplexOperator>::Mult(const ComplexVector &x,
Y.ReadWrite();
yr.MakeRef(Y, 0, Ny);
yi.MakeRef(Y, Ny, Ny);
// [yr; yi] is the complex conjugate of the solution
yi *= -1.0;
y.Real() = yr;
y.Imag() = yi;
}
Expand Down
Loading