1#include <lf/io/vtk_writer.h>
2#include <lf/mesh/hybrid2d/mesh_factory.h>
3#include <sphere_triag_mesh_builder.h>
21int main(
int arg,
char** args) {
23 std::unique_ptr<lf::mesh::MeshFactory> factory =
24 std::make_unique<lf::mesh::hybrid2d::MeshFactory>(3);
30 if (arg != 4 && arg != 5) {
31 std::cerr <<
"Usage: " << args[0]
32 <<
"smallest_mesh largest_mesh radius [verbose]" << std::endl;
37 sscanf(args[3],
"%lf", &radius);
40 int largest_mesh = atoi(args[2]);
41 int smallest_mesh = atoi(args[1]);
42 for (
int i = 0; i <= largest_mesh; i++) {
44 int refinement_level = i + smallest_mesh;
47 const std::shared_ptr<lf::mesh::Mesh> mesh = sphere.
Build();
51 if (i == 0 && arg == 5 && args[4] ==
"verbose") {
52 std::cout <<
"\n\n\nPoint information";
55 int index = mesh->Index(*point);
56 std::cout <<
"\n\nPoint " << index <<
"\n" << vertex;
60 int global_cell_index = mesh->Index(*cell_p);
61 auto orientations = cell_p->RelativeOrientations();
63 std::cout <<
"\n\n\nInfo for cell " << global_cell_index <<
"\n";
64 std::cout <<
"Corners:\n" << vertices;
68 int global_edge_index = mesh->Index(*edge_p);
70 std::cout <<
"\n\nEdge local " << i <<
" global " << global_edge_index
71 <<
" orientation " << sign;
79 "_" + std::to_string(radius) +
Write a mesh along with mesh data into a vtk file.
Interface class representing a topological entity in a cellular complex
virtual nonstd::span< const Entity *const > SubEntities(unsigned rel_codim) const =0
Return all sub entities of this entity that have the given codimension (w.r.t. this entity!...
A mesh builder for regular 3-Sphere.
void setRefinementLevel(lf::base::size_type n)
Set the refinement level.
void setRadius(double r)
Sets the radius.
std::shared_ptr< lf::mesh::Mesh > Build()
Build the mesh.
Eigen::MatrixXd Corners(const Geometry &geo)
The corners of a shape with piecewise smooth boundary.
int to_sign(Orientation o)