diff --git a/Geo/GEntity.cpp b/Geo/GEntity.cpp index 853fb1fe101672c5b8e01b1fe66dcb1ae066a3d9..b9889dd9191e6b99b5e7c833d77c8523aa9b12e6 100644 --- a/Geo/GEntity.cpp +++ b/Geo/GEntity.cpp @@ -72,7 +72,7 @@ GRegion *GEntity::cast2Region() { return dynamic_cast<GRegion*>(this); } // sets the entity m from which the mesh will be copied void GEntity::setMeshMaster(int m_signed){ - printf("setting mesh master %d to mesh entity %d\n",m_signed,tag()); + // printf("setting mesh master %d to mesh entity %d\n",m_signed,tag()); GEntity *gMaster = 0; int m = abs(m_signed); @@ -91,7 +91,7 @@ void GEntity::setMeshMaster(int m_signed){ _meshMaster = m_signed; } else { - printf("mesh entity %d has already a master %d\n",m,masterOfMaster); + // printf("mesh entity %d has already a master %d\n",m,masterOfMaster); setMeshMaster ( masterOfMaster * ((m_signed > 0) ? 1 : -1)); } } diff --git a/Mesh/meshGFace.cpp b/Mesh/meshGFace.cpp index c4c5e05944f8cfaf4738d6e78e875cf4cdf16b3b..6464db45aacc3b861e296bceea2bc685015cea7c 100644 --- a/Mesh/meshGFace.cpp +++ b/Mesh/meshGFace.cpp @@ -113,20 +113,20 @@ static void copyMesh(GFace *source, GFace *target) if (count == 2) break; } - double t1u = param_target[0].x(), t1v = param_target[0].y(); - double t2u = param_target[1].x(), t2v = param_target[1].y(); - double s1u = param_source[0].x(), s1v = param_source[0].y(); - double s2u = param_source[1].x(), s2v = param_source[1].y(); + // double t1u = param_target[0].x(), t1v = param_target[0].y(); + // double t2u = param_target[1].x(), t2v = param_target[1].y(); + // double s1u = param_source[0].x(), s1v = param_source[0].y(); + // double s2u = param_source[1].x(), s2v = param_source[1].y(); - SVector3 _a(s2u - s1u, s2v - s1v, 0); - SVector3 _b(t2u - t1u, t2v - t1v, 0); + // SVector3 _a(s2u - s1u, s2v - s1v, 0); + // SVector3 _b(t2u - t1u, t2v - t1v, 0); - SVector3 _c = crossprod(_a, _b); - double sinA = _c.z(); - double cosA = dot(_a, _b); - const double theta = atan2(sinA, cosA); - const double c = cos(theta); - const double s = sin(theta); + // SVector3 _c = crossprod(_a, _b); + // double sinA = _c.z(); + // double cosA = dot(_a, _b); + // const double theta = atan2(sinA, cosA); + // const double c = cos(theta); + // const double s = sin(theta); for(unsigned int i = 0; i < source->mesh_vertices.size(); i++){ MVertex *vs = source->mesh_vertices[i]; @@ -134,8 +134,8 @@ static void copyMesh(GFace *source, GFace *target) vs->getParameter(0, u); vs->getParameter(1, v); // apply transformation - const double U = c * (u - s1u) + s * (v - s1v) + t1u; - const double V = -s * (u - s1u) + c * (v - s1v) + t1v; + // const double U = c * (u - s1u) + s * (v - s1v) + t1u; + // const double V = -s * (u - s1u) + c * (v - s1v) + t1v; SPoint3 tp (vs->x() + DX.x(),vs->y() + DX.y(),vs->z() + DX.z()); // const double initialGuess[2] = {U,V}; // FIXME !!! @@ -143,7 +143,7 @@ static void copyMesh(GFace *source, GFace *target) SPoint2 XXX = target->parFromPoint(tp); GPoint gp = target->point(XXX); - MVertex *vt = new MFaceVertex(gp.x(), gp.y(), gp.z(), target, U, V); + MVertex *vt = new MFaceVertex(gp.x(), gp.y(), gp.z(), target, gp.u(), gp.v()); target->mesh_vertices.push_back(vt); target->correspondingVertices[vt] = vs; vs2vt[vs] = vt; diff --git a/Mesh/meshGFaceDelaunayInsertion.cpp b/Mesh/meshGFaceDelaunayInsertion.cpp index 480b6080c1865cc791cf91df751f9e7436232c39..1dda4be66b8f083b16a4eccbcf5e9937c8db5b0c 100644 --- a/Mesh/meshGFaceDelaunayInsertion.cpp +++ b/Mesh/meshGFaceDelaunayInsertion.cpp @@ -277,17 +277,20 @@ int inCircumCircleAniso(GFace *gf, double *p1, double *p2, double *p3, } int inCircumCircleAniso(GFace *gf, MTriangle *base, - const double *uv, const double *metric, + const double *uv, const double *metricb, bidimMeshData & data) { - // int index0 = data.getIndex (base->getVertex(0)); - // int index1 = data.getIndex (base->getVertex(1)); - // int index2 = data.getIndex (base->getVertex(2)); - // double x[2], Radius2, metric[3]; double x[2], Radius2; - // double pa[2] = {(data.Us[index0] +data.Us[index1] + data.Us[index2]) / 3., - // (data.Vs[index0] +data.Vs[index1] + data.Vs[index2]) / 3.}; - // buildMetric(gf, pa, metric); + double metric[3]; + if (!metricb){ + int index0 = data.getIndex (base->getVertex(0)); + int index1 = data.getIndex (base->getVertex(1)); + int index2 = data.getIndex (base->getVertex(2)); + double pa[2] = {(data.Us[index0] +data.Us[index1] + data.Us[index2]) / 3., + (data.Vs[index0] +data.Vs[index1] + data.Vs[index2]) / 3.}; + buildMetric(gf, pa, metric); + } + else {metric[0] = metricb[0];metric[1] = metricb[1];metric[2] = metricb[2];}; circumCenterMetric(base, metric, data, x, Radius2); const double a = metric[0];