Hello,
I have carried out the suggestions Wolfgang made regarding
i) some_complex_number == PetscScalar() ....
ii)const PetscScalar value = values[j];
There weren't too many occurrences of the above, though. The patch to
implement
my changes is attached (meant to be applied on 6.2.1)
I do not know much about the inner workings of Petsc or deal.ii. I am stuck
at the following
set of error messages
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
/home/arvind/sim/workspace/deal.II.6.2.1/trunk/lac/include/lac/constraint_matrix.templates.h:152:
error: no match for ‘operator*’ in
‘((dealii::PETScWrappers::Vector*)vec)->dealii::PETScWrappers::Vector::<anonymous>.dealii::PETScWrappers::VectorBase::operator()(constraint_line.__gnu_cxx::__normal_iterator<_Iterator,
_Container>::operator-> [with _Iterator = const
dealii::ConstraintMatrix::ConstraintLine*, _Container =
std::vector<dealii::ConstraintMatrix::ConstraintLine,
std::allocator<dealii::ConstraintMatrix::ConstraintLine>
>]()->dealii::ConstraintMatrix::ConstraintLine::line) *
constraint_line.__gnu_cxx::__normal_iterator<_Iterator,
_Container>::operator-> [with _Iterator = const
dealii::ConstraintMatrix::ConstraintLine*, _Container =
std::vector<dealii::ConstraintMatrix::ConstraintLine,
std::allocator<dealii::ConstraintMatrix::ConstraintLine>
>]()->dealii::ConstraintMatrix::ConstraintLine::entries.std::vector<_Tp,
_Alloc>::operator[] [with _Tp = std::pair<unsigned int, double>, _Alloc =
std::allocator<std::pair<unsigned int, double> >](((long unsigned
int)q))->std::pair<unsigned int, double>::second’
/home/arvind/sim/workspace/deal.II.6.2.1/trunk/lac/include/lac/constraint_matrix.templates.h:1517:
error: no matching function for call to
‘dealii::PETScWrappers::SparseMatrix::add(const unsigned int&, const
unsigned int&, unsigned int*, double*, bool, bool)’
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Please let me know how I should proceed.
Best Regards
Arvind
On Fri, Sep 18, 2009 at 2:14 AM, Wolfgang Bangerth
<[email protected]>wrote:
>
> > By way of note, this patch figures out if your petsc really is defined
> > to be complex (attached).
>
> The patch contains a bunch of other things than just the part you mention
> (things that have been checked in a few days back). Can you send a clean
> patch?
>
> Thanks
> W.
>
>
> --
> -------------------------------------------------------------------------
> Wolfgang Bangerth email: [email protected]
> www:
> http://www.math.tamu.edu/~bangerth/<http://www.math.tamu.edu/%7Ebangerth/>
>
> _______________________________________________
> dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii
>
Index: trunk/lac/include/lac/petsc_vector_base.h
===================================================================
--- trunk/lac/include/lac/petsc_vector_base.h (revision 1)
+++ trunk/lac/include/lac/petsc_vector_base.h (working copy)
@@ -835,7 +835,7 @@
// PETScWrappers::MPI::Vector), but we
// can save some work if the addend is
// zero
- if (value == 0)
+ if (value == PetscScalar())
return *this;
// use the PETSc function to add something
@@ -873,7 +873,7 @@
// PETScWrappers::MPI::Vector), but we
// can save some work if the addend is
// zero
- if (value == 0)
+ if (value == PetscScalar())
return *this;
// use the PETSc function to add something
Index: trunk/lac/include/lac/petsc_matrix_base.h
===================================================================
--- trunk/lac/include/lac/petsc_matrix_base.h (revision 1)
+++ trunk/lac/include/lac/petsc_matrix_base.h (working copy)
@@ -1456,11 +1456,11 @@
n_columns = 0;
for (unsigned int j=0; j<n_cols; ++j)
{
- const double value = values[j];
+ const PetscScalar value = values[j];
Assert (numbers::is_finite(value),
ExcMessage("The given value is not finite but either "
"infinite or Not A Number (NaN)"));
- if (value != 0)
+ if (value != PetscScalar())
{
column_indices[n_columns] = col_indices[j];
column_values[n_columns] = value;
@@ -1492,7 +1492,7 @@
ExcMessage("The given value is not finite but either "
"infinite or Not A Number (NaN)"));
- if (value == 0)
+ if (value == PetscScalar())
{
// we have to do checkings on Insert/Add
// in any case
@@ -1624,11 +1624,11 @@
n_columns = 0;
for (unsigned int j=0; j<n_cols; ++j)
{
- const double value = values[j];
+ const PetscScalar value = values[j];
Assert (numbers::is_finite(value),
ExcMessage("The given value is not finite but either "
"infinite or Not A Number (NaN)"));
- if (value != 0)
+ if (value != PetscScalar())
{
column_indices[n_columns] = col_indices[j];
column_values[n_columns] = value;
_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii