bool isCellTopologySubsetOf( const Elem::CellTopology & cell_topology, const Elem::CellTopology & richer) { bool result = false; UInt i, j; if (0 < cell_topology.getVertexCount()) { result = cell_topology.getDimension() == richer.getDimension() && cell_topology.getVertexCount() == richer.getVertexCount() && cell_topology.getEdgeCount() == richer.getEdgeCount() && cell_topology.getFaceCount() == richer.getFaceCount() && cell_topology.getNodeCount() <= richer.getNodeCount(); for (i = 0; result && i < cell_topology.getEdgeCount(); ++i) { result = isCellTopologySubsetOf(edgeCellTopology(cell_topology, i), edgeCellTopology(richer, i)); for (j = 0; result && j < edgeCellTopology(cell_topology, i).getNodeCount(); ++j) result = getEdgeNode(cell_topology, i, j) == getEdgeNode(richer, i, j); } for (i = 0; i < cell_topology.getFaceCount() && result; ++i) { result = isCellTopologySubsetOf(faceCellTopology(cell_topology, i), faceCellTopology(richer, i)); for (j = 0; result && j < faceCellTopology(cell_topology, i).getNodeCount(); ++j) result = getFaceNode(cell_topology, i, j) == getFaceNode(richer, i, j); } } return result; }
void Element::computeSqrEdgeLengthRange(double &min, double &max) const { min = std::numeric_limits<double>::max(); max = 0; const unsigned nEdges (this->getNumberOfEdges()); for (unsigned i=0; i<nEdges; i++) { const double dist (MathLib::sqrDist(*getEdgeNode(i,0), *getEdgeNode(i,1))); min = (dist<min) ? dist : min; max = (dist>max) ? dist : max; } }
const Element* Element::getEdge(unsigned i) const { if (i < getNEdges()) { Node** nodes = new Node*[2]; nodes[0] = const_cast<Node*>(getEdgeNode(i,0)); nodes[1] = const_cast<Node*>(getEdgeNode(i,1)); return new Edge(nodes); } std::cerr << "Error in MeshLib::Element::getEdge() - Index does not exist." << std::endl; return NULL; }
int getSideNode( const Elem::CellTopology & cell_topology, unsigned side, unsigned node_of_side) { return cell_topology.getDimension() == 3 ? getFaceNode(cell_topology, side, node_of_side) : getEdgeNode(cell_topology, side, node_of_side); }