11#ifndef BEMBEL_SRC_ANSATZSPACE_SUPERSPACE_HPP_
12#define BEMBEL_SRC_ANSATZSPACE_SUPERSPACE_HPP_
21template <
typename Derived>
56 phiPhi =
other.phiPhi;
57 phiPhiDx =
other.phiPhiDx;
58 phiPhiDy =
other.phiPhiDy;
59 phiTimesPhi =
other.phiTimesPhi;
61 divPhiTimesDivPhi =
other.divPhiTimesDivPhi;
62 polynomial_degree =
other.polynomial_degree;
63 polynomial_degree_plus_one_squared =
64 other.polynomial_degree_plus_one_squared;
78 phiPhi =
other.phiPhi;
79 phiPhiDx =
other.phiPhiDx;
80 phiPhiDy =
other.phiPhiDy;
81 phiTimesPhi =
other.phiTimesPhi;
83 divPhiTimesDivPhi =
other.divPhiTimesDivPhi;
84 polynomial_degree =
other.polynomial_degree;
85 polynomial_degree_plus_one_squared =
86 other.polynomial_degree_plus_one_squared;
101 phiPhi =
other.phiPhi;
102 phiPhiDx =
other.phiPhiDx;
103 phiPhiDy =
other.phiPhiDy;
104 phiTimesPhi =
other.phiTimesPhi;
106 divPhiTimesDivPhi =
other.divPhiTimesDivPhi;
107 polynomial_degree =
other.polynomial_degree;
108 polynomial_degree_plus_one_squared =
109 other.polynomial_degree_plus_one_squared;
115 int get_polynomial_degree()
const {
return polynomial_degree; }
116 int get_polynomial_degree_plus_one_squared()
const {
117 return polynomial_degree_plus_one_squared;
119 int get_refinement_level()
const {
return mesh_->get_max_level(); }
120 int get_number_of_elements()
const {
return mesh_->get_number_of_elements(); }
121 int get_number_of_patches()
const {
return mesh_->get_geometry().size(); }
122 const PatchVector& get_geometry()
const {
return mesh_->get_geometry(); }
123 const ClusterTree& get_mesh()
const {
return *mesh_; }
127 void init_SuperSpace(
const Geometry&
geom,
int M,
int P) {
128 polynomial_degree =
P;
129 polynomial_degree_plus_one_squared =
130 (polynomial_degree + 1) * (polynomial_degree + 1);
131 phi = (Basis::BasisHandler<Scalar>::funPtrPhi(
P));
132 phiDx = (Basis::BasisHandler<Scalar>::funPtrPhiDx(
P));
133 phiPhi = (Basis::BasisHandler<Scalar>::funPtrPhiPhi(
P));
134 phiPhiDx = (Basis::BasisHandler<Scalar>::funPtrPhiPhiDx(
P));
135 phiPhiDy = (Basis::BasisHandler<Scalar>::funPtrPhiPhiDy(
P));
136 phiTimesPhi = (Basis::BasisHandler<Scalar>::funPtrPhiTimesPhi(
P));
140 (Basis::BasisHandler<Scalar>::funPtrDivPhiTimesDivPhi(
P));
141 mesh_ = std::make_shared<ClusterTree>();
142 mesh_->init_ClusterTree(
geom,
M);
143 mesh_->checkOrientation();
162 Eigen::Vector2d
st =
e.llc_ +
e.get_h() *
xi;
163 mesh_->get_geometry()[
e.patch_].updateSurfacePoint(
surf_pt,
st,
w,
xi);
174 Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>*
intval,
176 const Eigen::Vector2d&
s,
const Eigen::Vector2d&
t)
const {
184 const Eigen::Vector2d&
s,
const Eigen::Vector2d&
t)
const {
185 Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>
intval(
186 polynomial_degree_plus_one_squared, polynomial_degree_plus_one_squared);
197 Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>*
intval, Scalar
w,
204 Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>
s_curl =
206 (-
p1.segment<3>(6) *
basisDy(
p1.segment<2>(0)).transpose() +
208 Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>
t_curl =
210 (-
p2.segment<3>(6) *
basisDy(
p2.segment<2>(0)).transpose() +
213 for (
int j = 0;
j < polynomial_degree_plus_one_squared; ++
j)
214 for (
int i = 0;
i < polynomial_degree_plus_one_squared; ++
i)
215 (*
intval)(
j * polynomial_degree_plus_one_squared +
i) +=
224 Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>*
intval, Scalar
w,
237 Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>*
intval, Scalar
w,
238 const Eigen::Vector2d&
s,
const Eigen::Vector2d&
t,
239 const Eigen::Vector3d
x_f_dx,
const Eigen::Vector3d
x_f_dy,
240 const Eigen::Vector3d
y_f_dx,
const Eigen::Vector3d
y_f_dy)
const {
242 intval->block(0, 0, polynomial_degree_plus_one_squared,
243 polynomial_degree_plus_one_squared) +=
245 intval->block(0, polynomial_degree_plus_one_squared,
246 polynomial_degree_plus_one_squared,
247 polynomial_degree_plus_one_squared) +=
249 intval->block(polynomial_degree_plus_one_squared, 0,
250 polynomial_degree_plus_one_squared,
251 polynomial_degree_plus_one_squared) +=
253 intval->block(polynomial_degree_plus_one_squared,
254 polynomial_degree_plus_one_squared,
255 polynomial_degree_plus_one_squared,
256 polynomial_degree_plus_one_squared) +=
264 const Eigen::Vector2d&
s,
const Eigen::Vector2d&
t,
265 const Eigen::Vector3d
x_f_dx,
const Eigen::Vector3d
x_f_dy,
266 const Eigen::Vector3d
y_f_dx,
const Eigen::Vector3d
y_f_dy)
const {
267 Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>
intval(
268 2 * polynomial_degree_plus_one_squared,
269 2 * polynomial_degree_plus_one_squared);
280 Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>*
intval, Scalar
w,
281 const Eigen::Vector2d&
s,
const Eigen::Vector2d&
t)
const {
288 Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>
290 const Eigen::Vector2d&
t)
const {
291 Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>
intval(
292 2 * polynomial_degree_plus_one_squared,
293 2 * polynomial_degree_plus_one_squared);
295 divPhiTimesDivPhi(&
intval, 1.,
s,
t);
303 Scalar
w,
const Eigen::Vector2d&
s)
const {
309 Eigen::Matrix<Scalar, Eigen::Dynamic, 1>
basis(
310 const Eigen::Vector2d&
s)
const {
311 Eigen::Matrix<Scalar, Eigen::Dynamic, 1>
intval(
312 polynomial_degree_plus_one_squared);
323 const Eigen::Vector2d&
s)
const {
330 Eigen::Matrix<Scalar, Eigen::Dynamic, 1>
basisDx(
331 const Eigen::Vector2d&
s)
const {
332 Eigen::Matrix<Scalar, Eigen::Dynamic, 1>
intval(
333 polynomial_degree_plus_one_squared);
344 const Eigen::Vector2d&
s)
const {
351 Eigen::Matrix<Scalar, Eigen::Dynamic, 1>
basisDy(
352 const Eigen::Vector2d&
s)
const {
353 Eigen::Matrix<Scalar, Eigen::Dynamic, 1>
intval(
354 polynomial_degree_plus_one_squared);
364 Scalar
w,
double s)
const {
370 Eigen::Matrix<Scalar, Eigen::Dynamic, 1>
basis1D(
double s)
const {
371 Eigen::Matrix<Scalar, Eigen::Dynamic, 1>
intval(polynomial_degree + 1);
381 Scalar
w,
double s)
const {
388 Eigen::Matrix<Scalar, Eigen::Dynamic, 1>
basis1DDx(
double s)
const {
389 Eigen::Matrix<Scalar, Eigen::Dynamic, 1>
intval(polynomial_degree + 1);
398 std::shared_ptr<ClusterTree> mesh_;
399 Basis::funptr_phi<Scalar> phi;
400 Basis::funptr_phidx<Scalar> phiDx;
401 Basis::funptr_phiphi<Scalar> phiPhi;
402 Basis::funptr_phiphidx<Scalar> phiPhiDx;
403 Basis::funptr_phiphidy<Scalar> phiPhiDy;
404 Basis::funptr_phitimesphi<Scalar> phiTimesPhi;
407 Basis::funptr_divphitimesdivphi<Scalar> divPhiTimesDivPhi;
408 int polynomial_degree;
409 int polynomial_degree_plus_one_squared;
The ElementTreeNode corresponds to an element in the element tree.
this class wraps a GeometryVector and provides some basic functionality, like reading Geometry files
std::vector< Bembel::Patch > PatchVector
typedef for PatchVector
Eigen::Matrix< double, 12, 1 > SurfacePoint
typedef of SurfacePoint
Routines for the evalutation of pointwise errors.
constexpr int getFunctionSpaceOutputDimension()
struct containing specifications on the linear operator has to be specialized or derived for any part...
The superspace manages local polynomial bases on each element of the mesh and provides an interface t...
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > basis1D(double s) const
Evaluate local shape functions on the unit interval at coordinate s.
SuperSpace & operator=(SuperSpace other)
Assignment operator for the SuperSpace class.
void addScaledBasisDy(Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > *intval, typename LinearOperatorTraits< Derived >::Scalar w, const Eigen::Vector2d &s) const
Evaluate derivatives in y direction of local shape functions on the unit square at coordinate s,...
void addScaledSurfaceCurlInteraction(Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > *intval, Scalar w, const SurfacePoint &p1, const SurfacePoint &p2) const
Compute all products of surface curls of local shape functions on the unit square at coordinates s,...
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > basisDy(const Eigen::Vector2d &s) const
Evaluate derivatives in y direction of local shape functions on the unit square at coordinate s.
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > basisInteraction(const Eigen::Vector2d &s, const Eigen::Vector2d &t) const
Compute all products of local shape functions on the unit square at coordinates s,...
void addScaledBasisDx(Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > *intval, typename LinearOperatorTraits< Derived >::Scalar w, const Eigen::Vector2d &s) const
Evaluate derivatives in x direction of local shape functions on the unit square at coordinate s,...
SuperSpace(const SuperSpace &other)
Copy constructor for the SuperSpace class.
SuperSpace(Geometry &geom, int M, int P)
Parameterized constructor for the SuperSpace class.
void addScaledVectorBasisDivergenceInteraction(Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > *intval, Scalar w, const Eigen::Vector2d &s, const Eigen::Vector2d &t) const
Compute all products of divergences of local shape functions on the unit square at coordinates s,...
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > basisDx(const Eigen::Vector2d &s) const
Evaluate derivatives in x direction of local shape functions on the unit square at coordinate s.
void addScaledBasis(Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > *intval, Scalar w, const Eigen::Vector2d &s) const
Evaluate local shape functions on the unit square at coordinate s, scale by w and add to intval.
void addScaledBasis1DDx(Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > *intval, Scalar w, double s) const
Evaluate derivatives of local shape functions on the unit interval at coordinate s,...
void addScaledBasisInteraction(Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > *intval, typename LinearOperatorTraits< Derived >::Scalar w, const Eigen::Vector2d &s, const Eigen::Vector2d &t) const
Compute all products of local shape functions on the unit square at coordinates s,...
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > basis(const Eigen::Vector2d &s) const
Evaluate local shape functions on the unit square at coordinate s.
SuperSpace()
Default constructor for the SuperSpace class.
SuperSpace(SuperSpace &&other)
Move constructor for the SuperSpace class.
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > vectorBasisInteraction(const Eigen::Vector2d &s, const Eigen::Vector2d &t, const Eigen::Vector3d x_f_dx, const Eigen::Vector3d x_f_dy, const Eigen::Vector3d y_f_dx, const Eigen::Vector3d y_f_dy) const
Compute all scalar products of vector valued local shape functions on the surface points with referen...
void addScaledVectorBasisInteraction(Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > *intval, Scalar w, const Eigen::Vector2d &s, const Eigen::Vector2d &t, const Eigen::Vector3d x_f_dx, const Eigen::Vector3d x_f_dy, const Eigen::Vector3d y_f_dx, const Eigen::Vector3d y_f_dy) const
Compute all scalar products of vector valued local shape functions on the surface points with referen...
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > basis1DDx(double s) const
Evaluate derivatives of local shape functions on the unit interval at coordinate s.
void addScaledSurfaceGradientInteraction(Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > *intval, Scalar w, const SurfacePoint &p1, const SurfacePoint &p2) const
Compute all products of surface gradients of local shape functions on the unit square at coordinates ...
void addScaledBasis1D(Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > *intval, Scalar w, double s) const
Evaluate local shape functions on the unit interval at coordinate s, scale by w and add to intval.
void map2surface(const ElementTreeNode &e, const Eigen::Vector2d &xi, double w, SurfacePoint *surf_pt) const
Evaluation of a point in the element and its Jacobian matrix.
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > vectorBasisDivergenceInteraction(const Eigen::Vector2d &s, const Eigen::Vector2d &t) const
Compute all products of divergences of local shape functions on the unit square at coordinates s,...