You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
dof_handler.set_dirichlet_constraint(/* on = */ BoundaryAll, /* data = */ g);
104
104
105
105
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 :
dof_handler.set_dirichlet_constraint(/* on = */ BoundaryAll, /* data = */ g);
93
93
94
94
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:
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`).
117
117
118
118
We have now all the ingredients to assemble the stabilized bilinear forms :math:`\tilde a(u,v)` and :math:`\tilde F(v)`:
119
119
@@ -163,7 +163,7 @@ Upon discretization and imposition of boundary conditions, the solution of the d
163
163
// SUPG correction
164
164
CellDiameterDescriptor h_k(unit_square);
165
165
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
0 commit comments