11#include <polysolve/linear/Solver.hpp>
18#include <Eigen/Sparse>
32 using namespace Eigen;
33 using namespace assembler;
41 typedef Matrix<std::vector<int>, 3, 3> SpaceMatrix;
42 typedef Matrix<RowVectorNd, 3, 3> NodeMatrix;
44 void print_local_space(
const SpaceMatrix &space)
48 for (
int j = 2; j >= 0; --j)
50 for (
int i = 0; i < 3; ++i)
52 if (space(i, j).size() > 0)
54 for (std::size_t l = 0; l < space(i, j).size(); ++l)
55 ss << space(i, j)[l] <<
",";
65 logger().trace(
"Local space:\n{}", ss.str());
68 int node_id_from_edge_index(
const Mesh2D &mesh, MeshNodes &mesh_nodes,
const Navigation::Index &index)
70 const int face_id = mesh.switch_face(index).face;
71 if (face_id >= 0 && mesh.is_cube(face_id))
72 return mesh_nodes.node_id_from_face(face_id);
74 return mesh_nodes.node_id_from_edge(index.edge);
77 void explore_direction(
const Navigation::Index &index,
const Mesh2D &mesh, MeshNodes &mesh_nodes,
const int x,
const int y,
const bool is_x,
const bool invert, LocalBoundary &lb, SpaceMatrix &space, NodeMatrix &node, std::map<int, InterfaceData> &poly_edge_to_data)
79 int node_id = node_id_from_edge_index(mesh, mesh_nodes, index);
82 assert(std::find(space(
x,
y).begin(), space(
x,
y).end(), node_id) == space(
x,
y).end());
83 space(
x,
y).push_back(node_id);
84 node(
x,
y) = mesh_nodes.node_position(node_id);
85 assert(node(
x,
y).size() == 2);
87 const int x1 = is_x ?
x : (invert ? 2 : 0);
88 const int y1 = !is_x ?
y : (invert ? 2 : 0);
90 const int x2 = is_x ?
x : (invert ? 0 : 2);
91 const int y2 = !is_x ?
y : (invert ? 0 : 2);
93 const bool is_boundary = mesh_nodes.is_boundary(node_id);
94 const bool is_interface = mesh_nodes.is_interface(node_id);
102 else if (is_interface)
104 InterfaceData &data = poly_edge_to_data[index.edge];
105 data.local_indices.push_back(
y * 3 +
x);
109 assert(!is_boundary && !is_interface);
111 Navigation::Index start_index = mesh.switch_face(index);
112 assert(start_index.vertex == index.vertex);
113 assert(start_index.face >= 0);
115 Navigation::Index edge1 = mesh.switch_edge(start_index);
116 node_id = node_id_from_edge_index(mesh, mesh_nodes, edge1);
120 if (std::find(space(x1, y1).begin(), space(x1, y1).end(), node_id) == space(x1, y1).end())
122 space(x1, y1).push_back(node_id);
123 node(x1, y1) = mesh_nodes.node_position(node_id);
126 Navigation::Index edge2 = mesh.switch_edge(mesh.switch_vertex(start_index));
127 node_id = node_id_from_edge_index(mesh, mesh_nodes, edge2);
130 if (std::find(space(x2, y2).begin(), space(x2, y2).end(), node_id) == space(x2, y2).end())
132 space(x2, y2).push_back(node_id);
133 node(x2, y2) = mesh_nodes.node_position(node_id);
139 void add_id_for_poly(
const Navigation::Index &index,
const int x1,
const int y1,
const int x2,
const int y2,
const SpaceMatrix &space, std::map<int, InterfaceData> &poly_edge_to_data)
141 auto it = poly_edge_to_data.find(index.edge);
142 if (it != poly_edge_to_data.end())
144 InterfaceData &data = it->second;
146 assert(space(x1, y1).size() == 1);
147 data.local_indices.push_back(y1 * 3 + x1);
149 assert(space(x2, y2).size() == 1);
150 data.local_indices.push_back(y2 * 3 + x2);
154 void build_local_space(
const Mesh2D &mesh, MeshNodes &mesh_nodes,
const int el_index, SpaceMatrix &space, NodeMatrix &node, std::vector<LocalBoundary> &local_boundary, std::map<int, InterfaceData> &poly_edge_to_data)
156 assert(!mesh.is_volume());
158 Navigation::Index index;
161 const int el_node_id = mesh_nodes.node_id_from_face(el_index);
162 space(1, 1).push_back(el_node_id);
163 node(1, 1) = mesh_nodes.node_position(el_node_id);
166 LocalBoundary lb(el_index, BoundaryType::QUAD_LINE);
169 index = mesh.get_index_from_face(el_index);
170 explore_direction(index, mesh, mesh_nodes, 1, 0,
false,
false, lb, space, node, poly_edge_to_data);
173 index = mesh.next_around_face(index);
174 explore_direction(index, mesh, mesh_nodes, 2, 1,
true,
false, lb, space, node, poly_edge_to_data);
177 index = mesh.next_around_face(index);
178 explore_direction(index, mesh, mesh_nodes, 1, 2,
false,
true, lb, space, node, poly_edge_to_data);
181 index = mesh.next_around_face(index);
182 explore_direction(index, mesh, mesh_nodes, 0, 1,
true,
true, lb, space, node, poly_edge_to_data);
185 if (mesh_nodes.is_boundary_or_interface(space(1, 2).front()) && mesh_nodes.is_boundary_or_interface(space(2, 1).front()))
187 assert(space(2, 2).empty());
189 Navigation::Index start_index = mesh.get_index_from_face(el_index);
190 start_index = mesh.next_around_face(start_index);
191 start_index = mesh.next_around_face(start_index);
193 const int node_id = mesh_nodes.node_id_from_vertex(start_index.vertex);
195 space(2, 2).push_back(node_id);
196 node(2, 2) = mesh_nodes.node_position(node_id);
202 if (mesh_nodes.is_boundary_or_interface(space(1, 0).front()) && mesh_nodes.is_boundary_or_interface(space(2, 1).front()))
204 assert(space(2, 0).empty());
206 Navigation::Index start_index = mesh.get_index_from_face(el_index);
207 start_index = mesh.next_around_face(start_index);
209 const int node_id = mesh_nodes.node_id_from_vertex(start_index.vertex);
211 space(2, 0).push_back(node_id);
212 node(2, 0) = mesh_nodes.node_position(node_id);
218 if (mesh_nodes.is_boundary_or_interface(space(1, 2).front()) && mesh_nodes.is_boundary_or_interface(space(0, 1).front()))
220 assert(space(0, 2).empty());
222 Navigation::Index start_index = mesh.get_index_from_face(el_index);
223 start_index = mesh.next_around_face(start_index);
224 start_index = mesh.next_around_face(start_index);
225 start_index = mesh.next_around_face(start_index);
228 const int node_id = mesh_nodes.node_id_from_vertex(start_index.vertex);
229 space(0, 2).push_back(node_id);
230 node(0, 2) = mesh_nodes.node_position(node_id);
236 if (mesh_nodes.is_boundary_or_interface(space(1, 0).front()) && mesh_nodes.is_boundary_or_interface(space(0, 1).front()))
238 Navigation::Index start_index = mesh.get_index_from_face(el_index);
241 const int node_id = mesh_nodes.node_id_from_vertex(start_index.vertex);
242 space(0, 0).push_back(node_id);
243 node(0, 0) = mesh_nodes.node_position(node_id);
252 index = mesh.get_index_from_face(el_index);
253 add_id_for_poly(index, 0, 0, 2, 0, space, poly_edge_to_data);
255 index = mesh.next_around_face(index);
256 add_id_for_poly(index, 2, 0, 2, 2, space, poly_edge_to_data);
258 index = mesh.next_around_face(index);
259 add_id_for_poly(index, 2, 2, 0, 2, space, poly_edge_to_data);
261 index = mesh.next_around_face(index);
262 add_id_for_poly(index, 0, 2, 0, 0, space, poly_edge_to_data);
265 local_boundary.emplace_back(lb);
268 void setup_knots_vectors(MeshNodes &mesh_nodes,
const SpaceMatrix &space, std::array<std::array<double, 4>, 3> &h_knots, std::array<std::array<double, 4>, 3> &v_knots)
271 if (mesh_nodes.is_boundary_or_interface(space(0, 1).front()) && mesh_nodes.is_boundary_or_interface(space(2, 1).front()))
273 h_knots[0] = {{0, 0, 0, 1}};
274 h_knots[1] = {{0, 0, 1, 1}};
275 h_knots[2] = {{0, 1, 1, 1}};
278 else if (mesh_nodes.is_boundary_or_interface(space(0, 1).front()))
280 h_knots[0] = {{0, 0, 0, 1}};
281 h_knots[1] = {{0, 0, 1, 2}};
282 h_knots[2] = {{0, 1, 2, 3}};
285 else if (mesh_nodes.is_boundary_or_interface(space(2, 1).front()))
287 h_knots[0] = {{-2, -1, 0, 1}};
288 h_knots[1] = {{-1, 0, 1, 1}};
289 h_knots[2] = {{0, 1, 1, 1}};
293 h_knots[0] = {{-2, -1, 0, 1}};
294 h_knots[1] = {{-1, 0, 1, 2}};
295 h_knots[2] = {{0, 1, 2, 3}};
299 if (mesh_nodes.is_boundary_or_interface(space(1, 0).front()) && mesh_nodes.is_boundary_or_interface(space(1, 2).front()))
301 v_knots[0] = {{0, 0, 0, 1}};
302 v_knots[1] = {{0, 0, 1, 1}};
303 v_knots[2] = {{0, 1, 1, 1}};
306 else if (mesh_nodes.is_boundary_or_interface(space(1, 0).front()))
308 v_knots[0] = {{0, 0, 0, 1}};
309 v_knots[1] = {{0, 0, 1, 2}};
310 v_knots[2] = {{0, 1, 2, 3}};
313 else if (mesh_nodes.is_boundary_or_interface(space(1, 2).front()))
315 v_knots[0] = {{-2, -1, 0, 1}};
316 v_knots[1] = {{-1, 0, 1, 1}};
317 v_knots[2] = {{0, 1, 1, 1}};
321 v_knots[0] = {{-2, -1, 0, 1}};
322 v_knots[1] = {{-1, 0, 1, 2}};
323 v_knots[2] = {{0, 1, 2, 3}};
327 void basis_for_regular_quad(
const SpaceMatrix &space,
const NodeMatrix &loc_nodes,
const std::array<std::array<double, 4>, 3> &h_knots,
const std::array<std::array<double, 4>, 3> &v_knots, ElementBases &b)
329 for (
int y = 0;
y < 3; ++
y)
331 for (
int x = 0;
x < 3; ++
x)
333 if (space(
x,
y).size() == 1)
335 const int global_index = space(
x,
y).front();
336 const Eigen::MatrixXd &node = loc_nodes(
x,
y);
337 assert(node.size() == 2);
339 const int local_index =
y * 3 +
x;
340 b.bases[local_index].init(2, global_index, local_index, node);
342 const QuadraticBSpline2d spline(h_knots[
x], v_knots[
y]);
343 b.bases[local_index].set_basis([spline](
const Eigen::MatrixXd &uv, Eigen::MatrixXd &
val) { spline.interpolate(uv,
val); });
344 b.bases[local_index].set_grad([spline](
const Eigen::MatrixXd &uv, Eigen::MatrixXd &
val) { spline.derivative(uv,
val); });
350 void basis_for_irregulard_quad(
const int el_id,
const Mesh2D &mesh, MeshNodes &mesh_nodes,
const SpaceMatrix &space,
const NodeMatrix &loc_nodes,
const std::array<std::array<double, 4>, 3> &h_knots,
const std::array<std::array<double, 4>, 3> &v_knots, ElementBases &b)
352 for (
int y = 0;
y < 3; ++
y)
354 for (
int x = 0;
x < 3; ++
x)
356 if (space(
x,
y).size() > 1)
364 std::vector<int> other_indices;
365 const auto ¢er =
b.bases[1 * 3 + 1].global().front();
367 const auto &el1 =
b.bases[mpy * 3 + mpx].global().front();
368 const auto &el2 =
b.bases[mmy * 3 + mmx].global().front();
370 Navigation::Index start_index = mesh.get_index_from_face(el_id);
372 for (
int i = 0; i < 4; ++i)
374 other_indices.clear();
376 Navigation::Index index = start_index;
379 const int f_index = mesh_nodes.node_id_from_face(index.face);
380 if (f_index != el1.index && f_index != el2.index && f_index != center.index)
381 other_indices.push_back(f_index);
384 index = mesh.next_around_vertex(index);
385 }
while (index.face != start_index.face);
392 start_index = mesh.next_around_face(start_index);
396 const int local_index =
y * 3 +
x;
397 auto &
base =
b.bases[local_index];
399 const int k = int(other_indices.size()) + 3;
401 base.global().resize(k);
403 base.global()[0].index = center.index;
404 base.global()[0].val = (4. - k) / k;
405 base.global()[0].node = center.node;
407 base.global()[1].index = el1.index;
408 base.global()[1].val = (4. - k) / k;
409 base.global()[1].node = el1.node;
411 base.global()[2].index = el2.index;
412 base.global()[2].val = (4. - k) / k;
413 base.global()[2].node = el2.node;
415 for (std::size_t n = 0; n < other_indices.size(); ++n)
417 base.global()[3 + n].index = other_indices[n];
418 base.global()[3 + n].val = 4. / k;
419 base.global()[3 + n].node = mesh_nodes.node_position(other_indices[n]);
422 const QuadraticBSpline2d spline(h_knots[
x], v_knots[
y]);
423 b.bases[local_index].set_basis([spline](
const Eigen::MatrixXd &uv, Eigen::MatrixXd &
val) { spline.interpolate(uv,
val); });
424 b.bases[local_index].set_grad([spline](
const Eigen::MatrixXd &uv, Eigen::MatrixXd &
val) { spline.derivative(uv,
val); });
430 void create_q2_nodes(
const Mesh2D &mesh,
const int el_index, std::set<int> &vertex_id, std::set<int> &
edge_id, ElementBases &b, std::vector<LocalBoundary> &local_boundary,
int &n_bases)
434 LocalBoundary lb(el_index, BoundaryType::QUAD_LINE);
436 Navigation::Index index = mesh.get_index_from_face(el_index);
437 for (
int j = 0; j < 4; ++j)
439 int current_vertex_node_id = -1;
440 int current_edge_node_id = -1;
441 Eigen::Matrix<double, 1, 2> current_edge_node;
442 Eigen::MatrixXd current_vertex_node;
447 int vertex_basis_id = e2l[0];
448 int edge_basis_id = e2l[1];
450 const int opposite_face = mesh.switch_face(index).face;
453 bool is_vertex_q2 =
true;
454 bool is_vertex_boundary =
false;
456 Navigation::Index vindex = index;
462 is_vertex_boundary =
true;
465 if (mesh.is_spline_compatible(vindex.face))
467 is_vertex_q2 =
false;
470 vindex = mesh.next_around_vertex(vindex);
471 }
while (vindex.edge != index.edge);
475 vindex = mesh.switch_face(index);
480 is_vertex_boundary =
true;
484 if (mesh.is_spline_compatible(vindex.face))
486 is_vertex_q2 =
false;
489 vindex = mesh.next_around_vertex(vindex);
490 }
while (vindex.edge != index.edge);
493 const bool is_edge_q2 = opposite_face < 0 || !mesh.is_spline_compatible(opposite_face);
497 const bool is_new_edge =
edge_id.insert(index.edge).second;
501 current_edge_node_id = n_bases++;
502 current_edge_node = mesh.edge_barycenter(index.edge);
504 if (opposite_face < 0)
507 lb.add_boundary_primitive(index.edge, edge_basis_id - 4);
515 const bool is_new_vertex = vertex_id.insert(index.vertex).second;
519 current_vertex_node_id = n_bases++;
520 current_vertex_node = mesh.point(index.vertex);
528 if (current_vertex_node_id >= 0)
529 b.bases[vertex_basis_id].init(2, current_vertex_node_id, vertex_basis_id, current_vertex_node);
531 if (current_edge_node_id >= 0)
532 b.bases[edge_basis_id].init(2, current_edge_node_id, edge_basis_id, current_edge_node);
541 index = mesh.next_around_face(index);
545 const int face_basis_id = 8;
546 b.bases[face_basis_id].init(2, n_bases++, face_basis_id, mesh.face_barycenter(el_index));
551 local_boundary.emplace_back(lb);
554 void insert_into_global(
const Local2Global &data, std::vector<Local2Global> &
vec)
557 if (fabs(data.val) < 1e-10)
562 for (std::size_t i = 0; i <
vec.size(); ++i)
564 if (
vec[i].index == data.index)
567 assert(fabs(
vec[i].
val - data.val) < 1e-10);
568 assert((
vec[i].node - data.node).norm() < 1e-10);
578 void assign_q2_weights(
const Mesh2D &mesh,
const int el_index, std::vector<ElementBases> &bases)
581 std::vector<AssemblyValues> eval_p;
582 Navigation::Index index = mesh.get_index_from_face(el_index);
583 ElementBases &
b = bases[el_index];
585 for (
int j = 0; j < 4; ++j)
587 const int opposite_face = mesh.switch_face(index).face;
589 if (opposite_face < 0 || !mesh.is_cube(opposite_face))
591 index = mesh.next_around_face(index);
599 Eigen::Matrix<double, 3, 2> param_p;
602 Eigen::MatrixXd quad_loc_nodes;
605 for (
int k = 0; k < 3; ++k)
606 param_p.row(k) = quad_loc_nodes.row(opposite_indices[k]);
613 const auto &other_bases = bases[opposite_face];
614 other_bases.evaluate_bases(param_p, eval_p);
616 for (std::size_t i = 0; i < other_bases.bases.size(); ++i)
618 const auto &other_b = other_bases.bases[i];
620 if (other_b.global().empty())
623 assert(eval_p[i].
val.size() == 3);
626 if (eval_p[i].
val.cwiseAbs().maxCoeff() <= 1e-10)
629 for (std::size_t k = 0; k < other_b.global().size(); ++k)
635 auto glob0 = other_b.global()[k];
636 glob0.val *= eval_p[i].val(0);
637 auto glob1 = other_b.global()[k];
638 glob1.val *= eval_p[i].val(1);
639 auto glob2 = other_b.global()[k];
640 glob2.val *= eval_p[i].val(2);
642 insert_into_global(glob0,
b.bases[i0].global());
643 insert_into_global(glob1,
b.bases[i1].global());
644 insert_into_global(glob2,
b.bases[i2].global());
648 index = mesh.next_around_face(index);
652 void setup_data_for_polygons(
const Mesh2D &mesh,
const int el_index,
const ElementBases &b, std::map<int, InterfaceData> &poly_edge_to_data)
654 Navigation::Index index = mesh.get_index_from_face(el_index);
655 for (
int j = 0; j < 4; ++j)
657 const int opposite_face = mesh.switch_face(index).face;
658 const bool is_neigh_poly = opposite_face >= 0 && mesh.is_polytope(opposite_face);
664 const int vertex_basis_id = e2l[0];
665 const int edge_basis_id = e2l[1];
666 const int vertex_basis_id2 = e2l[2];
668 InterfaceData &data = poly_edge_to_data[index.edge];
670 data.local_indices.push_back(edge_basis_id);
671 data.local_indices.push_back(vertex_basis_id);
672 data.local_indices.push_back(vertex_basis_id2);
675 index = mesh.next_around_face(index);
681 const std::string &assembler,
682 const int quadrature_order,
const int mass_quadrature_order, std::vector<ElementBases> &bases, std::vector<LocalBoundary> &local_boundary, std::map<int, InterfaceData> &poly_edge_to_data)
687 MeshNodes mesh_nodes(mesh,
true,
true, 1, 1);
692 local_boundary.clear();
696 for (
int e = 0; e < n_els; ++e)
702 NodeMatrix loc_nodes;
705 build_local_space(mesh, mesh_nodes, e, space, loc_nodes, local_boundary, poly_edge_to_data);
711 const int real_mass_order = mass_quadrature_order > 0 ? mass_quadrature_order :
AssemblerUtils::quadrature_order(
"Mass", 2, AssemblerUtils::BasisType::SPLINE, 2);
713 b.set_quadrature([real_order](
Quadrature &quad) {
717 b.set_mass_quadrature([real_mass_order](
Quadrature &quad) {
723 b.set_local_node_from_primitive_func([e](
const int primitive_id,
const Mesh &mesh) {
724 Eigen::VectorXi res(3);
725 const auto &mesh2d =
dynamic_cast<const Mesh2D &
>(mesh);
728 for (le = 0; le < mesh2d.n_face_vertices(e); ++le)
730 if (index.edge == primitive_id)
732 index = mesh2d.next_around_face(index);
734 assert(index.edge == primitive_id);
739 res << (3 * 0 + 0), (3 * 1 + 0), (3 * 2 + 0);
742 res << (3 * 0 + 0), (3 * 0 + 1), (3 * 0 + 2);
745 res << (3 * 0 + 2), (3 * 1 + 2), (3 * 2 + 2);
748 res << (3 * 2 + 0), (3 * 2 + 1), (3 * 2 + 2);
757 std::array<std::array<double, 4>, 3> h_knots;
758 std::array<std::array<double, 4>, 3> v_knots;
760 setup_knots_vectors(mesh_nodes, space, h_knots, v_knots);
764 basis_for_regular_quad(space, loc_nodes, h_knots, v_knots, b);
765 basis_for_irregulard_quad(e, mesh, mesh_nodes, space, loc_nodes, h_knots, v_knots, b);
769 std::set<int> vertex_id;
771 int n_bases = mesh_nodes.
n_nodes();
773 for (
int e = 0; e < n_els; ++e)
780 const int real_order = quadrature_order > 0 ? quadrature_order :
AssemblerUtils::quadrature_order(assembler, 2, AssemblerUtils::BasisType::CUBE_LAGRANGE, 2);
781 const int real_mass_order = mass_quadrature_order > 0 ? mass_quadrature_order :
AssemblerUtils::quadrature_order(
"Mass", 2, AssemblerUtils::BasisType::CUBE_LAGRANGE, 2);
783 b.set_quadrature([real_order](
Quadrature &quad) {
787 b.set_mass_quadrature([real_mass_order](
Quadrature &quad) {
792 b.set_local_node_from_primitive_func([e](
const int primitive_id,
const Mesh &mesh) {
793 const auto &mesh2d =
dynamic_cast<const Mesh2D &
>(mesh);
796 for (
int le = 0; le < mesh2d.n_face_vertices(e); ++le)
798 if (index.edge == primitive_id)
800 index = mesh2d.next_around_face(index);
802 assert(index.edge == primitive_id);
806 Eigen::VectorXi res(indices.size());
808 for (
size_t i = 0; i < indices.size(); ++i)
814 create_q2_nodes(mesh, e, vertex_id,
edge_id, b, local_boundary, n_bases);
817 bool missing_bases =
false;
820 missing_bases =
false;
821 for (
int e = 0; e < n_els; ++e)
830 assign_q2_weights(mesh, e, bases);
832 missing_bases = missing_bases || b.is_complete();
834 }
while (missing_bases);
836 for (
int e = 0; e < n_els; ++e)
841 setup_data_for_polygons(mesh, e, b, poly_edge_to_data);
static int quadrature_order(const std::string &assembler, const int basis_degree, const BasisType &b_type, const int dim)
utility for retrieving the needed quadrature order to precisely integrate the given form on the given...
Stores the basis functions for a given element in a mesh (facet in 2d, cell in 3d).
static Eigen::VectorXi quad_edge_local_nodes(const int q, const mesh::Mesh2D &mesh, mesh::Navigation::Index index)
static void fit_nodes(const mesh::Mesh2D &mesh, const int n_bases, std::vector< ElementBases > &gbases)
static int build_bases(const mesh::Mesh2D &mesh, const std::string &assembler, const int quadrature_order, const int mass_quadrature_order, std::vector< ElementBases > &bases, std::vector< mesh::LocalBoundary > &local_boundary, std::map< int, InterfaceData > &poly_edge_to_data)
2D mesh interface: the elements are the faces (polygons) and the boundary elements are the edges.
bool is_volume() const override
checks if mesh is volume
virtual Navigation::Index get_index_from_face(int f, int lv=0) const =0
Abstract mesh class to capture 2d/3d conforming and non-conforming meshes.
int n_elements() const
utitlity to return the number of elements, cells or faces in 3d and 2d
bool is_polytope(const int el_id) const
checks if element is polygon compatible
bool is_spline_compatible(const int el_id) const
checks if element is spline compatible
void get_quadrature(const int order, Quadrature &quad)
void q_nodes_2d(const int q, Eigen::MatrixXd &val)
void q_grad_basis_value_2d(const int q, const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &val)
void q_basis_value_2d(const int q, const int local_index, const Eigen::MatrixXd &uv, Eigen::MatrixXd &val)
spdlog::logger & logger()
Retrieves the current logger.