Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
physics_assemblers.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) 2021-2025 The Lethe Authors
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
3
4#ifndef lethe_physics_assemblers_h
5#define lethe_physics_assemblers_h
6
7/**
8 * @brief Base class for assembler objects of physics and subequations.
9 *
10 * @tparam ScratchDataType Type of scratch data object used for linear system
11 * assembly.
12 *
13 * @tparam CopyDataType Type of copy data object used for transferring from
14 * local system assembly to global system.
15 */
16template <typename ScratchDataType, typename CopyDataType>
18{
19public:
20 /**
21 * @brief Assemble the matrix.
22 *
23 * @param[in] scratch_data Scratch data containing the information required
24 * for system assembly.
25 * It is important to note that the scratch data has to have been re-inited
26 * before calling for matrix assembly.
27 *
28 * @param[in,out] copy_data Destination where the local_matrix is copied to.
29 */
30 virtual void
31 assemble_matrix(const ScratchDataType &scratch_data,
32 CopyDataType &copy_data) = 0;
33
34 /**
35 * @brief Assemble the right-hand side (rhs).
36 *
37 * @param[in] scratch_data Scratch data containing the information required
38 * for system assembly.
39 * It is important to note that the scratch data has to have been re-inited
40 * before calling for rhs assembly.
41 *
42 * @param[in,out] copy_data Destination where the local_rhs is copied to.
43 */
44 virtual void
45 assemble_rhs(const ScratchDataType &scratch_data,
46 CopyDataType &copy_data) = 0;
47
48 /**
49 * @brief Default destructor
50 */
51
52 virtual ~PhysicsAssemblerBase() = default;
53};
54
55
56/**
57 * @brief Base class for assembler objects of physics and subequations that require a face assembly.
58 * This type of assembler is generally used for DG equations.
59 *
60 * @tparam ScratchDataType Type of scratch data object used for face
61 * assembly.
62 *
63 * @tparam CopyDataType Type of copy data object used for transferring from
64 * local system assembly to global system.
65 */
66template <typename ScratchDataType, typename CopyDataType>
68{
69public:
70 /**
71 * @brief Interface for the call to matrix assembly
72 * @param[in] scratch_data Scratch data containing the physical solver
73 * information. It is important to note that the scratch data has to have been
74 * re-inited before calling for matrix assembly.
75 * @param[in,out] copy_data Destination where the local_rhs and local_matrix
76 * should be copied
77 */
78
79 virtual void
80 assemble_matrix(const ScratchDataType &scratch_data,
81 CopyDataType &copy_data) = 0;
82
83
84 /**
85 * @brief Interface for the call to rhs
86 * @param[in] scratch_data Scratch data containing the physical solver
87 * information. It is important to note that the scratch data has to have been
88 * re-inited before calling for matrix assembly.
89 * @param[in,out] copy_data Destination where the local_rhs and local_matrix
90 * should be copied
91 */
92
93 virtual void
94 assemble_rhs(const ScratchDataType &scratch_data,
95 CopyDataType &copy_data) = 0;
96
97 /**
98 * @brief Default destructor
99 */
100
101 virtual ~PhysicsFaceAssemblerBase() = default;
102};
103
104#endif
Base class for assembler objects of physics and subequations.
virtual ~PhysicsAssemblerBase()=default
Default destructor.
virtual void assemble_matrix(const ScratchDataType &scratch_data, CopyDataType &copy_data)=0
Assemble the matrix.
virtual void assemble_rhs(const ScratchDataType &scratch_data, CopyDataType &copy_data)=0
Assemble the right-hand side (rhs).
Base class for assembler objects of physics and subequations that require a face assembly....
virtual void assemble_rhs(const ScratchDataType &scratch_data, CopyDataType &copy_data)=0
Interface for the call to rhs.
virtual ~PhysicsFaceAssemblerBase()=default
Default destructor.
virtual void assemble_matrix(const ScratchDataType &scratch_data, CopyDataType &copy_data)=0
Interface for the call to matrix assembly.