12 #ifndef StaticVectorSolverI_H__
13 #define StaticVectorSolverI_H__
15 #include <deal.II/base/exceptions.h>
16 #include <deal.II/base/tensor.h>
17 #include <deal.II/base/thread_management.h>
18 #include <deal.II/base/timer.h>
19 #include <deal.II/base/types.h>
20 #include <deal.II/base/work_stream.h>
22 #include <deal.II/grid/tria.h>
24 #include <deal.II/dofs/dof_handler.h>
25 #include <deal.II/dofs/dof_renumbering.h>
26 #include <deal.II/dofs/dof_tools.h>
28 #include <deal.II/fe/fe_nedelec.h>
29 #include <deal.II/fe/fe_values.h>
31 #include <deal.II/lac/affine_constraints.h>
32 #include <deal.II/lac/dynamic_sparsity_pattern.h>
33 #include <deal.II/lac/precondition.h>
34 #include <deal.II/lac/solver_cg.h>
35 #include <deal.II/lac/solver_control.h>
36 #include <deal.II/lac/sparse_matrix.h>
37 #include <deal.II/lac/vector.h>
39 #include <deal.II/numerics/data_out.h>
40 #include <deal.II/numerics/vector_tools.h>
41 #include <deal.II/numerics/vector_tools_common.h>
42 #include <deal.II/numerics/vector_tools_project.h>
50 #include "constants.hpp"
51 #include "settings.hpp"
52 #include "static_vector_input.hpp"
54 #define VE scratch_data.ve
56 #define TMR(__name) TimerOutput::Scope timer_section(timer, __name)
58 using namespace dealii;
60 namespace StaticVectorSolver {
317 template<
int dim,
int stage = 1>
353 unsigned int mapping_degree,
354 unsigned int type_of_pde_rhs = 3,
355 double eta_squared = 0.0,
356 std::string fname =
"data",
357 const Function<dim>* exact_solution =
nullptr,
358 bool print_time_tables =
false,
359 bool project_exact_solution =
false,
360 bool write_higher_order_cells =
false)
362 , mapping_degree(mapping_degree)
363 , type_of_pde_rhs(type_of_pde_rhs)
364 , eta_squared(eta_squared)
366 , exact_solution(exact_solution)
367 , print_time_tables(print_time_tables)
368 , project_exact_solution(project_exact_solution)
369 , write_higher_order_cells(write_higher_order_cells)
371 Assert(((dim == 2) || (dim == 3)), ExcInternalError());
372 Assert(p < 5, ExcInternalError());
373 Assert(type_of_pde_rhs < 4, ExcInternalError());
513 system_matrix.clear();
514 system_rhs.reinit(0);
520 const Triangulation<dim>&
get_tria()
const {
return triangulation; }
537 return static_cast<unsigned int>(triangulation.n_active_cells());
545 return static_cast<unsigned int>(dof_handler.n_dofs());
578 TimerOutput::OutputFrequency tf =
579 (print_time_tables) ? TimerOutput::summary : TimerOutput::never;
581 TimerOutput timer(std::cout, tf, TimerOutput::cpu_and_wall_times_grouped);
588 TMR(
"Fill Dirichlet stack");
589 fill_dirichlet_stack();
604 if (exact_solution) {
605 if (project_exact_solution) {
606 TMR(
"Project exact solution");
607 project_exact_solution_fcn();
611 TMR(
"Compute error norms");
612 compute_error_norms();
639 const FE_Nedelec<dim>
fe;
688 const unsigned int mapping_degree;
689 const unsigned int type_of_pde_rhs;
690 const double eta_squared;
691 const std::string fname;
692 const Function<dim>* exact_solution;
693 const bool print_time_tables;
694 const bool project_exact_solution;
695 const bool write_higher_order_cells;
697 Vector<float> L2_per_cell;
698 Vector<float> Linfty_per_cell;
706 struct AssemblyScratchData
708 AssemblyScratchData(
const FiniteElement<dim>& fe,
709 unsigned int mapping_degree,
710 unsigned int type_of_pde_rhs,
713 AssemblyScratchData(
const AssemblyScratchData& scratch_data);
721 MappingQ<dim> mapping;
723 FEValues<dim> fe_values;
724 FEFaceValues<dim> fe_face_values;
726 const unsigned int dofs_per_cell;
727 const unsigned int n_q_points;
728 const unsigned int n_q_points_face;
730 std::vector<double> the_coefficient_list;
731 std::vector<Tensor<1, dim>> pde_rhs_list;
732 std::vector<Tensor<1, dim>> pde_rhs_list_face;
733 std::vector<double> gamma_list;
734 std::vector<Tensor<1, dim>> robin_rhs_list;
735 std::vector<Tensor<1, dim>> free_surface_current_list;
737 const unsigned int type_of_pde_rhs;
738 const double eta_squared;
739 const FEValuesExtractors::Vector ve;
742 bool do_T_on_boundary;
745 struct AssemblyCopyData
747 FullMatrix<double> cell_matrix;
748 Vector<double> cell_rhs;
749 std::vector<types::global_dof_index> local_dof_indices;
752 void system_matrix_local(
753 const typename DoFHandler<dim>::active_cell_iterator& cell,
754 AssemblyScratchData& scratch_data,
755 AssemblyCopyData& copy_data);
757 void copy_local_to_global(
const AssemblyCopyData& copy_data);
763 template<
int dim,
int stage>
767 dof_handler.reinit(triangulation);
768 dof_handler.distribute_dofs(fe);
771 DoFTools::make_hanging_node_constraints(dof_handler, constraints);
773 #pragma GCC diagnostic push
774 #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
775 for (
auto item : dirichlet_stack) {
776 Assert(item.first % 2 == 1, ExcInternalError());
778 #pragma GCC diagnostic pop
780 for (
auto item : dirichlet_stack)
781 VectorTools::project_boundary_values_curl_conforming_l2(
787 MappingQ<dim>(mapping_degree));
791 DynamicSparsityPattern dsp(dof_handler.n_dofs(), dof_handler.n_dofs());
792 DoFTools::make_sparsity_pattern(dof_handler, dsp, constraints,
false);
794 sparsity_pattern.copy_from(dsp);
795 system_matrix.reinit(sparsity_pattern);
796 solution.reinit(dof_handler.n_dofs());
797 system_rhs.reinit(dof_handler.n_dofs());
799 if (project_exact_solution)
800 projected_exact_solution.reinit(dof_handler.n_dofs());
802 if (exact_solution) {
803 L2_per_cell.reinit(triangulation.n_active_cells());
804 Linfty_per_cell.reinit(triangulation.n_active_cells());
808 template<
int dim,
int stage>
813 dof_handler.begin_active(),
816 &Solver1::system_matrix_local,
817 &Solver1::copy_local_to_global,
818 AssemblyScratchData(fe, mapping_degree, type_of_pde_rhs, eta_squared),
822 template<
int dim,
int stage>
824 const FiniteElement<dim>& fe,
825 unsigned int mapping_degree,
826 unsigned int type_of_pde_rhs,
828 : mapping(mapping_degree)
832 QGauss<dim>(qt.sim()),
833 update_gradients | update_values | update_quadrature_points |
835 , fe_face_values(mapping,
837 QGauss<dim - 1>(qt.sim()),
838 update_values | update_normal_vectors |
839 update_quadrature_points | update_JxW_values)
840 , dofs_per_cell(fe_values.dofs_per_cell)
841 , n_q_points(fe_values.get_quadrature().size())
842 , n_q_points_face(fe_face_values.get_quadrature().size())
843 , the_coefficient_list(n_q_points)
844 , pde_rhs_list(n_q_points, Tensor<1, dim>())
845 , pde_rhs_list_face(n_q_points_face, Tensor<1, dim>())
846 , gamma_list(n_q_points_face)
847 , robin_rhs_list(n_q_points_face, Tensor<1, dim>())
848 , free_surface_current_list(n_q_points_face, Tensor<1, dim>())
849 , type_of_pde_rhs(type_of_pde_rhs)
850 , eta_squared(eta_squared)
855 template<
int dim,
int stage>
856 Solver1<dim, stage>::AssemblyScratchData::AssemblyScratchData(
857 const AssemblyScratchData& scratch_data)
858 : mapping(scratch_data.mapping.get_degree())
859 , qt(scratch_data.qt)
861 scratch_data.fe_values.get_fe(),
862 scratch_data.fe_values.get_quadrature(),
863 update_gradients | update_values | update_quadrature_points |
865 , fe_face_values(mapping,
866 scratch_data.fe_face_values.get_fe(),
867 scratch_data.fe_face_values.get_quadrature(),
868 update_values | update_normal_vectors |
869 update_quadrature_points | update_JxW_values)
870 , dofs_per_cell(fe_values.dofs_per_cell)
871 , n_q_points(fe_values.get_quadrature().size())
872 , n_q_points_face(fe_face_values.get_quadrature().size())
873 , the_coefficient_list(n_q_points)
874 , pde_rhs_list(n_q_points, Tensor<1, dim>())
875 , pde_rhs_list_face(n_q_points_face, Tensor<1, dim>())
876 , gamma_list(n_q_points_face)
877 , robin_rhs_list(n_q_points_face, Tensor<1, dim>())
878 , free_surface_current_list(n_q_points_face, Tensor<1, dim>())
879 , type_of_pde_rhs(scratch_data.type_of_pde_rhs)
880 , eta_squared(scratch_data.eta_squared)
885 template<
int dim,
int stage>
887 Solver1<dim, stage>::system_matrix_local(
888 const typename DoFHandler<dim>::active_cell_iterator& cell,
889 AssemblyScratchData& scratch_data,
890 AssemblyCopyData& copy_data)
900 copy_data.cell_matrix.reinit(scratch_data.dofs_per_cell,
901 scratch_data.dofs_per_cell);
903 copy_data.cell_rhs.reinit(scratch_data.dofs_per_cell);
905 copy_data.local_dof_indices.resize(scratch_data.dofs_per_cell);
907 scratch_data.fe_values.reinit(cell);
909 scratch_data.the_coefficient.value_list(
910 scratch_data.fe_values.get_quadrature_points(),
913 scratch_data.the_coefficient_list);
915 scratch_data.pde_rhs.value_list(
916 scratch_data.fe_values.get_quadrature_points(),
919 scratch_data.pde_rhs_list);
943 for (
unsigned int q_index = 0; q_index < scratch_data.n_q_points; ++q_index) {
944 for (
unsigned int i = 0; i < scratch_data.dofs_per_cell; ++i) {
945 for (
unsigned int j = 0; j < scratch_data.dofs_per_cell; ++j) {
946 copy_data.cell_matrix(i, j) +=
948 (1.0 / scratch_data.the_coefficient_list[q_index]) *
949 scratch_data.fe_values[VE].curl(i, q_index) *
950 scratch_data.fe_values[VE].curl(j, q_index)
951 + scratch_data.eta_squared *
952 scratch_data.fe_values[VE].value(i, q_index) *
953 scratch_data.fe_values[VE].value(j, q_index)
955 scratch_data.fe_values.JxW(q_index);
958 switch (scratch_data.type_of_pde_rhs) {
961 copy_data.cell_rhs(i) = 0.0;
965 copy_data.cell_rhs(i) +=
966 scratch_data.pde_rhs_list[q_index] *
967 scratch_data.fe_values[VE].value(i, q_index) *
968 scratch_data.fe_values.JxW(q_index);
974 #if DEAL_II_VERSION_GTE(9, 8, 0)
975 copy_data.cell_rhs(i) +=
976 scratch_data.pde_rhs_list[q_index][0] *
977 scratch_data.fe_values[VE].curl(i, q_index) *
978 scratch_data.fe_values.JxW(q_index);
980 copy_data.cell_rhs(i) +=
981 scratch_data.pde_rhs_list[q_index][0] *
982 scratch_data.fe_values[VE].curl(i, q_index)[0] *
983 scratch_data.fe_values.JxW(q_index);
988 copy_data.cell_rhs(i) +=
989 (scratch_data.pde_rhs_list[q_index] *
990 scratch_data.fe_values[VE].curl(i, q_index)) *
991 scratch_data.fe_values.JxW(q_index);
999 Assert(
false, ExcInternalError());
1005 for (
unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f) {
1006 scratch_data.do_robin = ((cell->face(f)->at_boundary()) &&
1007 (cell->face(f)->boundary_id() % 2 == 0) &&
1008 (cell->face(f)->boundary_id() != 0));
1011 ((cell->user_index() > 0) && (cell->face(f)->user_index() > 0));
1013 scratch_data.do_T_on_boundary =
1014 ((cell->face(f)->at_boundary()) && (scratch_data.type_of_pde_rhs == 3));
1016 Assert(!(scratch_data.do_robin && scratch_data.do_K), ExcInternalError());
1018 if (scratch_data.do_robin || scratch_data.do_K ||
1019 scratch_data.do_T_on_boundary) {
1021 scratch_data.fe_face_values.reinit(cell, f);
1023 if (scratch_data.do_robin) {
1024 scratch_data.gamma.value_list(
1025 scratch_data.fe_face_values.get_quadrature_points(),
1026 scratch_data.fe_face_values.get_normal_vectors(),
1027 cell->face(f)->boundary_id(),
1028 cell->material_id(),
1030 cell->face(f)->user_index(),
1031 scratch_data.gamma_list);
1033 scratch_data.robin_rhs.value_list(
1034 scratch_data.fe_face_values.get_quadrature_points(),
1035 scratch_data.fe_face_values.get_normal_vectors(),
1036 cell->face(f)->boundary_id(),
1037 cell->material_id(),
1039 cell->face(f)->user_index(),
1040 scratch_data.robin_rhs_list);
1043 if (scratch_data.do_K) {
1044 scratch_data.free_surface_current.value_list(
1045 scratch_data.fe_face_values.get_quadrature_points(),
1046 scratch_data.fe_face_values.get_normal_vectors(),
1047 cell->material_id(),
1049 cell->face(f)->user_index(),
1050 scratch_data.free_surface_current_list);
1053 if (scratch_data.do_T_on_boundary) {
1054 scratch_data.pde_rhs.value_list(
1055 scratch_data.fe_face_values.get_quadrature_points(),
1056 cell->material_id(),
1058 scratch_data.pde_rhs_list_face);
1061 for (
unsigned int q_index_face = 0;
1062 q_index_face < scratch_data.n_q_points_face;
1064 for (
unsigned int i = 0; i < scratch_data.dofs_per_cell; ++i) {
1065 if (scratch_data.do_robin) {
1066 for (
unsigned int j = 0; j < scratch_data.dofs_per_cell; ++j) {
1069 copy_data.cell_matrix(i, j) +=
1070 scratch_data.gamma_list[q_index_face] *
1071 (scratch_data.fe_face_values.normal_vector(q_index_face)[0] *
1072 scratch_data.fe_face_values[VE].value(i, q_index_face)[1] -
1073 scratch_data.fe_face_values.normal_vector(q_index_face)[1] *
1074 scratch_data.fe_face_values[VE].value(i,
1076 (scratch_data.fe_face_values.normal_vector(q_index_face)[0] *
1077 scratch_data.fe_face_values[VE].value(j, q_index_face)[1] -
1078 scratch_data.fe_face_values.normal_vector(q_index_face)[1] *
1079 scratch_data.fe_face_values[VE].value(j,
1081 scratch_data.fe_face_values.JxW(q_index_face);
1082 }
else if (dim == 3) {
1084 copy_data.cell_matrix(i, j) +=
1085 scratch_data.gamma_list[q_index_face] *
1086 ((scratch_data.fe_face_values.normal_vector(q_index_face)[1] *
1087 scratch_data.fe_face_values[VE].value(i,
1089 scratch_data.fe_face_values.normal_vector(q_index_face)[2] *
1090 scratch_data.fe_face_values[VE].value(i,
1092 (scratch_data.fe_face_values.normal_vector(
1094 scratch_data.fe_face_values[VE].value(j,
1096 scratch_data.fe_face_values.normal_vector(
1098 scratch_data.fe_face_values[VE].value(
1099 j, q_index_face)[1]) +
1100 (scratch_data.fe_face_values.normal_vector(q_index_face)[0] *
1101 scratch_data.fe_face_values[VE].value(i,
1103 scratch_data.fe_face_values.normal_vector(q_index_face)[2] *
1104 scratch_data.fe_face_values[VE].value(i,
1106 (scratch_data.fe_face_values.normal_vector(
1108 scratch_data.fe_face_values[VE].value(j,
1110 scratch_data.fe_face_values.normal_vector(
1112 scratch_data.fe_face_values[VE].value(
1113 j, q_index_face)[0]) +
1114 (scratch_data.fe_face_values.normal_vector(q_index_face)[0] *
1115 scratch_data.fe_face_values[VE].value(i,
1117 scratch_data.fe_face_values.normal_vector(q_index_face)[1] *
1118 scratch_data.fe_face_values[VE].value(i,
1120 (scratch_data.fe_face_values.normal_vector(
1122 scratch_data.fe_face_values[VE].value(j,
1124 scratch_data.fe_face_values.normal_vector(
1126 scratch_data.fe_face_values[VE].value(
1127 j, q_index_face)[0])) *
1128 scratch_data.fe_face_values.JxW(
1131 Assert(
false, ExcInternalError());
1136 copy_data.cell_rhs(i) +=
1137 -scratch_data.robin_rhs_list[q_index_face] *
1138 scratch_data.fe_face_values[VE].value(i, q_index_face) *
1139 scratch_data.fe_face_values.JxW(q_index_face);
1142 if (scratch_data.do_K) {
1144 copy_data.cell_rhs(i) +=
1145 scratch_data.free_surface_current_list[q_index_face] *
1146 scratch_data.fe_face_values[VE].value(i, q_index_face) *
1147 scratch_data.fe_face_values.JxW(q_index_face);
1150 if (scratch_data.do_T_on_boundary) {
1153 copy_data.cell_rhs(i) -=
1154 scratch_data.pde_rhs_list_face[q_index_face][0] *
1155 (scratch_data.fe_face_values.normal_vector(q_index_face)[0] *
1156 scratch_data.fe_face_values[VE].value(i, q_index_face)[1] -
1157 scratch_data.fe_face_values.normal_vector(q_index_face)[1] *
1158 scratch_data.fe_face_values[VE].value(i,
1161 scratch_data.fe_face_values.JxW(q_index_face);
1162 }
else if (dim == 3) {
1164 copy_data.cell_rhs(i) -=
1165 (scratch_data.pde_rhs_list_face[q_index_face][0] *
1166 (scratch_data.fe_face_values.normal_vector(q_index_face)[1] *
1167 scratch_data.fe_face_values[VE].value(i,
1169 scratch_data.fe_face_values.normal_vector(q_index_face)[2] *
1170 scratch_data.fe_face_values[VE].value(i,
1172 scratch_data.pde_rhs_list_face[q_index_face][1] *
1173 (scratch_data.fe_face_values.normal_vector(q_index_face)[0] *
1174 scratch_data.fe_face_values[VE].value(i,
1176 scratch_data.fe_face_values.normal_vector(q_index_face)[2] *
1177 scratch_data.fe_face_values[VE].value(i,
1179 scratch_data.pde_rhs_list_face[q_index_face][2] *
1180 (scratch_data.fe_face_values.normal_vector(q_index_face)[0] *
1181 scratch_data.fe_face_values[VE].value(i,
1183 scratch_data.fe_face_values.normal_vector(q_index_face)[1] *
1184 scratch_data.fe_face_values[VE].value(i,
1185 q_index_face)[0])) *
1186 scratch_data.fe_face_values.JxW(
1192 Assert(
false, ExcInternalError());
1199 cell->get_dof_indices(copy_data.local_dof_indices);
1202 template<
int dim,
int stage>
1204 Solver1<dim, stage>::copy_local_to_global(
const AssemblyCopyData& copy_data)
1206 constraints.distribute_local_to_global(copy_data.cell_matrix,
1208 copy_data.local_dof_indices,
1213 template<
int dim,
int stage>
1218 const Function<dim, double>* mask = &weight;
1221 QGauss<dim> quadrature(qt.
enorm());
1223 VectorTools::integrate_difference(MappingQ<dim>(mapping_degree),
1229 VectorTools::L2_norm,
1232 L2_norm = VectorTools::compute_global_error(
1233 triangulation, L2_per_cell, VectorTools::L2_norm);
1235 VectorTools::integrate_difference(MappingQ<dim>(mapping_degree),
1241 VectorTools::Linfty_norm,
1244 Linfty_norm = Linfty_per_cell.linfty_norm();
1247 template<
int dim,
int stage>
1253 AffineConstraints<double> constraints_empty;
1254 constraints_empty.close();
1256 VectorTools::project(MappingQ<dim>(mapping_degree),
1259 QGauss<dim>(qt.
sim()),
1261 projected_exact_solution);
1264 template<
int dim,
int stage>
1268 std::vector<std::string> solution_names(dim,
"VectorField");
1269 std::vector<DataComponentInterpretation::DataComponentInterpretation>
1271 DataComponentInterpretation::component_is_part_of_vector);
1273 DataOut<dim> data_out;
1275 data_out.add_data_vector(
1276 dof_handler, solution, solution_names, interpretation);
1278 if (project_exact_solution && exact_solution) {
1279 std::vector<std::string> solution_names_ex(dim,
"VectorFieldExact");
1281 data_out.add_data_vector(
1282 dof_handler, projected_exact_solution, solution_names_ex, interpretation);
1285 if (exact_solution) {
1286 data_out.add_data_vector(L2_per_cell,
"L2norm");
1287 data_out.add_data_vector(Linfty_per_cell,
"LinftyNorm");
1292 if (write_higher_order_cells) {
1293 DataOutBase::VtkFlags flags;
1294 flags.write_higher_order_cells =
true;
1295 data_out.set_flags(flags);
1297 const MappingQ<dim> mapping(mapping_degree);
1299 data_out.build_patches(mapping,
1301 DataOut<dim>::CurvedCellRegion::curved_inner_cells);
1303 ofs.open(fname +
".vtu");
1304 data_out.write_vtu(ofs);
1308 data_out.build_patches();
1310 ofs.open(fname +
".vtk");
1311 data_out.write_vtk(ofs);
1317 template<
int dim,
int stage>
1321 std::ofstream ofs_matrix(fname +
"_matrix.csv");
1322 std::ofstream ofs_rhs(fname +
"_rhs.csv");
1324 for (
unsigned int i = 0; i < system_matrix.m(); ++i) {
1325 ofs_rhs << system_rhs(i);
1326 if (i < (system_matrix.m() - 1))
1329 for (
unsigned int j = 0; j < system_matrix.n(); ++j) {
1330 ofs_matrix << std::scientific << std::setprecision(16)
1331 << system_matrix.el(i, j);
1333 if (j < (system_matrix.m() - 1))
1336 if (i < (system_matrix.m() - 1))
The tables that contain the amount of quadrature points used in vector problems.
unsigned int enorm() const
Returns the amount of quadrature points used when calculating the error norms.
unsigned int sim() const
Returns the amount of quadrature points used when assembling system if linear equations.
Implements the coefficient on the left-hand side of the Robin boundary condition (iii) of the static...
Implements the source vector field on the right-hand side of the partial differential equation (i) of...
Implements the vector field, , on the right-hand side of the Robin boundary condition (iii) of the st...
Solves static vector boundary value problem.
unsigned int get_n_dofs() const
Returns the total amount of the degrees of freedom.
void assemble()
Assembles the system matrix and the right-hand side vector.
SparsityPattern sparsity_pattern
The sparsity pattern of the system matrix.
void project_exact_solution_fcn()
Projects exact solution.
void compute_error_norms()
Computes error norms.
unsigned int get_mapping_degree() const
Returns degree of the interpolating Lagrange polynomials used for mapping from the reference cell to ...
void save_matrix_and_rhs_to_csv(std::string fname) const
Saves the system matrix and the right-hand side into a csv file.
double get_L2_norm() const
Returns error norm.
double get_Linfty_norm() const
Returns error norm.
const FE_Nedelec< dim > fe
The finite elements.
void save() const
Saves simulation results into a vtk or vtu file.
virtual void fill_dirichlet_stack()=0
Initializes the data member StaticVectorSolver::Solver1::dirichlet_stack.
DoFHandler< dim > dof_handler
The dof handler.
virtual void solve()=0
Solves the system of linear equations.
AffineConstraints< double > constraints
The constraints associated with the Dirichlet boundary conditions.
Vector< double > solution
The solution vector, that is, degrees of freedom yielded by the simulation.
SparseMatrix< double > system_matrix
The system matrix.
Solver1(unsigned int p, unsigned int mapping_degree, unsigned int type_of_pde_rhs=3, double eta_squared=0.0, std::string fname="data", const Function< dim > *exact_solution=nullptr, bool print_time_tables=false, bool project_exact_solution=false, bool write_higher_order_cells=false)
The only constructor.
virtual void make_mesh()=0
Initializes the data member StaticVectorSolver::Solver1::triangulation.
Vector< double > system_rhs
The system right-hand side vector.
Triangulation< dim > triangulation
The mesh.
double Linfty_norm
The norm.
unsigned int get_n_cells() const
Returns the number of active cells in the mesh.
void setup()
Initializes system matrix and the right-hand side vector.
void run()
Runs the simulation.
std::map< types::boundary_id, const Function< dim > * > dirichlet_stack
A map that contains pairs of boundary IDs and the corresponding Dirichlet boundary conditions....
const DoFHandler< dim > & get_dof_handler() const
Returns a reference to dof handler.
const Vector< double > & get_solution() const
Returns a reference to solution.
const Triangulation< dim > & get_tria() const
Returns a reference to triangulation.
Vector< double > projected_exact_solution
The projected exact solution vector.
void clear()
Releases computer memory associated with system matrix and right-hand side.
unsigned int get_rhs_type() const
Returns the value of type_of_pde_rhs.
Implements the permeability, , in the partial differential equation (i) of the vector boundary value ...
Implements the weight function for calculating the and error norms.