Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
cls_assemblers.cc
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) 2021-2026 The Lethe Authors
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
3
4#include <core/bdf.h>
6
8#include <solvers/copy_data.h>
9
10#include <deal.II/fe/fe_interface_values.h>
11
12template <int dim>
13void
16{
17 // Scheme and physical properties
18 const auto method = this->simulation_control->get_assembly_method();
19
20 // Loop and quadrature information
21 const auto &JxW_vec = scratch_data.JxW;
22 const unsigned int n_q_points = scratch_data.n_q_points;
23 const unsigned int n_dofs = scratch_data.n_dofs;
24 const double h = scratch_data.cell_size;
25
26 // Time steps and inverse time steps which is used for stabilization constant
27 std::vector<double> time_steps_vector =
28 this->simulation_control->get_time_steps_vector();
29 const double dt = time_steps_vector[0];
30 const double sdt = 1. / dt;
31
32 // Add a small diffusivity, used to artificially diffuse CLS
33 const double diffusivity = this->cls_parameters.diffusivity;
34
35 // Copy data elements
36 auto &strong_jacobian_vec = copy_data.strong_jacobian;
37 auto &local_matrix = copy_data.local_matrix;
38
39 // Assemble local matrix and right-hand side
40 for (unsigned int q = 0; q < n_q_points; ++q)
41 {
42 // Gather into local variables the relevant fields
43 const Tensor<1, dim> velocity = scratch_data.velocity_values[q];
44 const double velocity_divergence = scratch_data.velocity_divergences[q];
45
46 // Store JxW in local variable for faster access
47 const double JxW = JxW_vec[q];
48
49 // Define tolerance to avoid division by zero
50 const double tolerance = 1e-12;
51
52 // Compute the velocity magnitude for the stabilization parameter and the
53 // compression term for the phase indicator
54 const double u_mag = std::max(velocity.norm(), tolerance);
55
56 // Calculation of the GLS stabilization parameter. The
57 // stabilization parameter used is different if the simulation is
58 // steady or unsteady. In the unsteady case, it includes the value
59 // of the time step. Hypothesis: advection dominated problem
60 // (Pe>3) [Bochev et al., Stability of the SUPG finite element
61 // method for transient advection-diffusion problems, CMAME 2004]
62 const double tau =
63 is_steady(method) ?
64 1. / std::sqrt(
65 Utilities::fixed_power<2>(2. * u_mag / h) +
66 9 * Utilities::fixed_power<2>(4 * diffusivity / (h * h))) :
67 1. /
68 std::sqrt(Utilities::fixed_power<2>(sdt) +
69 Utilities::fixed_power<2>(2. * u_mag / h) +
70 9 * Utilities::fixed_power<2>(4 * diffusivity / (h * h)));
71
72 for (unsigned int j = 0; j < n_dofs; ++j)
73 {
74 const auto phi_phase_j = scratch_data.phi[q][j];
75 const auto grad_phi_phase_j = scratch_data.grad_phi[q][j];
76 const auto laplacian_phi_phase_j = scratch_data.laplacian_phi[q][j];
77
78 // Strong Jacobian associated with the GLS stabilization
79 strong_jacobian_vec[q][j] +=
80 velocity * grad_phi_phase_j - diffusivity * laplacian_phi_phase_j;
81
82 if (compressible)
83 strong_jacobian_vec[q][j] += phi_phase_j * velocity_divergence;
84 }
85
86 for (unsigned int i = 0; i < n_dofs; ++i)
87 {
88 const auto phi_phase_i = scratch_data.phi[q][i];
89 const auto grad_phi_phase_i = scratch_data.grad_phi[q][i];
90
91
92 for (unsigned int j = 0; j < n_dofs; ++j)
93 {
94 const auto phi_phase_j = scratch_data.phi[q][j];
95 const auto grad_phi_phase_j = scratch_data.grad_phi[q][j];
96
97 // Weak form for advection-diffusion:
98 // u * grad(phase) + phase * grad(u) - diffusivity *
99 // laplacian(phase) = 0
100 local_matrix(i, j) +=
101 (phi_phase_i * velocity * grad_phi_phase_j +
102 diffusivity * grad_phi_phase_i * grad_phi_phase_j) *
103 JxW;
104
105 // Add compressibility term if the CLS is compressible
106 if (compressible)
107 local_matrix(i, j) +=
108 phi_phase_i * phi_phase_j * velocity_divergence * JxW;
109
110 // Addition to the cell matrix for GLS stabilization
111 local_matrix(i, j) += tau * strong_jacobian_vec[q][j] *
112 (grad_phi_phase_i * velocity) * JxW;
113 }
114 }
115 } // end loop on quadrature points
116}
117
118
119template <int dim>
120void
122 StabilizedMethodsCopyData &copy_data)
123{
124 // Scheme and physical properties
125 const auto method = this->simulation_control->get_assembly_method();
126
127 // Add a small diffusivity, used to artificially diffuse CLS
128 const double diffusivity = this->cls_parameters.diffusivity;
129
130 // Loop and quadrature information
131 const auto &JxW_vec = scratch_data.JxW;
132 const unsigned int n_q_points = scratch_data.n_q_points;
133 const unsigned int n_dofs = scratch_data.n_dofs;
134 const double h = scratch_data.cell_size;
135
136 // Time steps and inverse time steps which is used for stabilization constant
137 std::vector<double> time_steps_vector =
138 this->simulation_control->get_time_steps_vector();
139 const double dt = time_steps_vector[0];
140 const double sdt = 1. / dt;
141
142 // Copy data elements
143 auto &strong_residual_vec = copy_data.strong_residual;
144 auto &local_rhs = copy_data.local_rhs;
145
146 // Assemble local matrix and right-hand side
147 for (unsigned int q = 0; q < n_q_points; ++q)
148 {
149 // Gather into local variables the relevant fields
150 const double phase = scratch_data.present_phase_values[q];
151 const Tensor<1, dim> phase_gradient = scratch_data.phase_gradients[q];
152 const double phase_laplacians = scratch_data.phase_laplacians[q];
153 const Tensor<1, dim> velocity = scratch_data.velocity_values[q];
154 const double velocity_divergence = scratch_data.velocity_divergences[q];
155
156 // Store JxW in local variable for faster access;
157 const double JxW = JxW_vec[q];
158
159 // Define tolerance to avoid division by zero
160 const double tolerance = 1e-12;
161
162 // Compute the velocity magnitude for the stabilization parameter
163 const double u_mag = std::max(velocity.norm(), tolerance);
164
165 // Calculation of the GLS stabilization parameter. The
166 // stabilization parameter used is different if the simulation is
167 // steady or unsteady. In the unsteady case, it includes the value
168 // of the time step. Hypothesis: advection dominated problem
169 // (Pe>3) [Bochev et al., Stability of the SUPG finite element
170 // method for transient advection-diffusion problems, CMAME 2004]
171 const double tau =
172 is_steady(method) ?
173 1. / std::sqrt(
174 Utilities::fixed_power<2>(2. * u_mag / h) +
175 9 * Utilities::fixed_power<2>(4 * diffusivity / (h * h))) :
176 1. /
177 std::sqrt(Utilities::fixed_power<2>(sdt) +
178 Utilities::fixed_power<2>(2. * u_mag / h) +
179 9 * Utilities::fixed_power<2>(4 * diffusivity / (h * h)));
180
181 // Calculate the strong residual for GLS stabilization
182 strong_residual_vec[q] +=
183 velocity * phase_gradient - diffusivity * phase_laplacians;
184
185 if (compressible)
186 strong_residual_vec[q] += phase * velocity_divergence;
187
188 for (unsigned int i = 0; i < n_dofs; ++i)
189 {
190 const auto phi_phase_i = scratch_data.phi[q][i];
191 const auto grad_phi_phase_i = scratch_data.grad_phi[q][i];
192
193 // rhs for: u * grad(phase) + phase * grad(u) - diffusivity *
194 // laplacian(phase) = 0
195 local_rhs(i) -= (phi_phase_i * velocity * phase_gradient +
196 diffusivity * grad_phi_phase_i * phase_gradient) *
197 JxW;
198
199 if (compressible)
200 local_rhs(i) -= phi_phase_i * phase * velocity_divergence * JxW;
201
202 local_rhs(i) -=
203 tau * (strong_residual_vec[q] * (grad_phi_phase_i * velocity)) *
204 JxW;
205 }
206 }
207}
208
209template class CLSAssemblerCore<2>;
210template class CLSAssemblerCore<3>;
211
212
213template <int dim>
214void
216 StabilizedMethodsCopyData &copy_data)
217{
218 // Loop and quadrature information
219 const auto &JxW = scratch_data.JxW;
220 const unsigned int n_q_points = scratch_data.n_q_points;
221 const unsigned int n_dofs = scratch_data.n_dofs;
222
223 // Copy data elements
224 auto &strong_jacobian = copy_data.strong_jacobian;
225 auto &strong_residual = copy_data.strong_residual;
226 auto &local_matrix = copy_data.local_matrix;
227
228 // Time stepping information
229 const auto method = this->simulation_control->get_assembly_method();
230 // Vector for the BDF coefficients
231 const Vector<double> &bdf_coefs =
232 this->simulation_control->get_bdf_coefficients();
233 std::vector<double> phase_value(1 + number_of_previous_solutions(method));
234
235 // Loop over the quadrature points
236 for (unsigned int q = 0; q < n_q_points; ++q)
237 {
238 phase_value[0] = scratch_data.present_phase_values[q];
239
240 for (unsigned int p = 0; p < number_of_previous_solutions(method); ++p)
241 phase_value[p + 1] = scratch_data.previous_phase_values[p][q];
242
243
244 for (unsigned int p = 0; p < number_of_previous_solutions(method) + 1;
245 ++p)
246 {
247 strong_residual[q] += (bdf_coefs[p] * phase_value[p]);
248 }
249
250 for (unsigned int j = 0; j < n_dofs; ++j)
251 {
252 strong_jacobian[q][j] += bdf_coefs[0] * scratch_data.phi[q][j];
253 }
254
255
256 for (unsigned int i = 0; i < n_dofs; ++i)
257 {
258 const auto phi_phase_i = scratch_data.phi[q][i];
259 for (unsigned int j = 0; j < n_dofs; ++j)
260 {
261 const auto phi_phase_j = scratch_data.phi[q][j];
262
263 local_matrix(i, j) +=
264 phi_phase_j * phi_phase_i * bdf_coefs[0] * JxW[q];
265 }
266 }
267 }
268}
269
270template <int dim>
271void
273 StabilizedMethodsCopyData &copy_data)
274{
275 // Loop and quadrature information
276 const auto &JxW = scratch_data.JxW;
277 const unsigned int n_q_points = scratch_data.n_q_points;
278 const unsigned int n_dofs = scratch_data.n_dofs;
279
280 // Copy data elements
281 auto &strong_residual = copy_data.strong_residual;
282 auto &local_rhs = copy_data.local_rhs;
283
284 // Time stepping information
285 const auto method = this->simulation_control->get_assembly_method();
286 // Vector for the BDF coefficients
287 const Vector<double> &bdf_coefs =
288 this->simulation_control->get_bdf_coefficients();
289 std::vector<double> phase_value(1 + number_of_previous_solutions(method));
290
291 // Loop over the quadrature points
292 for (unsigned int q = 0; q < n_q_points; ++q)
293 {
294 phase_value[0] = scratch_data.present_phase_values[q];
295
296 for (unsigned int p = 0; p < number_of_previous_solutions(method); ++p)
297 phase_value[p + 1] = scratch_data.previous_phase_values[p][q];
298
299 for (unsigned int p = 0; p < number_of_previous_solutions(method) + 1;
300 ++p)
301 {
302 strong_residual[q] += (bdf_coefs[p] * phase_value[p]);
303 }
304
305 for (unsigned int i = 0; i < n_dofs; ++i)
306 {
307 const double phi_phase_i = scratch_data.phi[q][i];
308 double local_rhs_i = 0;
309 for (unsigned int p = 0; p < number_of_previous_solutions(method) + 1;
310 ++p)
311 {
312 local_rhs_i -= bdf_coefs[p] * (phase_value[p] * phi_phase_i);
313 }
314 local_rhs(i) += local_rhs_i * JxW[q];
315 }
316 }
317}
318
319template class CLSAssemblerBDF<2>;
320template class CLSAssemblerBDF<3>;
321
322
323template <int dim>
324void
326 const CLSScratchData<dim> &scratch_data,
327 StabilizedMethodsCopyData &copy_data)
328{
329 // Loop and quadrature information
330 const auto &JxW_vec = scratch_data.JxW;
331 const unsigned int n_q_points = scratch_data.n_q_points;
332 const unsigned int n_dofs = scratch_data.n_dofs;
333 const double h = scratch_data.cell_size;
334
335 // Copy data elements
336 auto &local_matrix = copy_data.local_matrix;
337
338 // Assemble local matrix
339 for (unsigned int q = 0; q < n_q_points; ++q)
340 {
341 // Gather into local variables the relevant fields for faster access
342 const Tensor<1, dim> velocity = scratch_data.velocity_values[q];
343 const double JxW = JxW_vec[q];
344
345 // We use the previous phase gradient for the shock capture (explicit)
346 const Tensor<1, dim> previous_phase_gradient =
347 scratch_data.previous_phase_gradients[q];
348
349 // Define a tolerance to avoid division by zero
350 const double tolerance = 1e-12;
351
352 // Compute the velocity magnitude and phase gradient norm for the
353 // stabilization term
354 const double velocity_norm = velocity.norm();
355 const double phase_gradient_norm = previous_phase_gradient.norm();
356
357 // In Tezduyar 2003, this is denoted r in equation (67).
358 Tensor<1, dim> gradient_unit_vector =
359 previous_phase_gradient / (phase_gradient_norm + tolerance);
360
361 // We remove the diffusion aligned with the velocity as is done in the
362 // original article. In Tezduyar 2003, this is denoted s in equation (67).
363 Tensor<1, dim> velocity_unit_vector =
364 velocity / (velocity_norm + tolerance);
365
366 // Directionality tensor describing [rr - (r⋅s)^2*ss]
367 const Tensor<2, dim> dir_tensor =
368 outer_product(gradient_unit_vector, gradient_unit_vector) -
369 ((gradient_unit_vector * velocity_unit_vector) *
370 outer_product(velocity_unit_vector, velocity_unit_vector));
371
372 // Compute the artificial viscosity of the shock capture
373 const double nu_dcdd =
374 (diffusion_constant * h * h) * velocity.norm() * phase_gradient_norm;
375
376 // Assemble DCDD shock capturing contributions
377 for (unsigned int i = 0; i < n_dofs; ++i)
378 {
379 const auto grad_phi_phase_i = scratch_data.grad_phi[q][i];
380
381 for (unsigned int j = 0; j < n_dofs; ++j)
382 {
383 const auto grad_phi_phase_j = scratch_data.grad_phi[q][j];
384 local_matrix(i, j) +=
385 (nu_dcdd * scalar_product(grad_phi_phase_i,
386 dir_tensor * grad_phi_phase_j)) *
387 JxW;
388 }
389 }
390 }
391}
392
393template <int dim>
394void
396 const CLSScratchData<dim> &scratch_data,
397 StabilizedMethodsCopyData &copy_data)
398{
399 // Loop and quadrature information
400 const auto &JxW_vec = scratch_data.JxW;
401 const unsigned int n_q_points = scratch_data.n_q_points;
402 const unsigned int n_dofs = scratch_data.n_dofs;
403 const double h = scratch_data.cell_size;
404
405 // Copy data elements
406 auto &local_rhs = copy_data.local_rhs;
407
408 // Assemble local right-hand side (rhs)
409 for (unsigned int q = 0; q < n_q_points; ++q)
410 {
411 // Gather into local variables the relevant fields for faster access
412 const Tensor<1, dim> phase_gradient = scratch_data.phase_gradients[q];
413 const Tensor<1, dim> velocity = scratch_data.velocity_values[q];
414 const double JxW = JxW_vec[q];
415
416 // We use the previous phase gradient for the shock capture (explicit)
417 const Tensor<1, dim> previous_phase_gradient =
418 scratch_data.previous_phase_gradients[q];
419
420 // Define a tolerance to avoid division by zero
421 const double tolerance = 1e-12;
422
423 // Compute the velocity magnitude and phase gradient norm for the
424 // stabilization term
425 const double velocity_norm = velocity.norm();
426 const double phase_gradient_norm = previous_phase_gradient.norm();
427
428 // In Tezduyar 2003, this is denoted r in equation (67).
429 Tensor<1, dim> gradient_unit_vector =
430 previous_phase_gradient / (phase_gradient_norm + tolerance);
431
432 // We remove the diffusion aligned with the velocity as is done in the
433 // original article. In Tezduyar 2003, this is denoted s in equation (67).
434 Tensor<1, dim> velocity_unit_vector =
435 velocity / (velocity_norm + tolerance);
436
437 // Directionality tensor describing [rr - (r⋅s)^2*ss]
438 const Tensor<2, dim> dir_tensor =
439 outer_product(gradient_unit_vector, gradient_unit_vector) -
440 ((gradient_unit_vector * velocity_unit_vector) *
441 outer_product(velocity_unit_vector, velocity_unit_vector));
442
443 // Compute the artificial viscosity of the shock capture
444 const double nu_dcdd =
445 (diffusion_constant * h * h) * velocity.norm() * phase_gradient_norm;
446
447 // Assemble DCDD shock capturing contributions
448 for (unsigned int i = 0; i < n_dofs; ++i)
449 {
450 const auto grad_phi_phase_i = scratch_data.grad_phi[q][i];
451 local_rhs(i) -=
452 nu_dcdd *
453 scalar_product(grad_phi_phase_i, dir_tensor * phase_gradient) * JxW;
454 }
455 }
456}
457
460
461
462template <int dim>
463void
465 const CLSScratchData<dim> &scratch_data,
466 StabilizedMethodsCopyData &copy_data)
467{
468 // Loop and quadrature information
469 const auto &JxW_vec = scratch_data.JxW;
470 const unsigned int n_q_points = scratch_data.n_q_points;
471 const unsigned int n_dofs = scratch_data.n_dofs;
472
473 // Copy data elements
474 auto &local_matrix = copy_data.local_matrix;
475
476 // Assembling local matrix
477 for (unsigned int q = 0; q < n_q_points; ++q)
478 {
479 // Gather into local variables the relevant fields
480 const Tensor<1, dim> velocity = scratch_data.velocity_values[q];
481
482 // Store JxW in local variable for faster access;
483 const double JxW = JxW_vec[q];
484
485 for (unsigned int i = 0; i < n_dofs; ++i)
486 {
487 const auto grad_phi_phase_i = scratch_data.grad_phi[q][i];
488
489 for (unsigned int j = 0; j < n_dofs; ++j)
490 {
491 const auto phi_phase_j = scratch_data.phi[q][j];
492
493 // Weak form of : u * grad(phi) =0
494 // Note that the advection term has been weakened for it to appear
495 // explicitly in the weak form as a boundary term.
496 local_matrix(i, j) +=
497 (-grad_phi_phase_i * velocity * phi_phase_j) * JxW;
498 }
499 }
500 } // end loop on quadrature points
501}
502
503
504template <int dim>
505void
507 StabilizedMethodsCopyData &copy_data)
508{
509 // Loop and quadrature information
510 const auto &JxW_vec = scratch_data.JxW;
511 const unsigned int n_q_points = scratch_data.n_q_points;
512 const unsigned int n_dofs = scratch_data.n_dofs;
513
514 // Copy data elements
515 auto &local_rhs = copy_data.local_rhs;
516
517 // Assembling local right-hand side
518 for (unsigned int q = 0; q < n_q_points; ++q)
519 {
520 // Gather into local variables the relevant fields
521 const double phase_value = scratch_data.present_phase_values[q];
522 const Tensor<1, dim> velocity = scratch_data.velocity_values[q];
523
524 // Store JxW in local variable for faster access;
525 const double JxW = JxW_vec[q];
526
527 for (unsigned int i = 0; i < n_dofs; ++i)
528 {
529 const auto grad_phi_phase_i = scratch_data.grad_phi[q][i];
530
531 // Linearized weak form of the strong problem u * grad(phi) =0
532 // Note that the advection term has been weakened for it to appear
533 // explicitly in the weak form as a boundary term.
534 local_rhs(i) -= (-grad_phi_phase_i * velocity * phase_value) * JxW;
535 }
536 } // end loop on quadrature points
537}
538
539template class CLSAssemblerDGCore<2>;
540template class CLSAssemblerDGCore<3>;
541
542
543
544template <int dim>
545void
548{
549 const FEInterfaceValues<dim> &fe_iv = scratch_data.fe_interface_values_cls;
550 const auto &q_points = fe_iv.get_quadrature_points();
551 auto &copy_data_face = copy_data.face_data.back();
552 const unsigned int n_dofs = fe_iv.n_current_interface_dofs();
553
554
555 const std::vector<double> &JxW = fe_iv.get_JxW_values();
556 const std::vector<Tensor<1, dim>> &normals = fe_iv.get_normal_vectors();
557
558 for (unsigned int q = 0; q < q_points.size(); ++q)
559 {
560 const double velocity_dot_n =
561 scratch_data.face_velocity_values[q] * normals[q];
562 for (unsigned int i = 0; i < n_dofs; ++i)
563 for (unsigned int j = 0; j < n_dofs; ++j)
564 {
565 // Assembles symetric interior penalty method
566 // There is no penalty coefficient here since the CLS equation
567 // does not have diffusivity. The only flux that remain
568 // is the upwinded advective flux.
569 // ( [[φ]] ,u·n φ_upwind )
570 copy_data_face.face_matrix(i, j) +=
571 fe_iv.jump_in_shape_values(i, q) *
572 fe_iv.shape_value((velocity_dot_n > 0.), j, q) * velocity_dot_n *
573 JxW[q];
574 }
575 }
576}
577
578template <int dim>
579void
582{
583 const FEInterfaceValues<dim> &fe_iv = scratch_data.fe_interface_values_cls;
584 const auto &q_points = fe_iv.get_quadrature_points();
585 const unsigned int n_dofs = fe_iv.n_current_interface_dofs();
586
587 auto &copy_data_face = copy_data.face_data.back();
588
589 const std::vector<double> &JxW = fe_iv.get_JxW_values();
590 const std::vector<Tensor<1, dim>> &normals = fe_iv.get_normal_vectors();
591
592 for (unsigned int q = 0; q < q_points.size(); ++q)
593 {
594 const double velocity_dot_n =
595 scratch_data.face_velocity_values[q] * normals[q];
596 for (unsigned int i = 0; i < n_dofs; ++i)
597 {
598 // Assemble advection terms with upwinding
599 // If velocity_dot_n (u·n) > 0, then the upwind term needs to come
600 // from here. Otherwise, it needs to come from there.
601 if (velocity_dot_n > 0)
602 {
603 copy_data_face.face_rhs(i) -=
604 fe_iv.jump_in_shape_values(i, q) // [\phi_i]
605 * scratch_data.values_here[q] // \phi_i^{upwind}
606 * velocity_dot_n // (u . n)
607 * JxW[q]; // dx
608 }
609 else
610 {
611 copy_data_face.face_rhs(i) -=
612 fe_iv.jump_in_shape_values(i, q) // [\phi_i]
613 * scratch_data.values_there[q] // \phi_i^{upwind}
614 * velocity_dot_n // (u . n)
615 * JxW[q]; // dx
616 }
617 }
618 }
619}
620
621template class CLSAssemblerSIPG<2>;
622template class CLSAssemblerSIPG<3>;
unsigned int number_of_previous_solutions(const Parameters::SimulationControl::TimeSteppingMethod method)
Get the number of previous time steps for a specific BDF scheme.
Definition bdf.h:97
Class that assembles the transient time arising from BDF time integration for the CLS equation....
virtual void assemble_rhs(const CLSScratchData< dim > &scratch_data, StabilizedMethodsCopyData &copy_data) override
assemble_rhs Assembles the rhs
const std::shared_ptr< SimulationControl > simulation_control
virtual void assemble_matrix(const CLSScratchData< dim > &scratch_data, StabilizedMethodsCopyData &copy_data) override
assemble_matrix Assembles the matrix
Class that assembles the core of the CLS solver. According to the following weak form: with an SUPG ...
const Parameters::CLS cls_parameters
const bool compressible
const std::shared_ptr< SimulationControl > simulation_control
virtual void assemble_matrix(const CLSScratchData< dim > &scratch_data, StabilizedMethodsCopyData &copy_data) override
assemble_matrix Assembles the matrix
virtual void assemble_rhs(const CLSScratchData< dim > &scratch_data, StabilizedMethodsCopyData &copy_data) override
assemble_rhs Assembles the rhs
Assemble the Discontinuity-Capturing Directional Dissipation (DCDD) stabilization term for the CLS ph...
const double diffusion_constant
Diffusion coefficient.
virtual void assemble_matrix(const CLSScratchData< dim > &scratch_data, StabilizedMethodsCopyData &copy_data) override
Assemble the matrix.
virtual void assemble_rhs(const CLSScratchData< dim > &scratch_data, StabilizedMethodsCopyData &copy_data) override
Assemble the right-hand side (rhs).
Class that assembles the core (cells) of the CLS equation for DG elements. This class assembles the w...
virtual void assemble_rhs(const CLSScratchData< dim > &scratch_data, StabilizedMethodsCopyData &copy_data) override
Assemble the rhs.
virtual void assemble_matrix(const CLSScratchData< dim > &scratch_data, StabilizedMethodsCopyData &copy_data) override
Assemble the matrix.
Assembles the symmetric interior penalty Galerkin (SIPG) method (or Nitsche's method) for internal fa...
virtual void assemble_matrix(const CLSScratchData< dim > &scratch_data, StabilizedDGMethodsCopyData &copy_data) override
Interface to call the matrix assembly.
virtual void assemble_rhs(const CLSScratchData< dim > &scratch_data, StabilizedDGMethodsCopyData &copy_data) override
Interface for the call to rhs.
Store the information required by the assembly procedure for a CLS free surface equation....
std::vector< Tensor< 1, dim > > face_velocity_values
std::vector< double > values_there
std::vector< double > velocity_divergences
Table< 2, Tensor< 1, dim > > grad_phi
Table< 1, double > JxW
Table< 2, double > laplacian_phi
FEInterfaceValues< dim > fe_interface_values_cls
std::vector< double > values_here
std::vector< double > phase_laplacians
std::vector< std::vector< double > > previous_phase_values
Table< 2, double > phi
unsigned int n_dofs
std::vector< double > present_phase_values
std::vector< Tensor< 1, dim > > previous_phase_gradients
std::vector< Tensor< 1, dim > > velocity_values
unsigned int n_q_points
std::vector< Tensor< 1, dim > > phase_gradients
Responsible for storing the information calculated using the discontinuous galerkin (DG) assembly of ...
Definition copy_data.h:127
std::vector< CopyDataFace > face_data
Definition copy_data.h:149
Class responsible for storing the information calculated using the assembly of stabilized scalar equa...
Definition copy_data.h:67
Vector< double > local_rhs
Definition copy_data.h:105
Vector< double > strong_residual
Definition copy_data.h:107
FullMatrix< double > local_matrix
Definition copy_data.h:104
std::vector< Vector< double > > strong_jacobian
Definition copy_data.h:108
@ phase
Phase indicator scalar field from CLS.
@ velocity
Velocity vector field from fluid dynamics.
bool is_steady(const Parameters::SimulationControl::TimeSteppingMethod method)
Determines if the time integration method is a steady-state method.