New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add some complex compatibility changes #81
Conversation
Dolfinx doesn't compile yet with petsc complex.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering what degree we want to wrap PETSc calls vs just using PETSc. We used to support multiple backends, but now that we're PETSc only maybe we should just use PETSc and petsc4py?
cpp/dolfin/la/PETScMatrix.cpp
Outdated
|
||
if (size(0) != x.size()) | ||
{ | ||
log::dolfin_error( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're not using dolfin_error
anymore. Switch to throw std::foo
exceptions.
cpp/dolfin/la/PETScMatrix.cpp
Outdated
@@ -452,6 +452,35 @@ void PETScMatrix::transpmult(const PETScVector& x, PETScVector& y) const | |||
petsc_error(ierr, __FILE__, "MatMultTranspose"); | |||
} | |||
//----------------------------------------------------------------------------- | |||
void PETScMatrix::conjtranspmult(const PETScVector& x, PETScVector& y) const |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be make the function name closer to the name of the PETSc function?
cpp/dolfin/la/VectorSpaceBasis.cpp
Outdated
@@ -29,7 +29,7 @@ void VectorSpaceBasis::orthonormalize(double tol) | |||
// orthonormalized vectors | |||
for (std::size_t j = 0; j < i; ++j) | |||
{ | |||
const double dot_ij = _basis[i]->dot(*_basis[j]); | |||
const auto dot_ij = _basis[i]->dot(*_basis[j]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to avoid auto
to make the type clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess here it should be PETScScalar
I added the function to have a consistency between the complex and real interfaces. But, as PETSc and petsc4py are now both required dependencies, it may be a question of clean up rather than adding new functions for the complex case. |
Maybe we should remove |
My question would be: what is it for? Do we need it internally? If not, then it is part of the user interface, which can be done with PETSc/petsc4py directly. |
Run It's possible to configure editors to apply it for you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work.
MPI_DOUBLE_COMPLEX
)la::VectorSpaceBasis