Skip to content
Snippets Groups Projects
Commit 86bd617c authored by Maximilien Siavelis's avatar Maximilien Siavelis
Browse files

No commit message

No commit message
parent c4966acf
Branches
Tags
No related merge requests found
...@@ -476,8 +476,8 @@ std::vector < int > GMSH_FaultZoneMesher::HeavisideFunc(MVertex* mVert, SPoint3& ...@@ -476,8 +476,8 @@ std::vector < int > GMSH_FaultZoneMesher::HeavisideFunc(MVertex* mVert, SPoint3&
double norm = vectPoint.normalize(); double norm = vectPoint.normalize();
assert(norm); assert(norm);
std::vector < int > heav;
if (_nodeByHeavNode.find( mVert ) != _nodeByHeavNode.end()){// if it is a pure heaviside node if (_nodeByHeavNode.find( mVert ) != _nodeByHeavNode.end()){// if it is a pure heaviside node
std::vector < int > heav(1, 0);
SVector3 vectNorm = _vectNormByFissure[_fissureByHeavNode[mVert]]; SVector3 vectNorm = _vectNormByFissure[_fissureByHeavNode[mVert]];
double lsn = dot(vectPoint, vectNorm); double lsn = dot(vectPoint, vectNorm);
if (lsn == 0){ if (lsn == 0){
...@@ -486,24 +486,24 @@ std::vector < int > GMSH_FaultZoneMesher::HeavisideFunc(MVertex* mVert, SPoint3& ...@@ -486,24 +486,24 @@ std::vector < int > GMSH_FaultZoneMesher::HeavisideFunc(MVertex* mVert, SPoint3&
SVector3 vectTan = _vectsTanByTipNode[mVert]; SVector3 vectTan = _vectsTanByTipNode[mVert];
assert(dot(vectPoint, vectTan) > 0); assert(dot(vectPoint, vectTan) > 0);
} }
heav[0] = sign(lsn); heav.push_back(sign(lsn));
return heav;
} }
else if (_nodesByJunctionNode.find( mVert ) != _nodesByJunctionNode.end()){ // if it is a junction node else if (_nodesByJunctionNode.find( mVert ) != _nodesByJunctionNode.end()){ // if it is a junction node
std::vector < GEdge* > fissures = _fissuresByJunctionNode[mVert]; std::vector < GEdge* > fissures = _fissuresByJunctionNode[mVert];
unsigned int size = fissures.size(); unsigned int size = fissures.size();
std::vector < int > heav(size, 0);
for (unsigned int i=0; i < size; i++){ for (unsigned int i=0; i < size; i++){
SVector3 vectNorm = _vectNormByFissure[fissures[i]]; SVector3 vectNorm = _vectNormByFissure[fissures[i]];
double lsn = dot(vectPoint, vectNorm); double lsn = dot(vectPoint, vectNorm);
if (fabs(lsn) > 1e-12) // tolerance seem to be ok if (fabs(lsn) > 1e-12) // tolerance seem to be ok
heav[i] = sign(lsn); heav.push_back(sign(lsn));
else
heav.push_back(0);
} }
return heav;
} }
else// if it is not a heaviside node else// if it is not a heaviside node
assert(false); assert(false);
return heav;
} }
//================================================================================ //================================================================================
...@@ -540,7 +540,7 @@ void GMSH_FaultZoneMesher::CreateJointElements(GModel* gModel, GFace* gFace, std ...@@ -540,7 +540,7 @@ void GMSH_FaultZoneMesher::CreateJointElements(GModel* gModel, GFace* gFace, std
continue; continue;
SPoint3 bary = mElem->barycenter(); SPoint3 bary = mElem->barycenter();
std::vector <MVertex*> mVerts(8, NULL); MVertex* mVerts[8];
// retriving MVertices to create the new MElement // retriving MVertices to create the new MElement
for(int j = 0; j < mElem->getNumVertices(); j++){ for(int j = 0; j < mElem->getNumVertices(); j++){
......
...@@ -93,10 +93,10 @@ inline bool compareHeav(const std::vector< int > heav1, const std::vector< int > ...@@ -93,10 +93,10 @@ inline bool compareHeav(const std::vector< int > heav1, const std::vector< int >
*/ */
//============================================================================= //=============================================================================
inline int findMatchingHeav(const std::vector< std::vector < int > >& heavFunc, const std::vector< int >& heav){ inline int findMatchingHeav(const std::vector< std::vector < int > >& heavFunc, const std::vector< int >& heav){
for (unsigned int i=0; i < heavFunc.size();i++){ unsigned int i=0;
if(compareHeav(heavFunc[i], heav)) for (; i < heavFunc.size();i++)
return i; if(compareHeav(heavFunc[i], heav)) break;
} assert(i<heavFunc.size());
assert(false); return i;
} }
#endif #endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment