Commit 5baaa923 authored by vijaysm's avatar vijaysm
Browse files

Fixing some compiler errors: conflcits due to definition of "cube" and "sqr" in Eigen

parent 35244f8f
......@@ -35,8 +35,6 @@
#include "moab/CN.hpp"
#include "moab/OrientedBox.hpp"
#include "moab/Range.hpp"
#include "moab/Matrix3.hpp"
#include "moab/Util.hpp"
#include <ostream>
#include <assert.h>
#include <limits>
......
#include <iostream>
#include <fstream>
#include "SmoothFace.hpp"
#include <algorithm>
#include <iomanip>
#include <cassert>
#include <limits>
#include "SmoothFace.hpp"
#include "assert.h"
// included in the header now
// #include "Range.hpp"
// #include "CartVect.hpp"
// some defines from CUBIT
#define GEOMETRY_RESABS 1.e-6
#define CUBIT_DBL_MAX 1.e+30
//#define DBL_EPSILON 1.e-8
#include <float.h>
#define mbsqr(a) ((a)*(a))
#define mbcube(a) (mbsqr(a) * (a))
#define mbquart(a) (mbsqr(a) * mbsqr(a))
namespace moab {
......@@ -845,19 +840,19 @@ ErrorCode SmoothFace::eval_bezier_patch(EntityHandle tri, CartVect &areacoord,
ctrl_pts[4] = vN[1]; //
//i=4; j=0; k=0;
double B = quart(areacoord[0]);
double B = mbquart(areacoord[0]);
pt += B * ctrl_pts[0];
//i=3; j=1; k=0;
B = 4.0 * cube(areacoord[0]) * areacoord[1];
B = 4.0 * mbcube(areacoord[0]) * areacoord[1];
pt += B * ctrl_pts[1];
//i=2; j=2; k=0;
B = 6.0 * sqr(areacoord[0]) * sqr(areacoord[1]);
B = 6.0 * mbsqr(areacoord[0]) * mbsqr(areacoord[1]);
pt += B * ctrl_pts[2];
//i=1; j=3; k=0;
B = 4.0 * areacoord[0] * cube(areacoord[1]);
B = 4.0 * areacoord[0] * mbcube(areacoord[1]);
pt += B * ctrl_pts[3];
//edge = facet->edge(0);
......@@ -869,19 +864,19 @@ ErrorCode SmoothFace::eval_bezier_patch(EntityHandle tri, CartVect &areacoord,
ctrl_pts[4] = vN[2]; //
//i=0; j=4; k=0;
B = quart(areacoord[1]);
B = mbquart(areacoord[1]);
pt += B * ctrl_pts[0];
//i=0; j=3; k=1;
B = 4.0 * cube(areacoord[1]) * areacoord[2];
B = 4.0 * mbcube(areacoord[1]) * areacoord[2];
pt += B * ctrl_pts[1];
//i=0; j=2; k=2;
B = 6.0 * sqr(areacoord[1]) * sqr(areacoord[2]);
B = 6.0 * mbsqr(areacoord[1]) * mbsqr(areacoord[2]);
pt += B * ctrl_pts[2];
//i=0; j=1; k=3;
B = 4.0 * areacoord[1] * cube(areacoord[2]);
B = 4.0 * areacoord[1] * mbcube(areacoord[2]);
pt += B * ctrl_pts[3];
//edge = facet->edge(1);
......@@ -893,31 +888,31 @@ ErrorCode SmoothFace::eval_bezier_patch(EntityHandle tri, CartVect &areacoord,
ctrl_pts[4] = vN[0]; //
//i=0; j=0; k=4;
B = quart(areacoord[2]);
B = mbquart(areacoord[2]);
pt += B * ctrl_pts[0];
//i=1; j=0; k=3;
B = 4.0 * areacoord[0] * cube(areacoord[2]);
B = 4.0 * areacoord[0] * mbcube(areacoord[2]);
pt += B * ctrl_pts[1];
//i=2; j=0; k=2;
B = 6.0 * sqr(areacoord[0]) * sqr(areacoord[2]);
B = 6.0 * mbsqr(areacoord[0]) * mbsqr(areacoord[2]);
pt += B * ctrl_pts[2];
//i=3; j=0; k=1;
B = 4.0 * cube(areacoord[0]) * areacoord[2];
B = 4.0 * mbcube(areacoord[0]) * areacoord[2];
pt += B * ctrl_pts[3];
//i=2; j=1; k=1;
B = 12.0 * sqr(areacoord[0]) * areacoord[1] * areacoord[2];
B = 12.0 * mbsqr(areacoord[0]) * areacoord[1] * areacoord[2];
pt += B * P_facet[0];
//i=1; j=2; k=1;
B = 12.0 * areacoord[0] * sqr(areacoord[1]) * areacoord[2];
B = 12.0 * areacoord[0] * mbsqr(areacoord[1]) * areacoord[2];
pt += B * P_facet[1];
//i=1; j=1; k=2;
B = 12.0 * areacoord[0] * areacoord[1] * sqr(areacoord[2]);
B = 12.0 * areacoord[0] * areacoord[1] * mbsqr(areacoord[2]);
pt += B * P_facet[2];
return MB_SUCCESS;
......@@ -1001,7 +996,7 @@ void SmoothFace::facet_area_coordinate(EntityHandle facet,
p[2][1], p[2][2]);
if (fabs(area2) < tol)
{
areacoord = CartVect(-CUBIT_DBL_MAX);// .set( -CUBIT_DBL_MAX, -CUBIT_DBL_MAX, -CUBIT_DBL_MAX );
areacoord = CartVect(-std::numeric_limits<double>::min());// .set( -std::numeric_limits<double>::min(), -std::numeric_limits<double>::min(), -std::numeric_limits<double>::min() );
}
else if (within_tolerance(p[0], pt_on_plane, GEOMETRY_RESABS))
{
......@@ -1037,7 +1032,7 @@ void SmoothFace::facet_area_coordinate(EntityHandle facet,
p[2][0], p[2][2]);
if (fabs(area2) < tol)
{
areacoord = CartVect(-CUBIT_DBL_MAX);//.set( -CUBIT_DBL_MAX, -CUBIT_DBL_MAX, -CUBIT_DBL_MAX );
areacoord = CartVect(-std::numeric_limits<double>::min());//.set( -std::numeric_limits<double>::min(), -std::numeric_limits<double>::min(), -std::numeric_limits<double>::min() );
}
else if (within_tolerance(p[0], pt_on_plane, GEOMETRY_RESABS))
{
......@@ -1076,7 +1071,7 @@ void SmoothFace::facet_area_coordinate(EntityHandle facet,
p[2][0], p[2][1]);
if (fabs(area2) < tol)
{
areacoord = CartVect(-CUBIT_DBL_MAX);//.set( -CUBIT_DBL_MAX, -CUBIT_DBL_MAX, -CUBIT_DBL_MAX );
areacoord = CartVect(-std::numeric_limits<double>::min());//.set( -std::numeric_limits<double>::min(), -std::numeric_limits<double>::min(), -std::numeric_limits<double>::min() );
}
else if (within_tolerance(p[0], pt_on_plane, GEOMETRY_RESABS))
{
......@@ -1874,27 +1869,27 @@ ErrorCode SmoothFace::eval_bezier_patch_normal(EntityHandle facet,
//i=3; j=0; k=0;
//double Bsum = 0.0;
double B = cube(areacoord[0]);
double B = mbcube(areacoord[0]);
//Bsum += B;
normal += B * Nijk[0];
//i=2; j=1; k=0;
B = 3.0 * sqr(areacoord[0]) * areacoord[1];
B = 3.0 * mbsqr(areacoord[0]) * areacoord[1];
//Bsum += B;
normal += B * Nijk[1];
//i=1; j=2; k=0;
B = 3.0 * areacoord[0] * sqr(areacoord[1]);
B = 3.0 * areacoord[0] * mbsqr(areacoord[1]);
//Bsum += B;
normal += B * Nijk[2];
//i=0; j=3; k=0;
B = cube(areacoord[1]);
B = mbcube(areacoord[1]);
//Bsum += B;
normal += B * Nijk[3];
//i=2; j=0; k=1;
B = 3.0 * sqr(areacoord[0]) * areacoord[2];
B = 3.0 * mbsqr(areacoord[0]) * areacoord[2];
//Bsum += B;
normal += B * Nijk[4];
......@@ -1904,22 +1899,22 @@ ErrorCode SmoothFace::eval_bezier_patch_normal(EntityHandle facet,
normal += B * Nijk[5];
//i=0; j=2; k=1;
B = 3.0 * sqr(areacoord[1]) * areacoord[2];
B = 3.0 * mbsqr(areacoord[1]) * areacoord[2];
//Bsum += B;
normal += B * Nijk[6];
//i=1; j=0; k=2;
B = 3.0 * areacoord[0] * sqr(areacoord[2]);
B = 3.0 * areacoord[0] * mbsqr(areacoord[2]);
//Bsum += B;
normal += B * Nijk[7];
//i=0; j=1; k=2;
B = 3.0 * areacoord[1] * sqr(areacoord[2]);
B = 3.0 * areacoord[1] * mbsqr(areacoord[2]);
//Bsum += B;
normal += B * Nijk[8];
//i=0; j=0; k=3;
B = cube(areacoord[2]);
B = mbcube(areacoord[2]);
//Bsum += B;
normal += B * Nijk[9];
......
#ifndef SMOOTH_FACE_EVAL_HPP
#define SMOOTH_FACE_EVAL_HPP
// do we really need iMesh here; maybe go directly to MOAB
//#include "iMesh.h"
#include "moab/Interface.hpp"
#include "moab/Range.hpp"
#include "moab/CartVect.hpp"
#include "MBTagConventions.hpp"
#include "moab/Types.hpp"
#define determ3(p1,q1,p2,q2,p3,q3) ((q3)*((p2)-(p1)) + (q2)*((p1)-(p3)) + (q1)*((p3)-(p2)))
#define sqr(a) ((a)*(a))
#define cube(a) (sqr(a) * (a))
#define quart(a) (sqr(a) * sqr(a))
#define blend(x) (-2.0*(x)*(x)*(x) + 3.0*(x)*(x))
#include <cmath>
#include <vector>
#include <map>
//#include "MBEntityHandle.hpp"
#define determ3(p1,q1,p2,q2,p3,q3) ((q3)*((p2)-(p1)) + (q2)*((p1)-(p3)) + (q1)*((p3)-(p2)))
#define blend(x) (-2.0*(x)*(x)*(x) + 3.0*(x)*(x))
// work only with CAMAL > = 500
// #if CAMAL_VERSION < 500
// #else
#include "moab/GeomTopoTool.hpp"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment