Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
cls_scratch_data.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>
5
7
8template <int dim>
9void
11{
12 // Initialize size of arrays
13 this->n_q_points = fe_values_cls.get_quadrature().size();
14 this->n_dofs = fe_values_cls.get_fe().n_dofs_per_cell();
15
16 // Initialize arrays related to quadrature
17 this->JxW.reinit(n_q_points);
18
19 // Initialize arrays related to velocity and pressure
20 this->velocities_fd.first_vector_component = 0;
21 // Velocity
22 this->velocity_values = std::vector<Tensor<1, dim>>(this->n_q_points);
23 this->previous_velocity_values = std::vector<std::vector<Tensor<1, dim>>>(
25 std::vector<Tensor<1, dim>>(this->n_q_points));
27 std::vector<Tensor<2, dim>>(this->n_q_points);
28 this->velocity_divergences = std::vector<double>(n_q_points);
29
30 this->present_phase_values = std::vector<double>(this->n_q_points);
31 this->phase_gradients = std::vector<Tensor<1, dim>>(this->n_q_points);
33 std::vector<Tensor<1, dim>>(this->n_q_points);
34
35 this->phase_laplacians = std::vector<double>(this->n_q_points);
36
37 // Velocity for BDF schemes
39 std::vector<std::vector<double>>(maximum_number_of_previous_solutions(),
40 std::vector<double>(this->n_q_points));
41
42 // Initialize arrays related to shape functions
43 this->phi.reinit(n_q_points, n_dofs);
44 this->grad_phi.reinit(n_q_points, n_dofs);
45 this->hess_phi.reinit(n_q_points, n_dofs);
46 this->laplacian_phi.reinit(n_q_points, n_dofs);
47}
48
49template class CLSScratchData<2>;
50template class CLSScratchData<3>;
unsigned int maximum_number_of_previous_solutions()
Get the maximum number of previous time steps supposed by the BDF schemes implemented in Lethe.
Definition bdf.h:84
Store the information required by the assembly procedure for a CLS free surface equation....
Table< 2, Tensor< 2, dim > > hess_phi
std::vector< double > velocity_divergences
Table< 2, Tensor< 1, dim > > grad_phi
std::vector< Tensor< 2, dim > > velocity_gradient_values
Table< 1, double > JxW
FEValues< dim > fe_values_cls
FEValuesExtractors::Vector velocities_fd
Table< 2, double > laplacian_phi
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
std::vector< std::vector< Tensor< 1, dim > > > previous_velocity_values
void allocate() override
Allocates the memory for the scratch.
unsigned int n_q_points
std::vector< Tensor< 1, dim > > phase_gradients