PolyFEM
Loading...
Searching...
No Matches
AssemblerData.hpp
Go to the documentation of this file.
1#pragma once
2
4
5#include <functional>
6#include <vector>
7
8namespace polyfem::assembler
9{
14 {
15 public:
16 using Values = std::vector<std::reference_wrapper<const ElementAssemblyValues>>;
17 using Coefficients = std::vector<std::reference_wrapper<const Eigen::VectorXd>>;
18
23 const double t,
24 const double dt,
25 const QuadratureVector &da)
26 : vals_(std::move(vals)),
27 x_(std::move(x)),
28 x_prev_(std::move(x_prev)),
29 t(t),
30 dt(dt),
31 da(da)
32 {
33 assert(vals_.size() == x_.size());
34 assert(x_prev_.empty() || vals_.size() == x_prev_.size());
35 }
36
37 virtual ~MultiSpacesNLAssemblerData() = default;
38
39 int n_spaces() const { return int(vals_.size()); }
40 const ElementAssemblyValues &vals(const int space) const { return vals_.at(space).get(); }
41 const Eigen::VectorXd &x(const int space) const { return x_.at(space).get(); }
42 const Eigen::VectorXd &x_prev(const int space) const { return x_prev_.at(space).get(); }
43
44 const double t;
45 const double dt;
47
48 private:
52 };
53
55 {
56 public:
59 const double t,
60 const double dt,
61 const Eigen::MatrixXd &x,
62 const Eigen::MatrixXd &x_prev,
63 const QuadratureVector &da)
64 : vals(vals), t(t), dt(dt), x(x), x_prev(x_prev), da(da)
65 {
66 }
67
69 const double t;
70 const double dt;
71 const Eigen::MatrixXd &x;
72 const Eigen::MatrixXd &x_prev;
74 };
75
77 {
78 public:
81 const double t,
82 int i, int j,
83 const QuadratureVector &da)
84 : vals(vals), t(t), i(i), j(j), da(da)
85 {
86 }
87
90
91 const double t;
93 const int i;
95 const int j;
98 };
99
101 {
102 public:
106 const double t,
107 int i, int j,
108 const QuadratureVector &da)
110 t(t), i(i), j(j), da(da)
111 {
112 }
113
118
119 const double t;
121 const int i;
123 const int j;
126 };
127
129 {
130 public:
134 const double t,
135 const double dt,
136 const Eigen::MatrixXd &x_phi,
137 const Eigen::MatrixXd &x_psi,
138 const Eigen::MatrixXd &x_phi_prev,
139 const Eigen::MatrixXd &x_psi_prev,
140 const QuadratureVector &da)
142 t(t), dt(dt),
145 da(da)
146 {
147 }
148
153
154 const double t;
155 const double dt;
156 const Eigen::MatrixXd &x_phi;
157 const Eigen::MatrixXd &x_psi;
158 const Eigen::MatrixXd &x_phi_prev;
159 const Eigen::MatrixXd &x_psi_prev;
162 };
163
165 {
166 public:
168 const double t,
169 const double dt,
170 const int el_id,
171 const Eigen::MatrixXd &local_pts,
172 const Eigen::MatrixXd &global_pts,
173 const Eigen::MatrixXd &grad_u_i)
175 {
176 }
177
178 const double t;
179 const double dt;
180 const int el_id;
181 const Eigen::MatrixXd &local_pts;
182 const Eigen::MatrixXd &global_pts;
183 const Eigen::MatrixXd &grad_u_i;
184 };
185
187 {
188 public:
190 const double t,
191 const int el_id,
192 const basis::ElementBases &bs,
194 const Eigen::MatrixXd &local_pts,
195 const Eigen::MatrixXd &fun)
197 {
198 }
199
200 const double t;
201 const int el_id;
204 const Eigen::MatrixXd &local_pts;
205 const Eigen::MatrixXd &fun;
206 };
207} // namespace polyfem::assembler
ElementAssemblyValues vals
Definition Assembler.cpp:25
int x
stores per element basis values at given quadrature points and geometric mapping
const ElementAssemblyValues & vals
stores the evaluation for that element
const QuadratureVector & da
contains both the quadrature weight and the change of metric in the integral
LinearAssemblerData(const ElementAssemblyValues &vals, const double t, int i, int j, const QuadratureVector &da)
MixedAssemblerData(const ElementAssemblyValues &psi_vals, const ElementAssemblyValues &phi_vals, const double t, int i, int j, const QuadratureVector &da)
const QuadratureVector & da
contains both the quadrature weight and the change of metric in the integral
const ElementAssemblyValues & phi_vals
stores the evaluation for that element
const ElementAssemblyValues & psi_vals
stores the evaluation for that element
MixedNonLinearAssemblerData(const ElementAssemblyValues &psi_vals, const ElementAssemblyValues &phi_vals, const double t, const double dt, const Eigen::MatrixXd &x_phi, const Eigen::MatrixXd &x_psi, const Eigen::MatrixXd &x_phi_prev, const Eigen::MatrixXd &x_psi_prev, const QuadratureVector &da)
const QuadratureVector & da
Contains both the quadrature weight and the change of metric in the integral.
const ElementAssemblyValues & phi_vals
Values for the first block, historically tensor velocity/displacement-like bases.
const ElementAssemblyValues & psi_vals
Values for the second block, historically scalar pressure-like bases.
Local data shared by assemblers involving an arbitrary number of FE spaces.
MultiSpacesNLAssemblerData(Values vals, Coefficients x, Coefficients x_prev, const double t, const double dt, const QuadratureVector &da)
std::vector< std::reference_wrapper< const Eigen::VectorXd > > Coefficients
const ElementAssemblyValues & vals(const int space) const
const Eigen::VectorXd & x_prev(const int space) const
const Eigen::VectorXd & x(const int space) const
std::vector< std::reference_wrapper< const ElementAssemblyValues > > Values
NonLinearAssemblerData(const ElementAssemblyValues &vals, const double t, const double dt, const Eigen::MatrixXd &x, const Eigen::MatrixXd &x_prev, const QuadratureVector &da)
OptAssemblerData(const double t, const double dt, const int el_id, const Eigen::MatrixXd &local_pts, const Eigen::MatrixXd &global_pts, const Eigen::MatrixXd &grad_u_i)
const basis::ElementBases & bs
OutputData(const double t, const int el_id, const basis::ElementBases &bs, const basis::ElementBases &gbs, const Eigen::MatrixXd &local_pts, const Eigen::MatrixXd &fun)
const Eigen::MatrixXd & fun
const Eigen::MatrixXd & local_pts
const basis::ElementBases & gbs
Stores the basis functions for a given element in a mesh (facet in 2d, cell in 3d).
Used for test only.
Eigen::Matrix< double, Eigen::Dynamic, 1, 0, MAX_QUAD_POINTS, 1 > QuadratureVector
Definition Types.hpp:17