734 *
const unsigned int )
const
746 *
const unsigned int component = 0)
const override;
753 *
const unsigned int )
const
765 * components. (We say that it has two components in the constructor
766 * where we call the constructor of the base Function class.)
In the
785 *
const unsigned int component)
const override;
792 *
const unsigned int )
const
820 *
return return_value;
828 * <a name=
"WGDarcyEquationclassimplementation"></a>
834 * <a name=
"WGDarcyEquationWGDarcyEquation"></a>
857 * <a name=
"WGDarcyEquationmake_grid"></a>
871 *
std::cout <<
" Number of active cells: " <<
triangulation.n_active_cells()
882 * <a name=
"WGDarcyEquationsetup_system"></a>
902 *
dof_handler.distribute_dofs(fe);
905 *
std::cout <<
" Number of pressure degrees of freedom: "
906 *
<< dof_handler.n_dofs() << std::endl;
908 *
solution.
reinit(dof_handler.n_dofs());
913 *
constraints.clear();
922 *
constraints.close();
936 *
sparsity_pattern.copy_from(
dsp);
938 *
system_matrix.
reinit(sparsity_pattern);
946 * <a name=
"WGDarcyEquationassemble_system"></a>
1031 *
const unsigned int n_q_points = fe_values.get_quadrature().
size();
1042 *
std::vector<types::global_dof_index> local_dof_indices(
dofs_per_cell);
1080 *
for (
const auto &cell : dof_handler.active_cell_iterators())
1082 *
fe_values.
reinit(cell);
1090 *
coefficient.value_list(fe_values.get_quadrature_points(),
1137 *
for (
unsigned int q = 0;
q < n_q_points; ++
q)
1162 *
for (
const auto &face : cell->face_iterators())
1164 *
fe_face_values.
reinit(cell, face);
1218 *
for (
unsigned int i = 0; i < dofs_per_cell; ++i)
1219 *
for (
unsigned int j = 0;
j < dofs_per_cell; ++
j)
1233 *
for (
unsigned int q = 0;
q < n_q_points; ++
q)
1234 *
for (
unsigned int i = 0; i < dofs_per_cell; ++i)
1242 *
The last step
is to distribute components
of the local
1247 *
cell->get_dof_indices(local_dof_indices);
1248 *
constraints.distribute_local_to_global(
1258 * <a name=
"WGDarcyEquationdimsolve"></a>
1267 *
template <
int dim>
1273 *
constraints.distribute(solution);
1280 * <a name=
"WGDarcyEquationdimcompute_postprocessed_velocity"></a>
1312 *
template <
int dim>
1344 *
const unsigned int dofs_per_cell = fe.n_dofs_per_cell();
1347 *
const unsigned int n_q_points = fe_values.get_quadrature().
size();
1353 *
std::vector<types::global_dof_index> local_dof_indices(dofs_per_cell);
1390 *
cell = dof_handler.begin_active(),
1394 *
fe_values.
reinit(cell);
1444 *
for (
unsigned int q = 0;
q < n_q_points; ++
q)
1449 *
for (
unsigned int j = 0;
j < dofs_per_cell; ++
j)
1459 *
for (
const auto &face : cell->face_iterators())
1461 *
fe_face_values.
reinit(cell, face);
1472 *
for (
unsigned int j = 0;
j < dofs_per_cell; ++
j)
1503 *
for (
unsigned int i = 0; i < dofs_per_cell; ++i)
1516 *
for (
unsigned int i = 0; i < dofs_per_cell; ++i)
1527 * <a name=
"WGDarcyEquationdimcompute_pressure_error"></a>
1561 *
std::cout <<
"L2_error_pressure " <<
L2_error << std::endl;
1569 * <a name=
"WGDarcyEquationdimcompute_velocity_error"></a>
1586 *
template <
int dim>
1711 * <a name=
"WGDarcyEquationoutput_results"></a>
1758 *
const std::vector<std::string>
solution_names = {
"interior_pressure",
1759 *
"interface_pressure"};
1760 *
data_out.add_data_vector(dof_handler, solution,
solution_names);
1768 *
const std::vector<std::string>
velocity_names(dim,
"velocity");
1769 *
const std::vector<
1778 *
data_out.build_patches(fe.degree);
1779 *
std::ofstream output(
"solution_interior.vtu");
1780 *
data_out.write_vtu(output);
1788 *
std::ofstream
face_output(
"solution_interface.vtu");
1797 * <a name=
"WGDarcyEquationrun"></a>
1798 * <
h4>WGDarcyEquation::run</
h4>
1806 *
template <
int dim>
1809 *
std::cout <<
"Solving problem in " << dim <<
" space dimensions."
1827 * <a name=
"Thecodemaincodefunction"></a>
1842 *
catch (std::exception &exc)
1844 *
std::cerr << std::endl
1846 *
<<
"----------------------------------------------------"
1848 *
std::cerr <<
"Exception on processing: " << std::endl
1849 *
<< exc.what() << std::endl
1850 *
<<
"Aborting!" << std::endl
1851 *
<<
"----------------------------------------------------"
1857 *
std::cerr << std::endl
1859 *
<<
"----------------------------------------------------"
1861 *
std::cerr <<
"Unknown exception!" << std::endl
1862 *
<<
"Aborting!" << std::endl
1863 *
<<
"----------------------------------------------------"
1901<table
align=
"center">
1903 <
td><
img src=
"https://www.dealii.org/images/steps/developer/step-61.wg000_2d_2.png" alt=
""></
td>
1904 <
td><
img src=
"https://www.dealii.org/images/steps/developer/step-61.wg000_3d_2.png" alt=
""></
td>
1907 <
td><
img src=
"https://www.dealii.org/images/steps/developer/step-61.wg000_2d_4.png" alt=
""></
td>
1908 <
td><
img src=
"https://www.dealii.org/images/steps/developer/step-61.wg000_3d_4.png" alt=
""></
td>
1926<table
align=
"center" class=
"doxtable">
1964<table
align=
"center">
1966 <
td><
img src=
"https://www.dealii.org/images/steps/developer/step-61.wg111_2d_4.png" alt=
""></
td>
1967 <
td><
img src=
"https://www.dealii.org/images/steps/developer/step-61.wg111_3d_4.png" alt=
""></
td>
2019<table
align=
"center">
2021 <
td><
img src=
"https://www.dealii.org/images/steps/developer/step-61.wg222_2d_5.png" alt=
""></
td>
2022 <
td><
img src=
"https://www.dealii.org/images/steps/developer/step-61.wg222_3d_5.png" alt=
""></
td>
2059<a name=
"PlainProg"></a>
value_type * data() const noexcept
void reinit(value_type *starting_element, const std::size_t n_elements)
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
const SmartPointer< const FiniteElement< dim, spacedim >, FEValuesBase< dim, spacedim > > fe
const Quadrature< dim > quadrature
void reinit(const TriaIterator< DoFCellAccessor< dim, spacedim, level_dof_access > > &cell)
typename ActiveSelector::active_cell_iterator active_cell_iterator
void loop(ITERATOR begin, std_cxx20::type_identity_t< ITERATOR > end, DOFINFO &dinfo, INFOBOX &info, const std::function< void(DOFINFO &, typename INFOBOX::CellInfo &)> &cell_worker, const std::function< void(DOFINFO &, typename INFOBOX::CellInfo &)> &boundary_worker, const std::function< void(DOFINFO &, DOFINFO &, typename INFOBOX::CellInfo &, typename INFOBOX::CellInfo &)> &face_worker, ASSEMBLER &assembler, const LoopControl &lctrl=LoopControl())
void make_sparsity_pattern(const DoFHandler< dim, spacedim > &dof_handler, SparsityPatternBase &sparsity_pattern, const AffineConstraints< number > &constraints=AffineConstraints< number >(), 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.
CGAL::Exact_predicates_exact_constructions_kernel_with_sqrt K
DataComponentInterpretation
@ component_is_part_of_vector
void approximate(SynchronousIterators< std::tuple< typename DoFHandler< dim, spacedim >::active_cell_iterator, Vector< float >::iterator > > const &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.
double norm(const FEValuesBase< dim > &fe, const ArrayView< const std::vector< Tensor< 1, dim > > > &Du)
Point< spacedim > point(const gp_Pnt &p, const double tolerance=1e-10)
SymmetricTensor< 2, dim, Number > E(const Tensor< 2, dim, Number > &F)
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 call(const std::function< RT()> &function, internal::return_value< RT > &ret_val)
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)
static constexpr double PI
::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