21 #ifndef __SYSTEM_ASSEMBLER_H
22 #define __SYSTEM_ASSEMBLER_H
29 #include "DirichletBC.h"
30 #include "AssemblerBase.h"
36 class exterior_facet_integral;
37 class interior_facet_integral;
44 template<
typename T>
class ArrayView;
51 template<
typename T>
class MeshFunction;
65 std::shared_ptr<const Form> L,
66 std::vector<std::shared_ptr<const DirichletBC>> bcs);
71 std::vector<std::shared_ptr<const Form>> L,
72 std::vector<std::vector<std::shared_ptr<const DirichletBC>>> bcs);
77 std::vector<std::shared_ptr<const Form>> L,
78 std::vector<std::shared_ptr<const DirichletBC>> bcs0,
79 std::vector<std::shared_ptr<const DirichletBC>> bcs1);
101 void assemble(std::vector<std::shared_ptr<GenericMatrix>> A,
102 std::vector<std::shared_ptr<GenericVector>> b);
110 Scratch(
const Form& a,
const Form& L);
112 std::array<std::vector<double>, 2> Ae;
116 static void check_forms(std::vector<std::shared_ptr<const Form>> a,
117 std::vector<std::shared_ptr<const Form>> L);
122 std::shared_ptr<const Form> a,
123 std::shared_ptr<const Form> L,
124 std::vector<std::vector<std::shared_ptr<const DirichletBC>>> bcs,
128 std::vector<std::shared_ptr<const Form>> _a;
129 std::vector<std::shared_ptr<const Form>> _l;
132 std::vector<std::vector<std::shared_ptr<const DirichletBC>>> _bcs;
134 static void cell_wise_assembly(
135 std::array<GenericTensor*, 2>& tensors,
136 std::array<UFC*, 2>& ufc,
138 const std::vector<DirichletBC::Map>& boundary_values,
143 static void facet_wise_assembly(
144 std::array<GenericTensor*, 2>& tensors,
145 std::array<UFC*, 2>& ufc,
147 const std::vector<DirichletBC::Map>& boundary_values,
154 static void compute_exterior_facet_tensor(
155 std::array<std::vector<double>, 2>& Ae,
156 std::array<UFC*, 2>& ufc,
158 std::vector<double>& coordinate_dofs,
159 const std::array<bool, 2>& tensor_required_cell,
160 const std::array<bool, 2>& tensor_required_facet,
163 const std::array<const ufc::cell_integral*, 2>& cell_integrals,
164 const std::array<const ufc::exterior_facet_integral*, 2>& exterior_facet_integrals,
165 const bool compute_cell_tensor);
169 static void compute_interior_facet_tensor(
170 std::array<UFC*, 2>& ufc,
171 std::array<ufc::cell, 2>& ufc_cell,
172 std::array<std::vector<double>, 2>& coordinate_dofs,
173 const std::array<bool, 2>& tensor_required_cell,
174 const std::array<bool, 2>& tensor_required_facet,
175 const std::array<Cell, 2>& cell,
176 const std::array<std::size_t, 2>& local_facet,
177 const bool facet_owner,
178 const std::array<const ufc::cell_integral*, 2>& cell_integrals,
179 const std::array<const ufc::interior_facet_integral*, 2>& interior_facet_integrals,
180 const std::array<std::size_t, 2>& matrix_size,
181 const std::size_t vector_size,
182 const std::array<bool, 2> compute_cell_tensor);
186 static void matrix_block_add(
188 std::vector<double>& Ae,
189 std::vector<double>& macro_A,
190 const std::array<bool, 2>& add_local_tensor,
193 static void apply_bc(
double* A,
double* b,
194 const std::vector<DirichletBC::Map>& boundary_values,
198 bool check_functionspace_for_bc
199 (std::shared_ptr<const FunctionSpace> fs, std::shared_ptr<const DirichletBC> bc)
const;
209 const void* integral,
210 const std::vector<DirichletBC::Map>& boundary_values,
Definition: ArrayView.h:32
Provide some common functions used in assembler classes.
Definition: AssemblerBase.h:42
A Cell is a MeshEntity of topological codimension 0.
Definition: Cell.h:43
std::unordered_map< std::size_t, double > Map
map type used by DirichletBC
Definition: DirichletBC.h:130
A Facet is a MeshEntity of topological codimension 1.
Definition: Facet.h:40
This class defines a common interface for matrices.
Definition: GenericMatrix.h:47
A common interface for arbitrary rank tensors.
Definition: GenericTensor.h:49
This class defines a common interface for vectors.
Definition: GenericVector.h:48
Definition: SystemAssembler.h:60
void assemble(GenericMatrix &A, GenericVector &b)
Assemble system (A, b)
Definition: SystemAssembler.cpp:141
SystemAssembler(std::shared_ptr< const Form > a, std::shared_ptr< const Form > L, std::vector< std::shared_ptr< const DirichletBC >> bcs)
Constructor.
Definition: SystemAssembler.cpp:54