LehrFEM++ 1.0.0
A simple Finite Element Library for teaching
Loading...
Searching...
No Matches
print_info.cc
1#include "print_info.h"
2
3namespace lf::geometry {
4
5void PrintInfo(std::ostream& o, const Geometry& geom, int output_ctrl) {
6 const lf::base::RefEl geom_refel = geom.RefEl();
7 o << "Reference element type for geometry: " << geom_refel << '\n';
8
9 if (output_ctrl > 10) {
10 // Dimensions and the derived type
11 const base::dim_t dim_glob = geom.DimGlobal();
12 const base::dim_t dim_local = geom.DimLocal();
13 o << "world dim. = " << dim_glob << std::flush;
14 o << ", loc dim = " << dim_local << std::flush;
15 o << "type: " << typeid(geom).name() << '\n';
16
17 if (output_ctrl > 90) {
18 // Geometry (coordinates of vertices)
19 const Eigen::MatrixXd& ref_el_corners(geom_refel.NodeCoords());
20 o << geom.Global(ref_el_corners) << '\n';
21 }
22 }
23
24} // void PrintInfo
25
26std::ostream& operator<<(std::ostream& stream, const Geometry& geom) {
27 return stream << geom.RefEl();
28}
29
30} // namespace lf::geometry
Represents a reference element with all its properties.
Definition ref_el.h:109
const Eigen::MatrixXd & NodeCoords() const
Get the coordinates of the nodes of this reference element.
Definition ref_el.h:241
Interface class for shape information on a mesh cell in the spirit of parametric finite element metho...
virtual base::RefEl RefEl() const =0
The Reference element that defines the domain of this mapping.
virtual Eigen::MatrixXd Global(const Eigen::MatrixXd &local) const =0
Map a number of points in local coordinates into the global coordinate system.
virtual dim_t DimLocal() const =0
Dimension of the domain of this mapping.
virtual dim_t DimGlobal() const =0
Dimension of the image of this mapping.
unsigned int dim_t
type for dimensions and co-dimensions and numbers derived from them
Definition types.h:32
Defines the Geometry interface and provides a number of classes that implement this interface + addit...
Definition compose.h:13
std::ostream & operator<<(std::ostream &stream, const Geometry &geom)
Definition print_info.cc:26
void PrintInfo(std::ostream &o, const Geometry &geom, int output_ctrl)
Definition print_info.cc:5