31 #include <deal2lkit/parsed_grid_generator.h>
32 #include <deal2lkit/parsed_finite_element.h>
33 #include <deal2lkit/parsed_grid_refinement.h>
34 #include <deal2lkit/error_handler.h>
35 #include <deal2lkit/parsed_function.h>
36 #include <deal2lkit/parsed_data_out.h>
37 #include <deal2lkit/parameter_acceptor.h>
38 #include <deal2lkit/sundials_interface.h>
39 #include <deal2lkit/ida_interface.h>
40 #include <deal2lkit/imex_stepper.h>
42 #include <deal2lkit/any_data.h>
43 #include <deal2lkit/fe_values_cache.h>
52 template <
int dim,
int spacedim = dim,
typename LAC = LATrilinos>
53 class piDoMUS :
public ParameterAcceptor,
public SundialsInterface<typename LAC::VectorType>
58 template<
int fdim,
int fspacedim,
typename fn_LAC>
64 piDoMUS (
const std::string &name,
65 const BaseInterface<dim, spacedim, LAC> &energy,
66 const MPI_Comm &comm = MPI_COMM_WORLD);
69 virtual void parse_parameters_call_back();
77 virtual shared_ptr<typename LAC::VectorType>
78 create_new_vector()
const;
81 virtual unsigned int n_dofs()
const;
87 virtual void output_step(
const double t,
90 const unsigned int step_number,
98 virtual bool solver_should_restart(
const double t,
99 const unsigned int step_number,
106 virtual int residual(
const double t,
112 virtual int setup_jacobian(
const double t,
120 virtual int solve_jacobian_system(
const double t,
146 void update_functions_and_constraints(
const double &t);
167 FEValuesCache<dim,spacedim> &scratch,
168 std::vector<double> &local_residual)
const;
181 FEValuesCache<dim,spacedim> &scratch,
182 std::vector<double> &local_residual)
const;
188 void setup_dofs (
const bool &first_run =
true);
190 void assemble_matrices (
const double t,
200 bool adaptive_refinement);
207 bool adaptive_refinement);
212 const MPI_Comm &comm;
213 const BaseInterface<dim, spacedim, LAC> &interface;
215 unsigned int n_cycles;
216 unsigned int current_cycle;
217 unsigned int initial_global_refinement;
218 unsigned int max_time_iterations;
220 std::string timer_file_name;
223 std::ofstream timer_outfile;
227 shared_ptr<parallel::distributed::Triangulation<dim, spacedim> > triangulation;
228 shared_ptr<FiniteElement<dim, spacedim> > fe;
229 shared_ptr<DoFHandler<dim, spacedim> > dof_handler;
246 ParsedDataOut<dim, spacedim> data_out;
248 const unsigned int n_matrices;
249 std::vector<shared_ptr<typename LAC::BlockSparsityPattern> > matrix_sparsities;
250 std::vector<shared_ptr<typename LAC::BlockMatrix> > matrices;
253 ParsedGridGenerator<dim, spacedim> pgg;
254 ParsedGridRefinement pgr;
256 ParsedFunction<spacedim> exact_solution;
258 ParsedFunction<spacedim> initial_solution;
259 ParsedFunction<spacedim> initial_solution_dot;
262 mutable ParsedMappedFunctions<spacedim> forcing_terms;
263 mutable ParsedMappedFunctions<spacedim> neumann_bcs;
264 mutable ParsedDirichletBCs<dim,spacedim> dirichlet_bcs;
265 mutable ParsedDirichletBCs<dim,spacedim> dirichlet_bcs_dot;
269 IDAInterface<typename LAC::VectorType> ida;
270 IMEXStepper<typename LAC::VectorType> euler;
273 std::vector<types::global_dof_index> dofs_per_block;
275 std::vector<IndexSet> partitioning;
276 std::vector<IndexSet> relevant_partitioning;
278 bool adaptive_refinement;
279 const bool we_are_parallel;
280 bool use_direct_solver;
286 double jacobian_solver_tolerance;
301 std::string time_stepper;
ActiveSelector::active_cell_iterator active_cell_iterator
Definition: copy_data.h:18
void run(const std::vector< std::vector< Iterator > > &colored_iterators, Worker worker, Copier copier, const ScratchData &sample_scratch_data, const CopyData &sample_copy_data, const unsigned int queue_length=2 *MultithreadInfo::n_threads(), const unsigned int chunk_size=8)