How to provide the VectorMemory<BlockVector<double> > for the class SchurMatrix?

22 views
Skip to first unread message

Jesse

unread,
Apr 26, 2017, 9:21:47 AM4/26/17
to deal.II User Group
Deal all,

I'm using the mixed finite element to solve a Cahn-HIlliard type equation, after discretization I obtain a block matrix system. I plan to use the class SchurMatrix in deal.ii to obtain the Schur Complement.

The block matrix system is 

* / \ / \ / \ * | A Dt | | u | - | f | * | -B C | | p | - | g | * \ / \ / \ /
where A and C are sparse mass matrices, B Dt are sparse stiff matrices.
But when constructing the SchurMatrix object, I need to provide  'mem'. Could someone help me to provide 'mem'?

Thank you in advance.
Jesse 
template<class MA_inverse , class MB , class MDt , class MC >

SchurMatrix< MA_inverse, MB, MDt, MC >::SchurMatrix(const MA_inverse & Ainv,
const MB & B,
const MDt & Dt,
const MC & C,
VectorMemoryBlockVector< double > > & mem,
const std::vector< types::global_dof_index > & signature = std::vector<types::global_dof_index>(0) 
)


Jean-Paul Pelteret

unread,
Apr 26, 2017, 10:22:26 AM4/26/17
to deal.II User Group
Dear Jesse,

You can probably just provide an instance of the GrowingVectorMemory class templated on BlockVector< double >. So this would look something like:
GrowingVectorMemory< BlockVector<double> > memory;
const SchurMatrix 
schur_matrix (A_inv, B, Dt, C, memory);
...

If its of any help to you, and if you have a C++11 compatible compiler, then you could alternatively use the (relatively) new LinearOperator class and the schur_complement operator. It provides a more flexible framework with which you could perform the same operation.

Kind regards,
Jean-Paul

Jesse

unread,
Apr 26, 2017, 10:35:24 AM4/26/17
to deal.II User Group
Dear Jean-Paul,

Thank you very much for your help. This is exactly what I needed. My compiler support c++11 features, I will also try the new schur_complement operator.
With best wishes,
Jesse

在 2017年4月26日星期三 UTC+2下午4:22:26,Jean-Paul Pelteret写道:
Reply all
Reply to author
Forward
0 new messages