733 *
const unsigned int )
const
745 *
const unsigned int component = 0)
const override;
752 *
const unsigned int )
const
764 * components. (We say that it has two components in the constructor
765 * where we call the constructor of the base Function class.)
In the
784 *
const unsigned int component)
const override;
791 *
const unsigned int )
const
819 *
return return_value;
827 * <a name=
"step_61-WGDarcyEquationclassimplementation"></a>
833 * <a name=
"step_61-WGDarcyEquationWGDarcyEquation"></a>
856 * <a name=
"step_61-WGDarcyEquationmake_grid"></a>
870 *
std::cout <<
" Number of active cells: " <<
triangulation.n_active_cells()
881 * <a name=
"step_61-WGDarcyEquationsetup_system"></a>
901 *
dof_handler.distribute_dofs(fe);
904 *
std::cout <<
" Number of pressure degrees of freedom: "
905 *
<< dof_handler.n_dofs() << std::endl;
907 *
solution.reinit(dof_handler.n_dofs());
912 *
constraints.
clear();
921 *
constraints.close();
935 *
sparsity_pattern.copy_from(
dsp);
937 *
system_matrix.reinit(sparsity_pattern);
945 * <a name=
"step_61-WGDarcyEquationassemble_system"></a>
1030 *
const unsigned int n_q_points = fe_values.get_quadrature().size();
1033 *
const unsigned int n_face_q_points = fe_face_values.get_quadrature().size();
1041 *
std::vector<types::global_dof_index> local_dof_indices(
dofs_per_cell);
1079 *
for (
const auto &cell : dof_handler.active_cell_iterators())
1081 *
fe_values.
reinit(cell);
1089 *
coefficient.value_list(fe_values.get_quadrature_points(),
1136 *
for (
unsigned int q = 0;
q < n_q_points; ++
q)
1161 *
for (
const auto &face : cell->face_iterators())
1163 *
fe_face_values.
reinit(cell, face);
1217 *
for (
unsigned int i = 0; i < dofs_per_cell; ++i)
1218 *
for (
unsigned int j = 0;
j < dofs_per_cell; ++
j)
1232 *
for (
unsigned int q = 0;
q < n_q_points; ++
q)
1233 *
for (
unsigned int i = 0; i < dofs_per_cell; ++i)
1241 *
The last step
is to distribute components
of the local
1246 *
cell->get_dof_indices(local_dof_indices);
1247 *
constraints.distribute_local_to_global(
1257 * <a name=
"step_61-WGDarcyEquationdimsolve"></a>
1266 *
template <
int dim>
1272 *
constraints.distribute(solution);
1279 * <a name=
"step_61-WGDarcyEquationdimcompute_postprocessed_velocity"></a>
1311 *
template <
int dim>
1343 *
const unsigned int dofs_per_cell = fe.n_dofs_per_cell();
1346 *
const unsigned int n_q_points = fe_values.get_quadrature().size();
1349 *
const unsigned int n_face_q_points = fe_face_values.get_quadrature().size();
1352 *
std::vector<types::global_dof_index> local_dof_indices(dofs_per_cell);
1389 *
cell = dof_handler.begin_active(),
1393 *
fe_values.reinit(cell);
1443 *
for (
unsigned int q = 0;
q < n_q_points; ++
q)
1448 *
for (
unsigned int j = 0;
j < dofs_per_cell; ++
j)
1458 *
for (
const auto &face : cell->face_iterators())
1460 *
fe_face_values.
reinit(cell, face);
1471 *
for (
unsigned int j = 0;
j < dofs_per_cell; ++
j)
1502 *
for (
unsigned int i = 0; i < dofs_per_cell; ++i)
1515 *
for (
unsigned int i = 0; i < dofs_per_cell; ++i)
1526 * <a name=
"step_61-WGDarcyEquationdimcompute_pressure_error"></a>
1560 *
std::cout <<
"L2_error_pressure " <<
L2_error << std::endl;
1568 * <a name=
"step_61-WGDarcyEquationdimcompute_velocity_error"></a>
1585 *
template <
int dim>
1710 * <a name=
"step_61-WGDarcyEquationoutput_results"></a>
1757 *
const std::vector<std::string>
solution_names = {
"interior_pressure",
1758 *
"interface_pressure"};
1759 *
data_out.add_data_vector(dof_handler, solution,
solution_names);
1767 *
const std::vector<std::string>
velocity_names(dim,
"velocity");
1768 *
const std::vector<
1777 *
data_out.build_patches(fe.degree);
1778 *
std::ofstream output(
"solution_interior.vtu");
1779 *
data_out.write_vtu(output);
1787 *
std::ofstream
face_output(
"solution_interface.vtu");
1796 * <a name=
"step_61-WGDarcyEquationrun"></a>
1797 * <
h4>WGDarcyEquation::run</
h4>
1805 *
template <
int dim>
1808 *
std::cout <<
"Solving problem in " << dim <<
" space dimensions."
1826 * <a name=
"step_61-Thecodemaincodefunction"></a>
1841 *
catch (std::exception &exc)
1843 *
std::cerr << std::endl
1845 *
<<
"----------------------------------------------------"
1847 *
std::cerr <<
"Exception on processing: " << std::endl
1848 *
<< exc.what() << std::endl
1849 *
<<
"Aborting!" << std::endl
1850 *
<<
"----------------------------------------------------"
1856 *
std::cerr << std::endl
1858 *
<<
"----------------------------------------------------"
1860 *
std::cerr <<
"Unknown exception!" << std::endl
1861 *
<<
"Aborting!" << std::endl
1862 *
<<
"----------------------------------------------------"
1900<table
align=
"center">
1902 <
td><
img src=
"https://www.dealii.org/images/steps/developer/step-61.wg000_2d_2.png" alt=
""></
td>
1903 <
td><
img src=
"https://www.dealii.org/images/steps/developer/step-61.wg000_3d_2.png" alt=
""></
td>
1906 <
td><
img src=
"https://www.dealii.org/images/steps/developer/step-61.wg000_2d_4.png" alt=
""></
td>
1907 <
td><
img src=
"https://www.dealii.org/images/steps/developer/step-61.wg000_3d_4.png" alt=
""></
td>
1925<table
align=
"center" class=
"doxtable">
1963<table
align=
"center">
1965 <
td><
img src=
"https://www.dealii.org/images/steps/developer/step-61.wg111_2d_4.png" alt=
""></
td>
1966 <
td><
img src=
"https://www.dealii.org/images/steps/developer/step-61.wg111_3d_4.png" alt=
""></
td>
2018<table
align=
"center">
2020 <
td><
img src=
"https://www.dealii.org/images/steps/developer/step-61.wg222_2d_5.png" alt=
""></
td>
2021 <
td><
img src=
"https://www.dealii.org/images/steps/developer/step-61.wg222_3d_5.png" alt=
""></
td>
2058<a name=
"step_61-PlainProg"></a>
void add_data_vector(const VectorType &data, const std::vector< std::string > &names, const DataVectorType type=type_automatic, const std::vector< DataComponentInterpretation::DataComponentInterpretation > &data_component_interpretation={})
virtual void build_patches(const unsigned int n_subdivisions=0)
const unsigned int dofs_per_cell
friend class FEValuesViews::Tensor
const ObserverPointer< const FiniteElement< dim, spacedim >, FEValuesBase< dim, spacedim > > fe
const Quadrature< dim > quadrature
void reinit(const TriaIterator< DoFCellAccessor< dim, spacedim, level_dof_access > > &cell)
numbers::NumberTraits< Number >::real_type norm() const
static constexpr unsigned int dimension
std::conditional_t< rank_==1, std::array< Number, dim >, std::array< Tensor< rank_ - 1, dim, Number >, dim > > values
typename ActiveSelector::active_cell_iterator active_cell_iterator
void loop(IteratorType begin, std_cxx20::type_identity_t< IteratorType > end, DOFINFO &dinfo, INFOBOX &info, const std::function< void(std_cxx20::type_identity_t< DOFINFO > &, typename INFOBOX::CellInfo &)> &cell_worker, const std::function< void(std_cxx20::type_identity_t< DOFINFO > &, typename INFOBOX::CellInfo &)> &boundary_worker, const std::function< void(std_cxx20::type_identity_t< DOFINFO > &, std_cxx20::type_identity_t< DOFINFO > &, typename INFOBOX::CellInfo &, typename INFOBOX::CellInfo &)> &face_worker, AssemblerType &assembler, const LoopControl &lctrl=LoopControl())
void make_sparsity_pattern(const DoFHandler< dim, spacedim > &dof_handler, SparsityPatternBase &sparsity_pattern, const AffineConstraints< number > &constraints={}, const bool keep_constrained_dofs=true, const types::subdomain_id subdomain_id=numbers::invalid_subdomain_id)
@ update_values
Shape function values.
@ update_normal_vectors
Normal vectors.
@ update_JxW_values
Transformed quadrature weights.
@ update_gradients
Shape function gradients.
@ update_quadrature_points
Transformed quadrature points.
std::vector< index_type > data
CGAL::Exact_predicates_exact_constructions_kernel_with_sqrt K
DataComponentInterpretation
@ component_is_part_of_vector
void approximate(const SynchronousIterators< std::tuple< typename DoFHandler< dim, spacedim >::active_cell_iterator, Vector< float >::iterator > > &cell, const Mapping< dim, spacedim > &mapping, const DoFHandler< dim, spacedim > &dof_handler, const InputVector &solution, const unsigned int component)
void hyper_cube(Triangulation< dim, spacedim > &tria, const double left=0., const double right=1., const bool colorize=false)
void refine(Triangulation< dim, spacedim > &tria, const Vector< Number > &criteria, const double threshold, const unsigned int max_to_mark=numbers::invalid_unsigned_int)
@ matrix
Contents is actually a matrix.
@ symmetric
Matrix is symmetric.
constexpr types::blas_int one
Point< spacedim > point(const gp_Pnt &p, const double tolerance=1e-10)
Tensor< 2, dim, Number > w(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
Tensor< 2, dim, Number > l(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
constexpr ReturnType< rank, T >::value_type & extract(T &t, const ArrayType &indices)
void run(const Iterator &begin, const std_cxx20::type_identity_t< Iterator > &end, Worker worker, Copier copier, const ScratchData &sample_scratch_data, const CopyData &sample_copy_data, const unsigned int queue_length, const unsigned int chunk_size)
void copy(const T *begin, const T *end, U *dest)
int(&) functions(const void *v1, const void *v2)
void assemble(const MeshWorker::DoFInfoBox< dim, DOFINFO > &dinfo, A *assembler)
void reinit(MatrixBlock< MatrixType > &v, const BlockSparsityPattern &p)
::VectorizedArray< Number, width > cos(const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > sin(const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > sqrt(const ::VectorizedArray< Number, width > &)
const ::parallel::distributed::Triangulation< dim, spacedim > * triangulation