Skip to content
Snippets Groups Projects
Face.cpp 1.09 KiB
Newer Older
  • Learn to ignore specific revisions
  •  * Copyright (c) 2012, OpenGeoSys Community (http://www.opengeosys.com)
    
    Lars Bilke's avatar
    Lars Bilke committed
     *            Distributed under a Modified BSD License.
     *              See accompanying file LICENSE.txt or
    
     *              http://www.opengeosys.com/LICENSE.txt
    
    Lars Bilke's avatar
    Lars Bilke committed
     *
     *
    
    Lars Bilke's avatar
    Lars Bilke committed
     * \file Face.cpp
    
    Lars Bilke's avatar
    Lars Bilke committed
     * Created on 2012-05-02 by Karsten Rink
    
    Face::Face(Node** nodes, MshElemType::type type, unsigned value)
    
    	: Element(nodes, type, value)
    {
    }
    
    Face::Face(MshElemType::type type, unsigned value)
    
    	delete[] this->_neighbors;
    
    void Face::getSurfaceNormal(double normal[3]) const
    
    {
    	const double edge1[3] = { (*this->_nodes[0])[0]-(*this->_nodes[1])[0],
    				 			  (*this->_nodes[0])[1]-(*this->_nodes[1])[1],
    							  (*this->_nodes[0])[2]-(*this->_nodes[1])[2] };
    	const double edge2[3] = { (*this->_nodes[1])[0]-(*this->_nodes[2])[0],
    							  (*this->_nodes[1])[1]-(*this->_nodes[2])[1],
    							  (*this->_nodes[1])[2]-(*this->_nodes[2])[2] };
    	MathLib::crossProd(edge1, edge2, normal);
    }