48 Element_node_vectors_k_const<double>
n;
49 n.set(ene.pane()->attribute(
"nc"),ene);
50 if(type_ == COM::Connectivity::TRI3){
51 v[0][0]=
n(2,0)-
n(1,0);
v[0][1]=
n(2,1)-
n(1,1);
v[0][2]=
n(2,2)-
n(1,2);
52 v[1][0]=
n(1,0)-
n(2,0);
v[1][1]=
n(1,1)-
n(2,1);
v[1][2]=
n(1,2)-
n(2,2);
53 v[2][0]=
n(2,0)-
n(0,0);
v[2][1]=
n(2,1)-
n(0,1);
v[2][2]=
n(2,2)-
n(0,2);
54 v[3][0]=
n(1,0)-
n(0,0);
v[3][1]=
n(1,1)-
n(0,1);
v[3][2]=
n(1,2)-
n(0,2);
56 else if (type_ == COM::Connectivity::QUAD4){
57 v[0][0]=
n(1,0)-
n(0,0);
v[0][1]=
n(1,1)-
n(0,1);
v[0][2]=
n(1,2)-
n(0,2);
58 v[1][0]=
n(3,0)-
n(0,0);
v[1][1]=
n(3,1)-
n(0,1);
v[1][2]=
n(3,2)-
n(0,2);
59 v[2][0]=
n(1,0)-
n(2,0);
v[2][1]=
n(1,1)-
n(2,1);
v[2][2]=
n(1,2)-
n(2,2);
60 v[3][0]=
n(3,0)-
n(2,0);
v[3][1]=
n(3,1)-
n(2,1);
v[3][2]=
n(3,2)-
n(2,2);
68 if (type_ == COM::Connectivity::TRI3){
69 v[0]= n[2]-n[1];
v[1]= n[1]-n[2];
v[2]= n[2]-n[0];
v[3]= n[1]-n[0];
71 else if (type_ == COM::Connectivity::QUAD4){
72 v[0]= n[1]-n[0];
v[1]= n[3]-n[0];
v[2]= n[1]-n[2];
v[3]= n[3] - n[2];
77 if (type_ == COM::Connectivity::TRI3){
82 if (type_ == COM::Connectivity::QUAD4){
92 assert (type_ == COM::Connectivity::TRI3);
101 l = ( a < b )? a : b;
102 l = ( l < c ) ? l : c;
103 R = (a*b*c) /
sqrt( (a+b+c)*(b+c-a)*(c+a-b)*(a+b-c) );
104 r = .5*
sqrt( ((b+c-a)*(c+a-b)*(a+b-c))/(a+b+c) );
109 compute_angles(atts[0],atts[1]);
121 if (type_ == COM::Connectivity::QUAD4) {
127 compute_aspects(R,r,l);
129 atts[1] = (l/R)*.5773502692;
#define COM_assertion_msg(EX, msg)
virtual void compute(double atts[]) const
Calculate scaled R/r and R/l.
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
double maxValue() const
The maximum value for this metric.
void min_max4(double a1, double a2, double a3, double a4, double &min, double &max)
Find minimum and maximum of 4 numbers.
double minValue() const
The minimum value for this metric.
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
MOP_BEGIN_NAMESPACE void min_max3(double a1, double a2, double a3, double &min, double &max)
Find minimum and maximum of 3 numbers.
double minValue() const
The minimum value for this metric.
double angle(Vector_3< double > v1, Vector_3< double > v2)
Compute the angle between two vectors.
void compute_angles(double &min, double &max) const
Compute the min and max angles.
virtual void compute(double atts[]) const
Calculate max and min angles.
virtual void initialize(Vector_3< double > n[], int type)
Initialize a 2D Geometric Metric.
#define MOP_END_NAMESPACE
2D geometric quality Metric declarations.
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
double maxValue() const
The maximum value for this metric.
#define MOP_BEGIN_NAMESPACE
double edge_length(const Vector_3< double > &v)
Compute the edge length of a vector.
Geometric helper function header file.
void compute_aspects(double &R, double &r, double &l) const
Compute the circumradius, inradius, and shortest edge length.