Re: [deal.II] Supported matrix/vector to LinearOperator

2022-04-19 Thread hkch...@gmail.com
Thanks, Bruno and Jean-Paul. I will not use the 
TrilinosWrapper::SolverDirect in inverse_operator, replaced by an iterative 
solver. But Bruno, this example initializes a precondition by a matrix 

preconditioner.initialize(system_matrix, data);

While I can't get the entity of the matrix, I want to get the precondition 
directly from a linear_operator. 

SparseMatrix M; 
auto op_M = linear_operator(M); 
TrilinosWrapper::PreconditionILU prec_M(op_M); 

Or in other hands, Can I get the entity of a matrix from the 
linear_operator? For example: 

SparseMatrix A, B, C, D, E, F;
linear_operator op_A, op_B, op_C, op_D, op_E, op_F;
inverse_operator  inv_C(op_C, solver, prec_C), inv_E(op_E, solver, prec_E);
linear_operator op_G=op_A-op_B*inv_C*op_D-inv_E*op_F;

Can I get the entity of matrix G by TrilinosWrapper::MPI::SparseMatrix G = 
op_G; or the precondition of op_G?

auto prec_G = linear_operator(op_G, TrilinosWrapper::PreconditionILU); seems 
don't wok.

Best,
Chen

在2022年4月20日星期三 UTC+8 00:19:46 写道:

> Dear Chen,
>
> Bruno pointed you to the exact example that I was going to. It is 
> certainly possible to use linear operators as preconditioners for solvers.
>
> It looks like support for TrilinosWrappers::SolverDirect has not yet been 
> implemented:
>
> https://github.com/dealii/dealii/blob/master/tests/lac/linear_operator_10.cc#L371-L414
> I cannot recall what the reason was — maybe the class is simply missing 
> some functions that are defined for the iterative solvers?
>
> As for one of your early questions which Bruno did already answer: I must 
> admit that I do not know if the PETSc linear algebra is compatible with 
> linear operators. We had to write a special TrilinosPayload 
> 
>  for 
> the Trilinos linear algebra classes in order for them to work correctly 
> (with the Trilinos solvers, at least), and such a wrapper doesn’t exist for 
> PETSc. But maybe it works just fine if you stick to the deal.II solvers? If 
> you try this out, it would be interesting to know if it works or not.
>
> Best,
> J-P
>
> On 19. Apr 2022, at 17:27, Bruno Turcksin  wrote:
>
> Chen,
>
> I am not sure if TrilinosWrappers::SolverDirect is supported but for your 
> second point, you can use the linear_operator as a preconditioner. That's 
> exactly what's done here 
> 
>  for example. The preconditioner is wrapped in a LinearOperator and this 
> LinearOperator is then used as preconditioner.
>
> Best,
>
> Bruno
>
> On Tuesday, April 19, 2022 at 10:39:17 AM UTC-4 hkch...@gmail.com wrote:
>
>> Hi everyone,
>>
>> More questions:
>> 1. where can I find the supported linear solver of Trilinos of 
>> linear_operator? TrilinosWrappers::SolverDirect seems not to be supported 
>> by the linear_operator
>> 2. Does linear_operator can be a preconditioner? for example, SparseMatrix 
>> A, B, C, D, E, F; Matrix G=A-B*C^{-1}*D-E^{-1}*F; So Matrix G can only 
>> represent by a linear_operator, not its entity. I want to get its inverse 
>> by inverse_operator using some linear solvers as: PreconditionILU 
>> prec_G(op_G); const auto op_G_inv = inverse_operator(G, Solver, prec_G); But 
>> it seems that the precondition of linear_operator is not supported. Is 
>> there any solution?
>>
>> best 
>> Chen
>>
>> 在2022年4月18日星期一 UTC+8 22:07:36 写道:
>>
>>> Bruno Turcksin
>>> Thank you! it really helpful!
>>>
>>> best
>>> chen
>>> 在2022年4月18日星期一 UTC+8 21:07:45 写道:
>>>
 Chen,

 Yes, LinearOperator does support Trilinos and PETSc matrices. 
 LinearOperator even supports your own matrix type as long as you define 
 vmult and Tvmult (see here 
 
 )

 Best,

 Bruno

 On Monday, April 18, 2022 at 4:19:42 AM UTC-4 hkch...@gmail.com wrote:

> Hi everyone,
>
> When solving a block matrix system, the LinearOperator is a useful 
> tool. My question is whether the LinearOpertor supports Matrix type (the 
> same as the Vector type) like PETSCWrapper::MPI::SparseMatrix or 
> TrilinosWrapper::MPI::SparseMatrix?
>
> Best
> Chen
>

> -- 
> The deal.II project is located at http://www.dealii.org/
> For mailing list/forum options, see 
> https://groups.google.com/d/forum/dealii?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "deal.II User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to dealii+un...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/dealii/6ee40751-54ae-402d-903e-ae745545387bn%40googlegroups.com
>  
> 

Re: [deal.II] simple application of anti-periodic boundary conditions

2022-04-19 Thread Wolfgang Bangerth

On 4/19/22 13:17, Paras Kumar wrote:


One follow-up question: The mesh (which is initially periodic at the 
boundaries)  is refined adaptively during the simulation and it cannot be 
guaranteed if both the left and the right boundary faces would be refined at 
the same time. Will make_periodicity_constraints() work in that case? If yes, 
how would the periodic constraints look like for the child cell dofs? In case 
it matters, I currently have a dealii::Triangulation and also wish to update 
to p:d:T in future.


I don't recall the details, but at least for p::d::T, it is possible to tell 
the triangulation about the periodicity of sides and it will ensure that if 
you refine the cells on one side the ones on the other side are refined 
accordingly.


Others might remember more of the details.

Best
 W.


--

Wolfgang Bangerth  email: bange...@colostate.edu
   www: http://www.math.colostate.edu/~bangerth/

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/be3be255-d6a0-bdbd-fb56-f46161fc0856%40colostate.edu.


[deal.II] Re: Python bindings

2022-04-19 Thread Bruno Turcksin
Corbin,

On Tuesday, April 19, 2022 at 3:04:39 PM UTC-4 corbin@gmail.com wrote:

> I've built deal.ii version 9.3.0 with the 
> -DDEAL_II_COMPONENT_PYTHON_BINDING=ON configuration, yet when I run the 
> notebook, the Jupyter kernel is unable to locate the PyDealII module, that 
> is, the notebook cell
>
> > import PyDealII.Release as dealii
>
> fails with an import error.
>
I havent' use the python binding in a while but you probably need to set 
the PYTHONPATH to where pydealii is located. You may also need to add the 
path to libdealii.so to LD_LIBRARY_PATH

Where is this library located, and how should I go about setting up a 
> (conda) environment to be able to use PyDealII? Are there dependencies?
>
The library should be located in the same directory where you installed 
deal.II. Look somewhere in /path/to/install/lib . I don't use conda so I 
can't help you with that. What kind of dependencies are you talking about? 
PyDealII only depends on deal.II and Boost.Python, nothing else

Best,

Bruno 

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/3f0a49b7-fe78-4bcb-8077-189051a6d926n%40googlegroups.com.


Re: [deal.II] simple application of anti-periodic boundary conditions

2022-04-19 Thread Paras Kumar
Dear Wolfgang,

Thank you for the hints. The second approach seems easy to start with.

One follow-up question: The mesh (which is initially periodic at the
boundaries)  is refined adaptively during the simulation and it cannot be
guaranteed if both the left and the right boundary faces would be refined
at the same time. Will make_periodicity_constraints() work in that case? If
yes, how would the periodic constraints look like for the child cell dofs?
In case it matters, I currently have a dealii::Triangulation and also wish
to update to p:d:T in future.

Going through step-45 and the docu of collect_periodic_faces(), it was not
clear to me what would happen for the case I described above.

Thanks and best regards,
Paras


On Thu, Apr 14, 2022 at 10:24 PM Wolfgang Bangerth 
wrote:

>
> Paras,
> I don't think there is a way that's already implemented, but if you look
> at
> the function that implements the periodic boundary conditions, you should
> be
> able to clone it in your project and add the negative sign where necessary.
>
> Alternatively, you can let the existing function create an AffineMatrix
> object, and then iterate over it to create a second such object that has
> the
> opposite sign.
>
> Best
>   W.
>
>
> On 4/14/22 11:28, Paras Kumar wrote:
> > *** Caution: EXTERNAL Sender ***
> >
> > Dear dealii Community,
> >
> > I am working on a solid mechanics related problem involving
> anti-periodic
> > constraints,  i.e.
> >
> > u_leftFace = - u_RightFace,
> >
> > where u is the unknown field (a component of the dim-dimensional
> displacement
> > field).
> >
> > One possible solution, I am aware of, involves marking the periodic
> faces by
> > means of boundary-ids, traversing through the dofs for each periodic
> face-pair
> > in order to determine the periodic dof pair and then manually add the
> entry in
> > the constraint matrix. This approach also worked for cases involving
> periodic
> > constraints with offsets.
> >
> > I would like to know if there exists a simpler way of achieving the
> > aforementioned goal by a simpler approach, probably by passing some
> > appropriate parameters to the make_periodicity_constraints() function,
> since
> > we just have a sign change here.
> >
> > Thanks and best regards,
> > Paras
> >
> > --
> > The deal.II project is located at http://www.dealii.org/
> > <
> https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.dealii.org%2F=04%7C01%7CWolfgang.Bangerth%40colostate.edu%7C8f9fc858ff034f0e15ef08da1e3c3094%7Cafb58802ff7a4bb1ab21367ff2ecfc8b%7C0%7C0%7C637855542161551806%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000=D5%2B%2Fl2JSIEzLD8yAQ0g8S4npa7iZJBXOm0RNWrcMpW0%3D=0
> >
> > For mailing list/forum options, see
> > https://groups.google.com/d/forum/dealii?hl=en
> > <
> https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fforum%2Fdealii%3Fhl%3Den=04%7C01%7CWolfgang.Bangerth%40colostate.edu%7C8f9fc858ff034f0e15ef08da1e3c3094%7Cafb58802ff7a4bb1ab21367ff2ecfc8b%7C0%7C0%7C637855542161551806%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000=sBAFfhzgWJFRRvlWTXcZSvJrGGwXyIgarIHw04NnhB4%3D=0
> >
> > ---
> > You received this message because you are subscribed to the Google
> Groups
> > "deal.II User Group" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an
> > email to dealii+unsubscr...@googlegroups.com
> > .
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/dealii/b2783034-32fe-43d0-80fa-5ace7204f6c0n%40googlegroups.com
> > <
> https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fdealii%2Fb2783034-32fe-43d0-80fa-5ace7204f6c0n%2540googlegroups.com%3Futm_medium%3Demail%26utm_source%3Dfooter=04%7C01%7CWolfgang.Bangerth%40colostate.edu%7C8f9fc858ff034f0e15ef08da1e3c3094%7Cafb58802ff7a4bb1ab21367ff2ecfc8b%7C0%7C0%7C637855542161551806%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000=DyeuUwE%2BH%2FQKzLAzF9lQhGU%2By4gvef3I%2FYUg%2FklzVJg%3D=0
> >.
>
>
> --
> 
> Wolfgang Bangerth  email: bange...@colostate.edu
> www: http://www.math.colostate.edu/~bangerth/
>
> --
> The deal.II project is located at http://www.dealii.org/
> For mailing list/forum options, see
> https://groups.google.com/d/forum/dealii?hl=en
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "deal.II User Group" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/dealii/Y82j-T65T00/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> dealii+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> 

[deal.II] Python bindings

2022-04-19 Thread Corbin Foucart
Hello everyone,

I'd like to write some custom Python bindings for deal.ii, and as a first 
step, I've been trying to reproduce the ipython notebook for step-49. 

I've built deal.ii version 9.3.0 with the 
-DDEAL_II_COMPONENT_PYTHON_BINDING=ON configuration, yet when I run the 
notebook, the Jupyter kernel is unable to locate the PyDealII module, that 
is, the notebook cell

> import PyDealII.Release as dealii

fails with an import error. Where is this library located, and how should I 
go about setting up a (conda) environment to be able to use PyDealII? Are 
there dependencies?

Any guidance would be appreciated!
Corbin

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/f2148581-7815-404c-b1f9-783026235308n%40googlegroups.com.


Re: [deal.II] Supported matrix/vector to LinearOperator

2022-04-19 Thread Jean-Paul Pelteret
Dear Chen,

Bruno pointed you to the exact example that I was going to. It is certainly 
possible to use linear operators as preconditioners for solvers.

It looks like support for TrilinosWrappers::SolverDirect has not yet been 
implemented:
https://github.com/dealii/dealii/blob/master/tests/lac/linear_operator_10.cc#L371-L414
 

I cannot recall what the reason was — maybe the class is simply missing some 
functions that are defined for the iterative solvers?

As for one of your early questions which Bruno did already answer: I must admit 
that I do not know if the PETSc linear algebra is compatible with linear 
operators. We had to write a special TrilinosPayload 

 for the Trilinos linear algebra classes in order for them to work correctly 
(with the Trilinos solvers, at least), and such a wrapper doesn’t exist for 
PETSc. But maybe it works just fine if you stick to the deal.II solvers? If you 
try this out, it would be interesting to know if it works or not.

Best,
J-P

> On 19. Apr 2022, at 17:27, Bruno Turcksin  wrote:
> 
> Chen,
> 
> I am not sure if TrilinosWrappers::SolverDirect is supported but for your 
> second point, you can use the linear_operator as a preconditioner. That's 
> exactly what's done here 
> 
>  for example. The preconditioner is wrapped in a LinearOperator and this 
> LinearOperator is then used as preconditioner.
> 
> Best,
> 
> Bruno
> 
> On Tuesday, April 19, 2022 at 10:39:17 AM UTC-4 hkch...@gmail.com 
>  wrote:
> Hi everyone,
> 
> More questions:
> 1. where can I find the supported linear solver of Trilinos of 
> linear_operator? TrilinosWrappers::SolverDirect seems not to be supported by 
> the linear_operator
> 2. Does linear_operator can be a preconditioner? for example, SparseMatrix A, 
> B, C, D, E, F; Matrix G=A-B*C^{-1}*D-E^{-1}*F; So Matrix G can only represent 
> by a linear_operator, not its entity. I want to get its inverse by 
> inverse_operator using some linear solvers as: PreconditionILU prec_G(op_G); 
> const auto op_G_inv = inverse_operator(G, Solver, prec_G); But it seems that 
> the precondition of linear_operator is not supported. Is there any solution?
> 
> best 
> Chen
> 
> 在2022年4月18日星期一 UTC+8 22:07:36 > 写道:
> Bruno Turcksin
> Thank you! it really helpful!
> 
> best
> chen
> 在2022年4月18日星期一 UTC+8 21:07:45> 写道:
> Chen,
> 
> Yes, LinearOperator does support Trilinos and PETSc matrices. LinearOperator 
> even supports your own matrix type as long as you define vmult and Tvmult 
> (see here 
> )
> 
> Best,
> 
> Bruno
> 
> On Monday, April 18, 2022 at 4:19:42 AM UTC-4 hkch...@gmail.com <> wrote:
> Hi everyone,
> 
> When solving a block matrix system, the LinearOperator is a useful tool. My 
> question is whether the LinearOpertor supports Matrix type (the same as the 
> Vector type) like PETSCWrapper::MPI::SparseMatrix or 
> TrilinosWrapper::MPI::SparseMatrix?
> 
> Best
> Chen
> 
> -- 
> The deal.II project is located at http://www.dealii.org/ 
> 
> For mailing list/forum options, see 
> https://groups.google.com/d/forum/dealii?hl=en 
> 
> --- 
> You received this message because you are subscribed to the Google Groups 
> "deal.II User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to dealii+unsubscr...@googlegroups.com 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/dealii/6ee40751-54ae-402d-903e-ae745545387bn%40googlegroups.com
>  
> .

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/3CCBC467-91F0-47CB-8F49-465FE5DB49E5%40gmail.com.


[deal.II] deal.II Newsletter #208

2022-04-19 Thread 'Rene Gassmoeller' via deal.II User Group
Hello everyone!

This is deal.II newsletter #208.
It automatically reports recently merged features and discussions about the 
deal.II finite element library.


## Below you find a list of recently proposed or merged features:

#13624: fixing typo of the type 'the the' (proposed by cdev911) 
https://github.com/dealii/dealii/pull/13624

#13621: Make DoFRenumbering::support_point_wise() about twice as fast. 
(proposed by drwells; merged) https://github.com/dealii/dealii/pull/13621

#13620: Update step-71.cc (proposed by cdev911) 
https://github.com/dealii/dealii/pull/13620

#13617: Using uint64_t as node variables for hdf5 output (proposed by singima) 
https://github.com/dealii/dealii/pull/13617

#13616: Discrete level let for quadrature generator (proposed by bergbauer) 
https://github.com/dealii/dealii/pull/13616

#13615: Draft: Quadrature generator with discrete levelset (proposed by 
bergbauer) https://github.com/dealii/dealii/pull/13615

#13614: fix bug in Assert() macro (proposed by tjhei; merged) 
https://github.com/dealii/dealii/pull/13614

#13612: fix a release mode warning (proposed by tjhei; merged) 
https://github.com/dealii/dealii/pull/13612

#13611: embed BigMPICompat library (proposed by tjhei) 
https://github.com/dealii/dealii/pull/13611

#13608: Introduce MGTransferBlockMatrixFreeBase (proposed by peterrum; merged) 
https://github.com/dealii/dealii/pull/13608

#13605: Generalize IsBlockVector (proposed by peterrum; merged) 
https://github.com/dealii/dealii/pull/13605

#13604: RPE: refactor determination of unique mapping and all points found 
(proposed by peterrum; merged) https://github.com/dealii/dealii/pull/13604

#13581: Update bundled muParser to 2.3.3 (proposed by drwells; merged) 
https://github.com/dealii/dealii/pull/13581


## And this is a list of recently opened or closed discussions:

#13623: Triangulation::has_hanging_nodes() logic is wrong in case of 
anisotropic refinement (opened) https://github.com/dealii/dealii/issues/13623

#13622: Resolution of identity constraints during 
FEEvaluation::read_dof_values_plain() (opened) 
https://github.com/dealii/dealii/issues/13622

#13619: How to visualize .vtu files from step-79? What software would be 
suitable? (opened and closed) https://github.com/dealii/dealii/issues/13619

#13618: Autodifferentiable numbers with the `SymmetricTensor` `eigenvectors` 
method fails for some number of zero entries (opened) 
https://github.com/dealii/dealii/issues/13618

#12986: Big MPI data type test fails (closed) 
https://github.com/dealii/dealii/issues/12986


A list of all major changes since the last release can be found at 
https://www.dealii.org/developer/doxygen/deal.II/recent_changes.html.


Thanks for being part of the community!


Let us know about questions, problems, bugs or just share your experience by 
writing to dealii@googlegroups.com, or by opening issues or pull requests at 
https://www.github.com/dealii/dealii.
Additional information can be found at https://www.dealii.org/.

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/625edcc3.1c69fb81.6da8a.72fdSMTPIN_ADDED_MISSING%40gmr-mx.google.com.


Re: [deal.II] Supported matrix/vector to LinearOperator

2022-04-19 Thread Bruno Turcksin
Chen,

I am not sure if TrilinosWrappers::SolverDirect is supported but for your 
second point, you can use the linear_operator as a preconditioner. That's 
exactly what's done here 

 
for example. The preconditioner is wrapped in a LinearOperator and this 
LinearOperator is then used as preconditioner.

Best,

Bruno

On Tuesday, April 19, 2022 at 10:39:17 AM UTC-4 hkch...@gmail.com wrote:

> Hi everyone,
>
> More questions:
> 1. where can I find the supported linear solver of Trilinos of 
> linear_operator? TrilinosWrappers::SolverDirect seems not to be supported 
> by the linear_operator
> 2. Does linear_operator can be a preconditioner? for example, 
> SparseMatrix A, B, C, D, E, F; Matrix G=A-B*C^{-1}*D-E^{-1}*F; So Matrix 
> G can only represent by a linear_operator, not its entity. I want to get 
> its inverse by inverse_operator using some linear solvers as: PreconditionILU 
> prec_G(op_G); const auto op_G_inv = inverse_operator(G, Solver, prec_G); But 
> it seems that the precondition of linear_operator is not supported. Is 
> there any solution?
>
> best 
> Chen
>
> 在2022年4月18日星期一 UTC+8 22:07:36 写道:
>
>> Bruno Turcksin
>> Thank you! it really helpful!
>>
>> best
>> chen
>> 在2022年4月18日星期一 UTC+8 21:07:45 写道:
>>
>>> Chen,
>>>
>>> Yes, LinearOperator does support Trilinos and PETSc matrices. 
>>> LinearOperator even supports your own matrix type as long as you define 
>>> vmult and Tvmult (see here 
>>> 
>>> )
>>>
>>> Best,
>>>
>>> Bruno
>>>
>>> On Monday, April 18, 2022 at 4:19:42 AM UTC-4 hkch...@gmail.com wrote:
>>>
 Hi everyone,

 When solving a block matrix system, the LinearOperator is a useful 
 tool. My question is whether the LinearOpertor supports Matrix type (the 
 same as the Vector type) like PETSCWrapper::MPI::SparseMatrix or 
 TrilinosWrapper::MPI::SparseMatrix?

 Best
 Chen

>>>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/6ee40751-54ae-402d-903e-ae745545387bn%40googlegroups.com.


Re: [deal.II] Issue using component_wise()

2022-04-19 Thread Hermes Sampedro
Dear Wolfgang, 
That is totally right, thank you very much for the suggestions.

Regards, 
Hermes

El martes, 19 de abril de 2022 a las 17:02:31 UTC+2, Wolfgang Bangerth 
escribió:

> On 4/19/22 08:39, Hermes Sampedro wrote:
> > 
> > Thank you, could you please suggest me one in particular?
>
> Hermes -- they are not actually very difficult to find. Take a look at
> https://dealii.org/developer/doxygen/deal.II/namespaceDoFTools.html
> and then just read the section headings for different groups of functions. 
> There is one group that is called "Identifying subsets of degrees of 
> freedom 
> with particular properties"; that would be a good place to start.
>
> We put a lot of work into writing documentation. It's up to you to make 
> use of it.
>
> Best
> W.
>
> -- 
> 
> Wolfgang Bangerth email: bang...@colostate.edu
> www: http://www.math.colostate.edu/~bangerth/
>
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/7c117265-e761-48a3-8e75-4b87595eac5en%40googlegroups.com.


Re: [deal.II] Issue using component_wise()

2022-04-19 Thread Wolfgang Bangerth

On 4/19/22 08:39, Hermes Sampedro wrote:


Thank you, could you please suggest me one in particular?


Hermes -- they are not actually very difficult to find. Take a look at
  https://dealii.org/developer/doxygen/deal.II/namespaceDoFTools.html
and then just read the section headings for different groups of functions. 
There is one group that is called "Identifying subsets of degrees of freedom 
with particular properties"; that would be a good place to start.


We put a lot of work into writing documentation. It's up to you to make use of 
it.

Best
 W.

--

Wolfgang Bangerth  email: bange...@colostate.edu
   www: http://www.math.colostate.edu/~bangerth/

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/142cea01-a832-f6dd-ee4b-c19118980b96%40colostate.edu.


Re: [deal.II] Issue using component_wise()

2022-04-19 Thread Hermes Sampedro
Dear Wolfgang, 

Thank you, could you please suggest me one in particular?

Regards
H

El martes, 19 de abril de 2022 a las 16:28:04 UTC+2, Wolfgang Bangerth 
escribió:

> On 4/19/22 08:05, Hermes Sampedro wrote:
> > 
> > I have not been able to find the issue. I am considering looking for an 
> > alternative. I am using 2 components to describe a complex solution (for 
> real 
> > and imaginary parts). Assuming that I keep the ordering by default and 
> that I 
> > export my solution vector (to work in an external software), what I need 
> in 
> > the end is to know for each value of the solution vector, if it 
> corresponds to 
> > the real or imaginary part. I realized by debugging that the order is 
> not 
> > consistent and it changes depending on the number of dof.
> > I would like to ask if there is any function or if you could suggest a 
> way to 
> > get the vector that contains information about the component type for 
> each 
> > node (for example a mask type, where 0 is real and 1 imaginary 
> component). The 
> > way I implemented and managed the components, assembly, etc is identical 
> to 
> > the one described in step-29.
>
> Yes, there are a number of functions in namespace DoFTools that you can 
> use to 
> extract the indices of DoFs based on their vector component.
>
> Best
> W.
>
> -- 
> 
> Wolfgang Bangerth email: bang...@colostate.edu
> www: http://www.math.colostate.edu/~bangerth/
>
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/5dc1b028-a6b1-4c8c-9939-cc8a540f9c2fn%40googlegroups.com.


Re: [deal.II] Supported matrix/vector to LinearOperator

2022-04-19 Thread hkch...@gmail.com
Hi everyone,

More questions:
1. where can I find the supported linear solver of Trilinos of 
linear_operator? TrilinosWrappers::SolverDirect seems not to be supported 
by the linear_operator
2. Does linear_operator can be a preconditioner? for example, SparseMatrix 
A, B, C, D, E, F; Matrix G=A-B*C^{-1}*D-E^{-1}*F; So Matrix G can only 
represent by a linear_operator, not its entity. I want to get its inverse 
by inverse_operator using some linear solvers as: PreconditionILU 
prec_G(op_G); const auto op_G_inv = inverse_operator(G, Solver, prec_G); But 
it seems that the precondition of linear_operator is not supported. Is 
there any solution?

best 
Chen

在2022年4月18日星期一 UTC+8 22:07:36 写道:

> Bruno Turcksin
> Thank you! it really helpful!
>
> best
> chen
> 在2022年4月18日星期一 UTC+8 21:07:45 写道:
>
>> Chen,
>>
>> Yes, LinearOperator does support Trilinos and PETSc matrices. 
>> LinearOperator even supports your own matrix type as long as you define 
>> vmult and Tvmult (see here 
>> 
>> )
>>
>> Best,
>>
>> Bruno
>>
>> On Monday, April 18, 2022 at 4:19:42 AM UTC-4 hkch...@gmail.com wrote:
>>
>>> Hi everyone,
>>>
>>> When solving a block matrix system, the LinearOperator is a useful tool. 
>>> My question is whether the LinearOpertor supports Matrix type (the same as 
>>> the Vector type) like PETSCWrapper::MPI::SparseMatrix or 
>>> TrilinosWrapper::MPI::SparseMatrix?
>>>
>>> Best
>>> Chen
>>>
>>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/f2bc8f82-6d9e-456e-b15f-c9a32f35721cn%40googlegroups.com.


Re: [deal.II] Issue using component_wise()

2022-04-19 Thread Wolfgang Bangerth

On 4/19/22 08:05, Hermes Sampedro wrote:


I have not been able to find the issue. I am considering looking for an 
alternative. I am using 2 components to describe a complex solution (for real 
and imaginary parts). Assuming that I keep the ordering by default and that I 
export my solution vector (to work in an external software), what I need in 
the end is to know for each value of the solution vector, if it corresponds to 
the real or imaginary part. I realized by debugging that the order is not 
consistent and it changes depending on the number of dof.
I would like to ask if there is any function or if you could suggest a way to 
get the vector that contains information about the component type for each 
node (for example a mask type, where 0 is real and 1 imaginary component). The 
way I implemented and managed the components, assembly, etc is identical to 
the one described in step-29.


Yes, there are a number of functions in namespace DoFTools that you can use to 
extract the indices of DoFs based on their vector component.


Best
 W.

--

Wolfgang Bangerth  email: bange...@colostate.edu
   www: http://www.math.colostate.edu/~bangerth/

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/a2aa58a5-47f1-17bd-b876-be89968fd5ee%40colostate.edu.


Re: [deal.II] Supported matrix/vector to LinearOperator

2022-04-19 Thread hkch...@gmail.com
One more question: where I can find the support linear solver of Trilinos 
of linear_operator? TrilinosWrappers::SolverDirect seem not be supported by 
the linear_operator

best 
chen 

在2022年4月18日星期一 UTC+8 22:07:36 写道:

> Bruno Turcksin
> Thank you! it really helpful!
>
> best
> chen
> 在2022年4月18日星期一 UTC+8 21:07:45 写道:
>
>> Chen,
>>
>> Yes, LinearOperator does support Trilinos and PETSc matrices. 
>> LinearOperator even supports your own matrix type as long as you define 
>> vmult and Tvmult (see here 
>> 
>> )
>>
>> Best,
>>
>> Bruno
>>
>> On Monday, April 18, 2022 at 4:19:42 AM UTC-4 hkch...@gmail.com wrote:
>>
>>> Hi everyone,
>>>
>>> When solving a block matrix system, the LinearOperator is a useful tool. 
>>> My question is whether the LinearOpertor supports Matrix type (the same as 
>>> the Vector type) like PETSCWrapper::MPI::SparseMatrix or 
>>> TrilinosWrapper::MPI::SparseMatrix?
>>>
>>> Best
>>> Chen
>>>
>>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/b517b246-0747-44d0-a65c-bdfefb8eab47n%40googlegroups.com.


Re: [deal.II] Issue using component_wise()

2022-04-19 Thread Hermes Sampedro
Dear Wolfgang, 

I have not been able to find the issue. I am considering looking for an 
alternative. I am using 2 components to describe a complex solution (for 
real and imaginary parts). Assuming that I keep the ordering by default and 
that I export my solution vector (to work in an external software), what I 
need in the end is to know for each value of the solution vector, if it 
corresponds to the real or imaginary part. I realized by debugging that the 
order is not consistent and it changes depending on the number of dof.
I would like to ask if there is any function or if you could suggest a way 
to get the vector that contains information about the component type for 
each node (for example a mask type, where 0 is real and 1 imaginary 
component). The way I implemented and managed the components, assembly, etc 
is identical to the one described in step-29.

I would really appreciate your help on this matter.
Thank you very much.
Regards
Hermes


El martes, 5 de abril de 2022 a las 16:41:49 UTC+2, Wolfgang Bangerth 
escribió:

> On 4/5/22 04:47, Hermes Sampedro wrote:
> > 
> > Now I am trying to order the dof according to the components. However, I 
> am 
> > experiencing that when using /DoFRenumbering::component_wise/ and 
> running with 
> > more than 1 MPI rank, my solution vector has inf values. Which, does not 
> > happen when using only 1 process, or using the default dof ordering. I 
> am not 
> > sure where the problem could be. May I ask for some suggestions to see 
> if I 
> > can identify where the issue can be?
>
> This is an excellent problem to check your debugging skills. It *may* of 
> course be related in some way to the renumbering, but there appears to be 
> no 
> logical connection between the two. On the other hand, it is easy to check 
> for 
> the presence of inf values (for example, by outputting the norm of a 
> vector). 
> There are two ways for inf values to appear in the solution vector: The 
> right 
> hand side vector has inf values, or the iterative solver does not 
> converge. 
> Both are easy enough to test. If it's the solver, you need to figure out 
> why 
> that is.
>
> Best
> W.
>
> -- 
> 
> Wolfgang Bangerth email: bang...@colostate.edu
> www: http://www.math.colostate.edu/~bangerth/
>
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/39dd3a68-2785-4076-aa94-3f372e9c84a2n%40googlegroups.com.


Re: [deal.II] Issues with step-1 and step-2

2022-04-19 Thread Wolfgang Bangerth

On 4/19/22 04:52, ankit tyagi wrote:
Thank you so much. I think I got it now. Just one last thing. If the output 
stops plotting the parent edge, and plots only the child edges, the visual 
discrepancy can be avoided. Right? Will that be a problem in some other way?


Yes, one could only show the child edges. That would avoid the graphical 
confusion, but they too are not a true depiction of what is happening 
internally, and it would make the large cell look like a pentagon. I think 
that there is no good solution.


But if you wanted to implement an option for only showing the small edges, we 
would gladly accept a patch!


Best
 W.

--

Wolfgang Bangerth  email: bange...@colostate.edu
   www: http://www.math.colostate.edu/~bangerth/

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/f4042696-339d-91ae-7bbd-a54efa84e226%40colostate.edu.


Re: [deal.II] Issues with step-1 and step-2

2022-04-19 Thread ankit tyagi
Thank you so much. I think I got it now. Just one last thing. If the output 
stops plotting the parent edge, and plots only the child edges, the visual 
discrepancy can be avoided. Right? Will that be a problem in some other 
way? 

On Tuesday, April 19, 2022 at 1:31:25 AM UTC+5:30 Wolfgang Bangerth wrote:

> On 4/18/22 12:42, ankit tyagi wrote:
> > Sorry for pestering you, but why does this not happen in 
> > "grid-2-single-refine.svg" and "grid-3-coarse.svg"?
>
> Neither of these have hanging nodes on circumferential edges. The 
> problem only happens because (i) the output plots both the parent and 
> child edges, (ii) edges are shown as straight lines even though 
> internally that is not guaranteed to be so, (iii) for circumferential 
> edges, the edges really are curved, and so the midpoint of the parent 
> edge is not actually at the midpoint of the straight line shown.
>
> Best
> W.
>
> -- 
> 
> Wolfgang Bangerth email: bang...@colostate.edu
> www: http://www.math.colostate.edu/~bangerth/
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/846676d6-0cb9-4fd7-bc72-6d614b1ab431n%40googlegroups.com.