Skip to content
Snippets Groups Projects
Commit df5597d0 authored by Robert Klöfkorn's avatar Robert Klöfkorn
Browse files

evaluate twists of hexahedron.

git-svn-id: https://dune.mathematik.uni-freiburg.de/svn/alugrid/trunk@761 0d966ed9-3843-0410-af09-ebfb50bd7c74
parent 79c007e4
Branches
Tags
No related merge requests found
//***********************************************************************
//
// Example program how to use ALUGrid.
// Author: Robert Kloefkorn
//
// This little program read one of the macrogrids and generates a grid.
// The grid is refined and coarsend again.
//
//***********************************************************************
#include <iostream>
using namespace std;
// include serial part of ALUGrid
int evalVertexTwist(int twist, int vertex)
{
return (twist < 0 ?
(9 - vertex + twist) % 4 :
(vertex + twist) % 4);
}
int evalEdgeTwist(int twist, int edge)
{
return (twist < 0 ?
(8 - edge + twist) % 4 :
(edge + twist) % 4);
}
int main()
{
std::cout << "Hexa Vertex Twists\n";
for(int tw=0; tw <8; ++tw)
{
std::cout << "{";
for(int vx=0; vx<4; ++vx)
{
std::cout << evalVertexTwist(tw-4,vx);
if(vx < 3)
{
std::cout << ",";
}
else
{
if(tw < 7)
std::cout << "},";
else
std::cout << "} ";
}
}
std::cout << " // twist = " << tw-4 << "\n";
}
std::cout << "Hexa Edge Twist \n";
for(int tw=0; tw <8; ++tw)
{
std::cout << "{";
for(int edge=0; edge<4; ++edge)
{
std::cout << evalEdgeTwist(tw-4,edge);
if(edge < 3)
{
std::cout << ",";
}
else
{
if(tw < 7)
std::cout << "},";
else
std::cout << "} ";
}
}
std::cout << " // twist = " << tw-4 << "\n";
}
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment