Hussein, There are certainly some advantages to use a template for the vector type, mostly because it allows you try out multiple but I wouldn't be surprised if you settle on one or the other in the end. There really isn't much of a difference using the approach taken in step-40 via preprocessor guarded alias namespaces or via templates. I would probably go with templates, though, since that feels more natural for C++. I wouldn't expect much of a compile time overhead either way. In the end, you only compile what you use.
Best, Daniel On Fri, Feb 21, 2025 at 6:48 AM Hussein Shaito <husseinshait...@gmail.com> wrote: > > Dear community, > > I am trying to write a solver and I want to support both trillinos and petsc > vectors at runtime. > I am doing this by having the vector type as a class template for my solver. > Since you guys are more experienced than I am, is there a disadvantage for > this approach? Will this bloat my compile time if my code grows? Would anyone > recommend something else? > I know I can do an #ifdef for either pets. and trilinos like in step40 and > compile but I would still want to know what you guys suggest. > > Best regards, > Hussein. > > -- > 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 visit > https://groups.google.com/d/msgid/dealii/1fa81747-f79f-4e6b-887a-d624f7acd306n%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 visit https://groups.google.com/d/msgid/dealii/CAOYDWb%2BOipBeYb4usC04rFyB1iLyvTYAdHvQ25YZU5Ocnc3Zzw%40mail.gmail.com.