1#define _USE_MATH_DEFINES
2#include <lf/io/vtk_writer.h>
3#include <lf/mesh/hybrid2d/mesh_factory.h>
4#include <sphere_triag_mesh_builder.h>
22int main(
int arg,
char** args) {
24 std::unique_ptr<lf::mesh::MeshFactory> factory =
25 std::make_unique<lf::mesh::hybrid2d::MeshFactory>(3);
31 if (arg != 4 && arg != 5) {
32 std::cerr <<
"Usage: " << args[0]
33 <<
"smallest_mesh largest_mesh radius [verbose]" << std::endl;
38 sscanf(args[3],
"%lf", &radius);
41 int largest_mesh = atoi(args[2]);
42 int smallest_mesh = atoi(args[1]);
43 for (
int i = 0; i <= largest_mesh; i++) {
45 int refinement_level = i + smallest_mesh;
48 const std::shared_ptr<lf::mesh::Mesh> mesh = sphere.
Build();
52 if (i == 0 && arg == 5 && args[4] ==
"verbose") {
53 std::cout <<
"\n\n\nPoint information";
56 int index = mesh->Index(*point);
57 std::cout <<
"\n\nPoint " << index <<
"\n" << vertex;
61 int global_cell_index = mesh->Index(*cell_p);
62 auto orientations = cell_p->RelativeOrientations();
64 std::cout <<
"\n\n\nInfo for cell " << global_cell_index <<
"\n";
65 std::cout <<
"Corners:\n" << vertices;
69 int global_edge_index = mesh->Index(*edge_p);
71 std::cout <<
"\n\nEdge local " << i <<
" global " << global_edge_index
72 <<
" orientation " << sign;
80 "_" + 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)