Skip to content
Snippets Groups Projects
Commit 389bde7f authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

set char length from lines (useful if we want to mesh 2D from boundary repres)
parent 7badd2f5
No related branches found
No related tags found
No related merge requests found
// $Id: Read_Mesh.cpp,v 1.99 2006-03-08 17:04:59 remacle Exp $
// $Id: Read_Mesh.cpp,v 1.100 2006-03-19 20:34:14 geuzaine Exp $
//
// Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
//
......@@ -146,11 +146,17 @@ int getNbrNodes(int Type)
}
}
double SetLC(Vertex *v1, Vertex *v2, Vertex *v3, Vertex *v4 = 0)
double SetLC(Vertex *v1, Vertex *v2, Vertex *v3 = 0, Vertex *v4 = 0)
{
double lc1 = sqrt((v1->Pos.X - v2->Pos.X) * (v1->Pos.X - v2->Pos.X) +
(v1->Pos.Y - v2->Pos.Y) * (v1->Pos.Y - v2->Pos.Y) +
(v1->Pos.Z - v2->Pos.Z) * (v1->Pos.Z - v2->Pos.Z));
if(!v3){
double lc = lc1 * CTX.mesh.lc_factor;
v1->lc = v2->lc = lc;
return lc;
}
else{
double lc2 = sqrt((v1->Pos.X - v3->Pos.X) * (v1->Pos.X - v3->Pos.X) +
(v1->Pos.Y - v3->Pos.Y) * (v1->Pos.Y - v3->Pos.Y) +
(v1->Pos.Z - v3->Pos.Z) * (v1->Pos.Z - v3->Pos.Z));
......@@ -162,6 +168,7 @@ double SetLC(Vertex *v1, Vertex *v2, Vertex *v3, Vertex *v4 = 0)
if(v4) v4->lc = lc;
return lc;
}
}
int getPartition ( const std::multimap<int,int> &nod2proc , int nbNod, Vertex *verts )
{
......@@ -414,6 +421,7 @@ void Read_Mesh_MSH(Mesh * M, FILE * fp)
simp->Num = Num;
simp->iEnt = Elementary;
simp->iPart = addMeshPartition(Partition, M);
SetLC(vertsp[0], vertsp[1]);
if(Type == LGN2){
simp->VSUP = (Vertex **) Malloc(1 * sizeof(Vertex *));
simp->VSUP[0] = vertsp[2];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment