Skip to content

Commit 9ceed66

Browse files
committed
update documentation
1 parent cd646aa commit 9ceed66

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

tutorials/tut_1.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,14 @@ We then define the forcing term as a plain :code:`ScalarField` togheter with the
9292
return -9*std::pow(p[0], 4) - 12*p[0]*p[0]*p[1]*p[1] + 3*p[0]*p[0] +
9393
2*p[1]*p[1] - 4*std::pow(p[1], 4) - 10;
9494
})> f;
95-
auto F = integral(unit_square, QS2D6P)(f * v);
95+
auto F = integral(unit_square, QS2DP4)(f * v);
9696
97-
Observe that we explicitly require an higher order quadrature specifying the 6 points quadrature formula :code:`QS2D6P` as second argument of the :code:`integral` function. Finally, we define non-homegeneous Dirichlet boundary conditions :math:`g(\boldsymbol{x}) = 3x^2 + 2y^2` on all the boundary of the domain
97+
Observe that we explicitly require an higher order quadrature specifying the quadrature formula :code:`QS2DP4` for the exact integration of order 4 polynomials as second argument of the :code:`integral` function. Finally, we define non-homegeneous Dirichlet boundary conditions :math:`g(\boldsymbol{x}) = 3x^2 + 2y^2` on all the boundary of the domain
9898

9999
.. code-block:: cpp
100100
101101
ScalarField<2, decltype([](const PointT& p) { return 3 * p[0] * p[0] + 2 * p[1] * p[1]; })> g;
102-
DofHandler<2, 2>& dof_handler = Vh.dof_handler();
102+
auto& dof_handler = Vh.dof_handler();
103103
dof_handler.set_dirichlet_constraint(/* on = */ BoundaryAll, /* data = */ g);
104104
105105
Recall that Dirichlet boundary conditions are implemented as constraints on the degrees of freedom of the linear system :math:`A \boldsymbol{c} = \boldsymbol{b}` deriving form the discretization of the variational problem, and that we must later enforce them on the pair :math:`(A, \boldsymbol{b})` before solving the linear system, using the :code:`enforce_constraints` method.
@@ -172,11 +172,11 @@ The code just assembles :code:`A1` and :code:`A2`, updates the right hand side :
172172
ScalarField<2, decltype([](const PointT& p) {
173173
return -9*std::pow(p[0], 4) - 12*p[0]*p[0]*p[1]*p[1] + 3*p[0]*p[0] + 2*p[1]*p[1] - 4*std::pow(p[1], 4) - 10;
174174
})> f;
175-
auto F = integral(unit_square, QS2D6P)(f * v);
175+
auto F = integral(unit_square, QS2DP4)(f * v);
176176

177177
// define dirichlet data
178178
ScalarField<2, decltype([](const PointT& p) { return 3 * p[0] * p[0] + 2 * p[1] * p[1]; })> g;
179-
DofHandler<2, 2>& dof_handler = Vh.dof_handler();
179+
auto& dof_handler = Vh.dof_handler();
180180
dof_handler.set_dirichlet_constraint(/* on = */ BoundaryAll, /* data = */ g);
181181
182182
// Newton scheme initialization (solve linearized problem with initial guess u = 0)

tutorials/tut_2.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ You can fix the time coordinate calling :code:`f.at(t)`. Subsequent calls of :co
8888
.. code-block:: cpp
8989
9090
ScalarField<2, decltype([](const PointT& p) { return 0; })> g;
91-
DofHandler<2, 2>& dof_handler = Vh.dof_handler();
91+
auto& dof_handler = Vh.dof_handler();
9292
dof_handler.set_dirichlet_constraint(/* on = */ BoundaryAll, /* data = */ g);
9393
9494
Finally, we fix the time step :math:`\Delta t`, set up room for the solution fixing the initial condition to :math:`u_0(\boldsymbol{x}) = 0` and discretizing once and for all the mass matrix :math:`M` and the stiff matrix :math:`\frac{M}{\Delta T} + \frac{1}{2} A`, togheter with the forcing term :math:`F(t)`. Since the matrix :math:`\frac{M}{\Delta T} + \frac{1}{2} A` is SPD and time-invariant, we factorize it outside the time integration loop using a Cholesky factorization:
@@ -145,7 +145,7 @@ Finally, the crank-nicolson time integration loop can start:
145145
})> f;
146146
// dirichlet data (homogeneous and fixed in time)
147147
ScalarField<2, decltype([](const PointT& p) { return 0; })> g;
148-
DofHandler<2, 2>& dof_handler = Vh.dof_handler();
148+
auto& dof_handler = Vh.dof_handler();
149149
dof_handler.set_dirichlet_constraint(/* on = */ BoundaryAll, /* data = */ g);
150150
151151
// crank-nicolson integration
@@ -238,7 +238,7 @@ The script is mostly similar to the Crank-Nicolson time-stepping scheme implemen
238238

239239
// dirichlet homoegeneous data (fixed in time)
240240
ScalarField<2, decltype([](const PointT& p) { return 0; })> g_D;
241-
DofHandler<2, 2>& dof_handler = Vh.dof_handler();
241+
auto& dof_handler = Vh.dof_handler();
242242
dof_handler.set_dirichlet_constraint(/* on = */ 0, /* data = */ g_D);
243243
// neumann inflow data
244244
SpaceTimeField<2, decltype([](const PointT& p, double t) { return p[1] * (1 - p[1]) * t * (0.5 - t); })> g_N;

tutorials/tut_5.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ In order to apply SUPG, let us first define the stabilization parameter :math:`\
9393
9494
CellDiameterDescriptor h_k(unit_square);
9595
double delta = 2.85;
96-
double b_norm = integral(unit_square, QS2D3P)(b.norm()); // transport field norm
96+
double b_norm = integral(unit_square, QS2DP2)(b.norm()); // transport field norm
9797
9898
auto tau_k = 0.5 * delta * h_k / b_norm; // stabilization parameter
9999
@@ -111,9 +111,9 @@ In order to apply SUPG, let us first define the stabilization parameter :math:`\
111111

112112
.. code-block:: cpp
113113
114-
double b_norm = integral(unit_square, QS2D3P)(b.norm());
114+
double b_norm = integral(unit_square, QS2DP2)(b.norm());
115115
116-
in the definition of the stablization parameter computes :math:`\int_{[0,1]^2} \| b \|_2` using a two dimensional 3 point simplex rule (:code:`QS2D3P`).
116+
in the definition of the stablization parameter computes :math:`\int_{[0,1]^2} \| b \|_2` using a two dimensional 3 point simplex rule (:code:`QS2DP2`).
117117

118118
We have now all the ingredients to assemble the stabilized bilinear forms :math:`\tilde a(u,v)` and :math:`\tilde F(v)`:
119119

@@ -163,7 +163,7 @@ Upon discretization and imposition of boundary conditions, the solution of the d
163163
// SUPG correction
164164
CellDiameterDescriptor h_k(unit_square);
165165
double delta = 2.85;
166-
double b_norm = integral(unit_square, QS2D3P)(b.norm()); // transport field norm
166+
double b_norm = integral(unit_square, QS2DP2)(b.norm()); // transport field norm
167167
auto tau_k = 0.5 * delta * h_k / b_norm; // stabilization parameter
168168
auto a_supg = a + integral(unit_square)(tau_k * (-mu * (dxx(u) + dyy(u)) + dot(b, grad(u)) + u) * dot(b, grad(v)));
169169
auto F_supg = F + integral(unit_square)(f * v + tau_k * f * dot(b, grad(v)));

0 commit comments

Comments
 (0)