Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
46bfd6ea
Commit
46bfd6ea
authored
12 years ago
by
Bastien Gorissen
Browse files
Options
Downloads
Patches
Plain Diff
Removed warnings
parent
f10e9dd8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Mesh/highOrderTools.cpp
+11
-11
11 additions, 11 deletions
Mesh/highOrderTools.cpp
Solver/linearSystemCSR.h
+1
-1
1 addition, 1 deletion
Solver/linearSystemCSR.h
with
12 additions
and
12 deletions
Mesh/highOrderTools.cpp
+
11
−
11
View file @
46bfd6ea
...
@@ -203,7 +203,7 @@ void highOrderTools::computeMetricInfo(GFace *gf,
...
@@ -203,7 +203,7 @@ void highOrderTools::computeMetricInfo(GFace *gf,
// printf("ELEMENT --\n");
// printf("ELEMENT --\n");
for
(
int
j
=
0
;
j
<
nbNodes
;
j
++
){
for
(
int
j
=
0
;
j
<
nbNodes
;
j
++
){
SPoint2
param
;
SPoint2
param
;
bool
success
=
reparamMeshVertexOnFace
(
e
->
getVertex
(
j
),
gf
,
param
);
reparamMeshVertexOnFace
(
e
->
getVertex
(
j
),
gf
,
param
);
// printf("%g %g vs %g %g %g\n",param.x(),param.y(),
// printf("%g %g vs %g %g %g\n",param.x(),param.y(),
// e->getVertex(j)->x(),e->getVertex(j)->y(),e->getVertex(j)->z());
// e->getVertex(j)->x(),e->getVertex(j)->y(),e->getVertex(j)->z());
...
@@ -441,7 +441,7 @@ void highOrderTools::computeStraightSidedPositions ()
...
@@ -441,7 +441,7 @@ void highOrderTools::computeStraightSidedPositions ()
// printf("coucou2\n");
// printf("coucou2\n");
// compute stright sided positions of vertices that are classified on model edges
// compute stright sided positions of vertices that are classified on model edges
for
(
GModel
::
eiter
it
=
_gm
->
firstEdge
();
it
!=
_gm
->
lastEdge
();
++
it
){
for
(
GModel
::
eiter
it
=
_gm
->
firstEdge
();
it
!=
_gm
->
lastEdge
();
++
it
){
for
(
int
i
=
0
;
i
<
(
*
it
)
->
lines
.
size
();
i
++
){
for
(
unsigned
int
i
=
0
;
i
<
(
*
it
)
->
lines
.
size
();
i
++
){
MLine
*
l
=
(
*
it
)
->
lines
[
i
];
MLine
*
l
=
(
*
it
)
->
lines
[
i
];
int
N
=
l
->
getNumVertices
()
-
2
;
int
N
=
l
->
getNumVertices
()
-
2
;
SVector3
p0
((
*
it
)
->
lines
[
i
]
->
getVertex
(
0
)
->
x
(),
SVector3
p0
((
*
it
)
->
lines
[
i
]
->
getVertex
(
0
)
->
x
(),
...
@@ -467,12 +467,12 @@ void highOrderTools::computeStraightSidedPositions ()
...
@@ -467,12 +467,12 @@ void highOrderTools::computeStraightSidedPositions ()
// printf("coucou3\n");
// printf("coucou3\n");
// compute stright sided positions of vertices that are classified on model faces
// compute stright sided positions of vertices that are classified on model faces
for
(
GModel
::
fiter
it
=
_gm
->
firstFace
();
it
!=
_gm
->
lastFace
();
++
it
){
for
(
GModel
::
fiter
it
=
_gm
->
firstFace
();
it
!=
_gm
->
lastFace
();
++
it
){
for
(
int
i
=
0
;
i
<
(
*
it
)
->
mesh_vertices
.
size
();
i
++
){
for
(
unsigned
int
i
=
0
;
i
<
(
*
it
)
->
mesh_vertices
.
size
();
i
++
){
MVertex
*
v
=
(
*
it
)
->
mesh_vertices
[
i
];
MVertex
*
v
=
(
*
it
)
->
mesh_vertices
[
i
];
_targetLocation
[
v
]
=
SVector3
(
v
->
x
(),
v
->
y
(),
v
->
z
());
_targetLocation
[
v
]
=
SVector3
(
v
->
x
(),
v
->
y
(),
v
->
z
());
}
}
for
(
int
i
=
0
;
i
<
(
*
it
)
->
triangles
.
size
();
i
++
){
for
(
unsigned
int
i
=
0
;
i
<
(
*
it
)
->
triangles
.
size
();
i
++
){
MTriangle
*
t
=
(
*
it
)
->
triangles
[
i
];
MTriangle
*
t
=
(
*
it
)
->
triangles
[
i
];
MFace
face
=
t
->
getFace
(
0
);
MFace
face
=
t
->
getFace
(
0
);
const
polynomialBasis
*
fs
=
t
->
getFunctionSpace
();
const
polynomialBasis
*
fs
=
t
->
getFunctionSpace
();
...
@@ -486,7 +486,7 @@ void highOrderTools::computeStraightSidedPositions ()
...
@@ -486,7 +486,7 @@ void highOrderTools::computeStraightSidedPositions ()
}
}
}
}
}
}
for
(
int
i
=
0
;
i
<
(
*
it
)
->
quadrangles
.
size
();
i
++
){
for
(
unsigned
int
i
=
0
;
i
<
(
*
it
)
->
quadrangles
.
size
();
i
++
){
// printf("coucou quad %d\n",i);
// printf("coucou quad %d\n",i);
MQuadrangle
*
q
=
(
*
it
)
->
quadrangles
[
i
];
MQuadrangle
*
q
=
(
*
it
)
->
quadrangles
[
i
];
MFace
face
=
q
->
getFace
(
0
);
MFace
face
=
q
->
getFace
(
0
);
...
@@ -504,11 +504,11 @@ void highOrderTools::computeStraightSidedPositions ()
...
@@ -504,11 +504,11 @@ void highOrderTools::computeStraightSidedPositions ()
}
}
for
(
GModel
::
riter
it
=
_gm
->
firstRegion
();
it
!=
_gm
->
lastRegion
();
++
it
){
for
(
GModel
::
riter
it
=
_gm
->
firstRegion
();
it
!=
_gm
->
lastRegion
();
++
it
){
for
(
int
i
=
0
;
i
<
(
*
it
)
->
mesh_vertices
.
size
();
i
++
){
for
(
unsigned
int
i
=
0
;
i
<
(
*
it
)
->
mesh_vertices
.
size
();
i
++
){
MVertex
*
v
=
(
*
it
)
->
mesh_vertices
[
i
];
MVertex
*
v
=
(
*
it
)
->
mesh_vertices
[
i
];
_targetLocation
[
v
]
=
SVector3
(
v
->
x
(),
v
->
y
(),
v
->
z
());
_targetLocation
[
v
]
=
SVector3
(
v
->
x
(),
v
->
y
(),
v
->
z
());
}
}
for
(
int
i
=
0
;
i
<
(
*
it
)
->
tetrahedra
.
size
();
i
++
){
for
(
unsigned
int
i
=
0
;
i
<
(
*
it
)
->
tetrahedra
.
size
();
i
++
){
_dim
=
3
;
_dim
=
3
;
MTetrahedron
*
t
=
(
*
it
)
->
tetrahedra
[
i
];
MTetrahedron
*
t
=
(
*
it
)
->
tetrahedra
[
i
];
MTetrahedron
t_1
((
*
it
)
->
tetrahedra
[
i
]
->
getVertex
(
0
),
MTetrahedron
t_1
((
*
it
)
->
tetrahedra
[
i
]
->
getVertex
(
0
),
...
@@ -527,7 +527,7 @@ void highOrderTools::computeStraightSidedPositions ()
...
@@ -527,7 +527,7 @@ void highOrderTools::computeStraightSidedPositions ()
}
}
}
}
}
}
for
(
int
i
=
0
;
i
<
(
*
it
)
->
hexahedra
.
size
();
i
++
){
for
(
unsigned
int
i
=
0
;
i
<
(
*
it
)
->
hexahedra
.
size
();
i
++
){
_dim
=
3
;
_dim
=
3
;
MHexahedron
*
h
=
(
*
it
)
->
hexahedra
[
i
];
MHexahedron
*
h
=
(
*
it
)
->
hexahedra
[
i
];
MHexahedron
h_1
((
*
it
)
->
hexahedra
[
i
]
->
getVertex
(
0
),
MHexahedron
h_1
((
*
it
)
->
hexahedra
[
i
]
->
getVertex
(
0
),
...
@@ -707,7 +707,7 @@ void highOrderTools::ensureMinimumDistorsion(std::vector<MElement*> &all,
...
@@ -707,7 +707,7 @@ void highOrderTools::ensureMinimumDistorsion(std::vector<MElement*> &all,
getDistordedElements
(
all
,
threshold
,
disto
,
minD
);
getDistordedElements
(
all
,
threshold
,
disto
,
minD
);
if
(
disto
.
empty
())
break
;
if
(
disto
.
empty
())
break
;
Msg
::
Info
(
"Fixing %d bad curved elements (worst disto %g)"
,
disto
.
size
(),
minD
);
Msg
::
Info
(
"Fixing %d bad curved elements (worst disto %g)"
,
disto
.
size
(),
minD
);
for
(
int
i
=
0
;
i
<
disto
.
size
();
i
++
){
for
(
unsigned
int
i
=
0
;
i
<
disto
.
size
();
i
++
){
ensureMinimumDistorsion
(
disto
[
i
],
threshold
);
ensureMinimumDistorsion
(
disto
[
i
],
threshold
);
}
}
}
}
...
@@ -717,7 +717,7 @@ double highOrderTools::applySmoothingTo (std::vector<MElement*> &all,
...
@@ -717,7 +717,7 @@ double highOrderTools::applySmoothingTo (std::vector<MElement*> &all,
double
threshold
,
bool
mixed
)
double
threshold
,
bool
mixed
)
{
{
int
ITER
=
0
;
int
ITER
=
0
;
double
minD
,
FACT
=
1.0
;
double
minD
;
std
::
vector
<
MElement
*>
disto
;
std
::
vector
<
MElement
*>
disto
;
// move the points to their straight sided locations
// move the points to their straight sided locations
for
(
unsigned
int
i
=
0
;
i
<
all
.
size
();
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
all
.
size
();
i
++
)
...
@@ -737,7 +737,7 @@ double highOrderTools::applySmoothingTo (std::vector<MElement*> &all,
...
@@ -737,7 +737,7 @@ double highOrderTools::applySmoothingTo (std::vector<MElement*> &all,
while
(
1
){
while
(
1
){
char
NN
[
256
];
char
NN
[
256
];
sprintf
(
NN
,
"smoothing-%d.msh"
,
ITER
++
);
sprintf
(
NN
,
"smoothing-%d.msh"
,
ITER
++
);
double
percentage_of_what_is_left
=
apply_incremental_displacement
(
1.
,
all
,
mixed
,
threshold
,
NN
,
all
);
percentage_of_what_is_left
=
apply_incremental_displacement
(
1.
,
all
,
mixed
,
threshold
,
NN
,
all
);
percentage
+=
(
1.
-
percentage
)
*
percentage_of_what_is_left
/
100.
;
percentage
+=
(
1.
-
percentage
)
*
percentage_of_what_is_left
/
100.
;
Msg
::
Info
(
"The smoother was able to do %3d percent of the motion"
,(
int
)(
percentage
*
100.
));
Msg
::
Info
(
"The smoother was able to do %3d percent of the motion"
,(
int
)(
percentage
*
100.
));
if
(
percentage_of_what_is_left
==
0.0
)
break
;
if
(
percentage_of_what_is_left
==
0.0
)
break
;
...
...
This diff is collapsed.
Click to expand it.
Solver/linearSystemCSR.h
+
1
−
1
View file @
46bfd6ea
...
@@ -28,8 +28,8 @@ int CSRList_Nbr(CSRList_T *liste);
...
@@ -28,8 +28,8 @@ int CSRList_Nbr(CSRList_T *liste);
template
<
class
scalar
>
template
<
class
scalar
>
class
linearSystemCSR
:
public
linearSystem
<
scalar
>
{
class
linearSystemCSR
:
public
linearSystem
<
scalar
>
{
protected:
protected:
bool
_entriesPreAllocated
;
bool
sorted
;
bool
sorted
;
bool
_entriesPreAllocated
;
char
*
something
;
char
*
something
;
CSRList_T
*
_a
,
*
_ai
,
*
_ptr
,
*
_jptr
;
CSRList_T
*
_a
,
*
_ai
,
*
_ptr
,
*
_jptr
;
std
::
vector
<
scalar
>
*
_b
,
*
_x
;
std
::
vector
<
scalar
>
*
_b
,
*
_x
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment