@@ -447,7 +447,7 @@ void piDoMUS<dim, spacedim, LAC>::setup_dofs (const bool &first_run)
447447 *dof_handler,
448448 constraints,
449449 interface.get_matrix_coupling (i));
450- matrices[i]-> reinit ( *matrix_sparsities[i]);
450+ initializer (* matrices[i], *matrix_sparsities[i]);
451451 }
452452
453453 if (first_run)
@@ -681,6 +681,7 @@ void piDoMUS<dim, spacedim, LAC>::assemble_matrices (const double t,
681681
682682/* ------------------------ MESH AND GRID ------------------------ */
683683
684+ #ifdef DEAL_II_WITH_TRILINOS
684685template <int dim, int spacedim, typename LAC>
685686void piDoMUS<dim, spacedim, LAC>::
686687refine_and_transfer_solutions (LATrilinos::VectorType &y,
@@ -742,6 +743,56 @@ refine_and_transfer_solutions(LATrilinos::VectorType &y,
742743
743744 signals.end_refine_and_transfer_solutions ();
744745}
746+ #endif // DEAL_II_WITH_TRILINOS
747+
748+ #ifdef DEAL_II_WITH_PETSC
749+ template <int dim, int spacedim, typename LAC>
750+ void piDoMUS<dim, spacedim, LAC>::
751+ refine_and_transfer_solutions (LAPETSc::VectorType &y,
752+ LAPETSc::VectorType &y_dot,
753+ LAPETSc::VectorType &y_expl,
754+ LAPETSc::VectorType &distributed_y,
755+ LAPETSc::VectorType &distributed_y_dot,
756+ LAPETSc::VectorType &distributed_y_expl,
757+ bool adaptive_refinement)
758+ {
759+ distributed_y = y;
760+ distributed_y_dot = y_dot;
761+ distributed_y_expl = y_expl;
762+
763+ parallel::distributed::SolutionTransfer<dim, LAPETSc::VectorType, DoFHandler<dim,spacedim> > sol_tr (*dof_handler);
764+
765+ std::vector<const LAPETSc::VectorType *> old_sols (3 );
766+ old_sols[0 ] = &distributed_y;
767+ old_sols[1 ] = &distributed_y_dot;
768+ old_sols[2 ] = &distributed_y_expl;
769+
770+ triangulation->prepare_coarsening_and_refinement ();
771+ sol_tr.prepare_for_coarsening_and_refinement (old_sols);
772+
773+ if (adaptive_refinement)
774+ triangulation->execute_coarsening_and_refinement ();
775+ else
776+ triangulation->refine_global (1 );
777+
778+ setup_dofs (false );
779+
780+ LAPETSc::VectorType new_sol (y);
781+ LAPETSc::VectorType new_sol_dot (y_dot);
782+ LAPETSc::VectorType new_sol_expl (y_expl);
783+
784+ std::vector<LAPETSc::VectorType *> new_sols (3 );
785+ new_sols[0 ] = &new_sol;
786+ new_sols[1 ] = &new_sol_dot;
787+ new_sols[2 ] = &new_sol_expl;
788+
789+ sol_tr.interpolate (new_sols);
790+
791+ y = new_sol;
792+ y_dot = new_sol_dot;
793+ y_expl = new_sol_expl;
794+ }
795+ #endif // DEAL_II_WITH_PETSC
745796
746797template <int dim, int spacedim, typename LAC>
747798void piDoMUS<dim, spacedim, LAC>::
@@ -1279,7 +1330,6 @@ piDoMUS<dim, spacedim, LAC>::set_constrained_dofs_to_zero(typename LAC::VectorTy
12791330 }
12801331}
12811332
1282-
12831333template <int dim, int spacedim, typename LAC>
12841334void
12851335piDoMUS<dim, spacedim, LAC>::get_lumped_mass_matrix(typename LAC::VectorType &dst) const
@@ -1351,11 +1401,18 @@ piDoMUS<dim, spacedim, LAC>::get_lumped_mass_matrix(typename LAC::VectorType &ds
13511401
13521402}
13531403
1404+ #ifdef DEAL_II_WITH_TRILINOS
13541405template class piDoMUS <2 , 2 , LATrilinos>;
13551406template class piDoMUS <2 , 3 , LATrilinos>;
13561407template class piDoMUS <3 , 3 , LATrilinos>;
1408+ #endif // DEAL_II_WITH_TRILINOS
13571409
13581410template class piDoMUS <2 , 2 , LADealII>;
13591411template class piDoMUS <2 , 3 , LADealII>;
13601412template class piDoMUS <3 , 3 , LADealII>;
13611413
1414+ #ifdef DEAL_II_WITH_PETSC
1415+ template class piDoMUS <2 , 2 , LAPETSc>;
1416+ template class piDoMUS <2 , 3 , LAPETSc>;
1417+ template class piDoMUS <3 , 3 , LAPETSc>;
1418+ #endif // DEAL_II_WITH_PETSC
0 commit comments