Skip to content

Commit

Permalink
Come back to serial Connectivity
Browse files Browse the repository at this point in the history
  • Loading branch information
cbritopacheco committed Nov 21, 2023
1 parent cdebbeb commit c2801b8
Show file tree
Hide file tree
Showing 5 changed files with 219 additions and 247 deletions.
22 changes: 8 additions & 14 deletions examples/Geometry/Connectivity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,26 @@
* (See accompanying file LICENSE or copy at
* https://www.boost.org/LICENSE_1_0.txt)
*/
#include <chrono>
#include <Rodin/Geometry.h>
#include <Rodin/Alert.h>

using namespace Rodin;
using namespace Geometry;


int main(int, char**)
{
Mesh mesh;
mesh = mesh.UniformGrid(Polytope::Type::Triangle, 6, 6);
mesh = mesh.UniformGrid(Polytope::Type::Triangle, 1024, 1024);

auto t0 = std::chrono::high_resolution_clock::now();
mesh.getConnectivity().compute(1, 2);
mesh.getConnectivity().compute(2, 1);
mesh.getConnectivity().compute(1, 1);

mesh.save("miaow.mesh", IO::FileFormat::MEDIT);

auto skin = mesh.skin();
const auto& inc = skin.getConnectivity().getIncidence(1, 1);
for (size_t i = 0; i < inc.size(); i++)
{
std::cout << i << ": ";
for (const Index s : inc[i])
std::cout << s << " ";
std::cout << std::endl;
}
skin.save("skin.mesh", IO::FileFormat::MEDIT);
auto t1 = std::chrono::high_resolution_clock::now();
auto d = t1 - t0;
std::cout << std::chrono::duration_cast<std::chrono::milliseconds>(d).count() << std::endl;
return 0;
}

Loading

0 comments on commit c2801b8

Please sign in to comment.