/home/runner/work/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/discretization/FEM/assembler/dg.hh Source File#
|
DiFfRG
Discretization Framework for functional Renormalization Group flows
|
dg.hh
Go to the documentation of this file.
22 return named_tuple<std::tuple<T &...>, StringSet<"fe_functions", "extractors", "variables", "cell_width">>(
28 return named_tuple<std::tuple<T &...>, StringSet<"fe_functions", "fe_derivatives", "fe_hessians">>(
198 reinit_la_vector(vec, discretization.get_locally_owned_dofs(), discretization.get_communicator());
202 reinit_la_matrix(matrix, get_sparsity_pattern_jacobian(), discretization.get_locally_owned_dofs(),
206 virtual MPI_Comm get_communicator() const override { return discretization.get_communicator(); }
209 view.reinit(discretization.get_locally_owned_dofs(), discretization.get_locally_relevant_dofs(),
224 finalize_la_sparsity<SparseMatrixType>(dsp, sparsity_pattern_mass, discretization.get_locally_owned_dofs(),
229 MatrixCreator::create_mass_matrix(dof_handler, quadrature, mass_matrix, (Function<dim, NumberType> *)nullptr,
254 finalize_la_sparsity<SparseMatrixType>(dsp, sparsity_pattern_jacobian, discretization.get_locally_owned_dofs(),
259 virtual const get_type::SparsityPattern<SparseMatrixType> &get_sparsity_pattern_jacobian() const override
271 virtual void refinement_indicator(Vector<double> &indicator, const VectorType &solution_global) override
277 const auto cell_worker = [&](const Iterator &t_cell, Scratch &scratch_data, CopyData ©_data) {
304 const auto face_worker = [&](const Iterator &t_cell, const uint &f, const uint &sf, const Iterator &t_ncell,
358 update_values | update_gradients | update_quadrature_points | update_JxW_values | update_hessians;
359 const UpdateFlags interface_update_flags = update_values | update_gradients | update_quadrature_points |
362 Scratch scratch_data(mapping, fe, quadrature, quadrature_face, update_flags, interface_update_flags);
377 MeshWorker::mesh_loop(locally_owned_cells(dof_handler), cell_worker, copier, scratch_data, copy_data,
381 virtual void mass(VectorType &mass, const VectorType &solution_global, const VectorType &solution_global_dot,
389 const auto cell_worker = [&](const Iterator &cell, Scratch &scratch_data, CopyData ©_data) {
430 MeshWorker::mesh_loop(locally_owned_cells(dof_handler), cell_worker, copier, scratch_data, copy_data, flags,
439 virtual void residual(VectorType &residual, const VectorType &solution_global, NumberType weight,
454 const auto cell_worker = [&](const Iterator &cell, Scratch &scratch_data, CopyData ©_data) {
494 const auto boundary_worker = [&](const Iterator &cell, const uint &face_no, Scratch &scratch_data,
523 scalar_product(numflux[component_i], normals[q_index])); // phi_i(x_q) * numflux(x_q, u_q) * n(x_q)
527 const auto face_worker = [&](const Iterator &cell, const uint &f, const uint &sf, const Iterator &ncell,
586 MeshWorker::AssembleFlags flags = MeshWorker::assemble_own_cells | MeshWorker::assemble_boundary_faces |
594 MeshWorker::mesh_loop(locally_owned_cells(dof_handler), cell_worker, copier, scratch_data, copy_data, flags,
613 const auto cell_worker = [&](const Iterator &cell, Scratch &scratch_data, CopyData ©_data) {
661 MeshWorker::mesh_loop(locally_owned_cells(dof_handler), cell_worker, copier, scratch_data, copy_data, flags,
671 virtual void jacobian(SparseMatrixType &jacobian, const VectorType &solution_global, NumberType weight,
689 const auto cell_worker = [&](const Iterator &cell, Scratch &scratch_data, CopyData ©_data) {
721 j_extr_flux, j_extr_source, x_q, fe_tie(solution[q_index], extracted_data, variables, cell_width));
751 const auto boundary_worker = [&](const Iterator &cell, const uint &face_no, Scratch &scratch_data,
764 SimpleMatrix<Tensor<1, dim>, n_components, Components::count_extractors()> j_extr_boundary_numflux;
786 weight * JxW[q_index] * fe_fv.shape_value_component(j, q_index, component_j) * // dx * phi_j(x_q)
802 const auto face_worker = [&](const Iterator &cell, const uint &f, const uint &sf, const Iterator &ncell,
840 array<SimpleMatrix<Tensor<1, dim>, n_components, Components::count_extractors()>, 2> j_extr_numflux;
884 FullMatrix<NumberType> extractor_dependence(cdf.joint_dof_indices.size(), extractor_dof_indices.size());
886 constraints.distribute_local_to_global(extractor_dependence, cdf.joint_dof_indices, extractor_dof_indices,
891 FullMatrix<NumberType> extractor_dependence(c.local_dof_indices.size(), extractor_dof_indices.size());
893 constraints.distribute_local_to_global(extractor_dependence, c.local_dof_indices, extractor_dof_indices,
900 MeshWorker::AssembleFlags flags = MeshWorker::assemble_own_cells | MeshWorker::assemble_boundary_faces |
908 MeshWorker::mesh_loop(locally_owned_cells(dof_handler), cell_worker, copier, scratch_data, copy_data, flags,
A hierarchical configuration tree, readable from JSON and TOML files.
Definition config_tree.hh:32
The basic assembler that can be used for any standard DG scheme with flux and source.
Definition dg.hh:174
virtual void reinit_matrix(SparseMatrixType &matrix) const override
Definition dg.hh:200
double average_time_residual_assembly() const
Definition dg.hh:936
double average_time_jacobian_assembly() const
Definition dg.hh:946
virtual void reinit() override
Reinitialize the assembler. This is necessary if the mesh has changed, e.g. after a mesh refinement.
Definition dg.hh:213
virtual const SparseMatrixType & get_mass_matrix() const override
Obtain the mass matrix.
Definition dg.hh:263
virtual void mass(VectorType &mass, const VectorType &solution_global, const VectorType &solution_global_dot, NumberType weight) override
Definition dg.hh:381
get_type::SparsityPattern< SparseMatrixType > sparsity_pattern_jacobian
Definition dg.hh:968
virtual MPI_Comm get_communicator() const override
The communicator this assembler's linear algebra lives on.
Definition dg.hh:206
Assembler(Discretization &discretization, Model &model, const ConfigTree &config)
Definition dg.hh:187
virtual void jacobian(SparseMatrixType &jacobian, const VectorType &solution_global, NumberType weight, const VectorType &solution_global_dot, NumberType alpha, NumberType beta, const VectorType &variables=VectorType()) override
Definition dg.hh:671
typename Discretization::SparseMatrixType SparseMatrixType
Definition dg.hh:182
virtual void rebuild_jacobian_sparsity() override
Definition dg.hh:245
virtual void refinement_indicator(Vector< double > &indicator, const VectorType &solution_global) override
refinement indicator for adaptivity. Calls the model's cell_indicator and face_indicator functions.
Definition dg.hh:271
virtual void residual(VectorType &residual, const VectorType &solution_global, NumberType weight, const VectorType &solution_global_dot, NumberType weight_mass, const VectorType &variables=VectorType()) override
Definition dg.hh:439
virtual void jacobian_mass(SparseMatrixType &jacobian, const VectorType &solution_global, const VectorType &solution_global_dot, NumberType alpha=1., NumberType beta=1.) override
Definition dg.hh:604
virtual void reinit_solution_view(SolutionView< VectorType > &view) const override
Definition dg.hh:207
std::vector< types::global_dof_index > extractor_dof_indices
Definition common.hh:463
virtual const get_type::SparsityPattern< SparseMatrixType > & get_sparsity_pattern_jacobian() const override
Obtain the sparsity pattern of the jacobian matrix.
Definition dg.hh:259
get_type::SparsityPattern< SparseMatrixType > sparsity_pattern_mass
Definition dg.hh:967
AssemblySchedule schedule_for(const double cost_ns) const
The mesh_loop schedule for a loop whose cell worker costs cost_ns nanoseconds.
Definition common.hh:418
virtual void reinit_vector(VectorType &vec) const override
Definition dg.hh:196
typename DiFfRG::internal::components_of< ModelOrComponents_ >::type Components
Definition dg.hh:48
The basic assembler that can be used for any standard CG scheme with flux and source.
Definition common.hh:42
FullMatrix< NumberType > extractor_jacobian
Definition common.hh:459
void extract(std::array< NumberType, Components::count_extractors()> &data, const VectorType &solution_global, const VectorType &variables, bool search_EoM, bool set_EoM, bool postprocess) const
Definition common.hh:274
bool jacobian_extractors(FullMatrix< NumberType > &extractor_jacobian, const VectorType &solution_global, const VectorType &variables)
Definition common.hh:302
virtual void reinit() override
Reinitialize the assembler. This is necessary if the mesh has changed, e.g. after a mesh refinement.
Definition common.hh:116
std::vector< types::global_dof_index > extractor_dof_indices
Definition common.hh:463
AssemblySchedule schedule_for(const double cost_ns) const
The mesh_loop schedule for a loop whose cell worker costs cost_ns nanoseconds.
Definition common.hh:418
Decides, without any user input, which rank computes which part of each map().
Definition map_scheduler.hh:195
A simple NxM-matrix class, which is used for cell-wise Jacobians.
Definition tuples.hh:170
A read-only, fully-replicated view of the solution.
Definition solution_view.hh:48
void reinit(const dealii::IndexSet &, const dealii::IndexSet &, MPI_Comm)
Establish the layout. No-op for the serial policy.
Definition solution_view.hh:58
All compile-time knowledge about which linear algebra types DiFfRG uses.
constexpr double local_fe
Local FE work only: mass matrices, refinement indicators. ~0.2-0.3 us/cell for CG p=3.
Definition assembly_schedule.hh:48
constexpr double momentum_integral
Definition assembly_schedule.hh:53
typename internal::_SparsityPattern< SparseMatrixType >::value SparsityPattern
Definition linear_algebra.hh:155
double cell_width(const CellIterator &cell)
The smallest face-normal width over all faces of cell.
Definition cell_geometry.hh:42
Definition complex_math.hh:10
auto locally_owned_cells(const dealii::DoFHandler< dim > &dof_handler)
The cells this rank assembles.
Definition assembly_schedule.hh:154
void reinit_la_matrix(SparseMatrixType &matrix, const get_type::SparsityPattern< SparseMatrixType > &pattern, const dealii::IndexSet &locally_owned, MPI_Comm comm)
Size a matrix from a finalized sparsity pattern.
Definition la_policy.hh:92
void reinit_la_vector(VectorType &vec, const dealii::IndexSet &locally_owned, MPI_Comm comm)
Size a vector to the rank's share of the rows.
Definition la_policy.hh:27
void finalize_la_sparsity(dealii::DynamicSparsityPattern &dsp, get_type::SparsityPattern< SparseMatrixType > &pattern, const dealii::IndexSet &locally_owned, const dealii::IndexSet &locally_relevant, MPI_Comm comm)
Turn a freshly built DynamicSparsityPattern into the pattern type the matrix wants.
Definition la_policy.hh:50
Definition dg.hh:156
std::array< uint, 2 > cell_indices
Definition dg.hh:157
std::array< double, 2 > values
Definition dg.hh:158
Definition dg.hh:155
std::vector< CopyFaceData_I > face_data
Definition dg.hh:160
Definition dg.hh:124
void reinit(const FEInterfaceValues< dim > &fe_iv, uint n_extractors)
Definition dg.hh:129
FullMatrix< NumberType > extractor_cell_jacobian
Definition dg.hh:126
FullMatrix< NumberType > cell_jacobian
Definition dg.hh:125
std::vector< types::global_dof_index > joint_dof_indices
Definition dg.hh:127
Definition dg.hh:123
FullMatrix< NumberType > cell_mass_jacobian
Definition dg.hh:140
std::vector< types::global_dof_index > local_dof_indices
Definition dg.hh:141
FullMatrix< NumberType > extractor_cell_jacobian
Definition dg.hh:139
FullMatrix< NumberType > cell_jacobian
Definition dg.hh:138
void reinit(const Iterator &cell, uint dofs_per_cell, uint n_extractors)
Definition dg.hh:144
std::vector< CopyDataFace_J > face_data
Definition dg.hh:142
Definition dg.hh:96
Vector< NumberType > cell_residual
Definition dg.hh:97
std::vector< types::global_dof_index > joint_dof_indices
Definition dg.hh:98
void reinit(const FEInterfaceValues< dim > &fe_iv)
Definition dg.hh:100
Definition dg.hh:95
std::vector< CopyDataFace_R > face_data
Definition dg.hh:110
void reinit(const Iterator &cell, uint dofs_per_cell)
Definition dg.hh:112
std::vector< types::global_dof_index > local_dof_indices
Definition dg.hh:109
Vector< NumberType > cell_residual
Definition dg.hh:107
Class to hold data for each assembly thread, i.e. FEValues for cells, interfaces, as well as pre-allo...
Definition dg.hh:38
array< std::vector< VectorType >, 2 > solution_interface
Definition dg.hh:90
typename Discretization::NumberType NumberType
Definition dg.hh:40
FEInterfaceValues< dim > fe_interface_values
Definition dg.hh:86
ScratchData(const ScratchData< Discretization > &scratch_data)
Definition dg.hh:62
std::vector< VectorType > solution_dot
Definition dg.hh:89
ScratchData(const Mapping< dim > &mapping, const FiniteElement< dim > &fe, const dealii::Quadrature< dim > &quadrature, const dealii::Quadrature< dim - 1 > &quadrature_face, const UpdateFlags update_flags=update_values|update_gradients|update_quadrature_points|update_JxW_values, const UpdateFlags interface_update_flags=update_values|update_gradients|update_quadrature_points|update_JxW_values|update_normal_vectors)
Definition dg.hh:43
Definition tuples.hh:34
Definition run_reporter.hh:73
SummaryEvent & timing(const std::string_view name, const double average_ms, const std::size_t calls)
Definition run_reporter.hh:78
std::conditional_t< CarriesModel< D >, typename D::Model, D > type
Definition types.hh:63
A class to store a tuple with elements that can be accessed by name. The names are stored as FixedStr...
Definition tuples.hh:56
Generated by