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
a9b14a1d
Commit
a9b14a1d
authored
20 years ago
by
Jean-François Remacle
Browse files
Options
Downloads
Patches
Plain Diff
*** empty log message ***
parent
0809ecfa
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Common/AdaptiveViews.cpp
+20
-10
20 additions, 10 deletions
Common/AdaptiveViews.cpp
Plugin/Integrate.cpp
+25
-4
25 additions, 4 deletions
Plugin/Integrate.cpp
with
45 additions
and
14 deletions
Common/AdaptiveViews.cpp
+
20
−
10
View file @
a9b14a1d
...
...
@@ -80,6 +80,19 @@ void _triangle::Recur_Create (_triangle *t, int maxlevel, int level , Double_Mat
all_triangles
.
push_back
(
t
);
if
(
level
++
>=
maxlevel
)
return
;
/*
p3
p13 p23
p1 p12 p2
*/
_point
*
p1
=
t
->
p
[
0
];
_point
*
p2
=
t
->
p
[
1
];
...
...
@@ -87,13 +100,13 @@ void _triangle::Recur_Create (_triangle *t, int maxlevel, int level , Double_Mat
_point
*
p12
=
_point
::
New
(
(
p1
->
x
+
p2
->
x
)
*
0.5
,(
p1
->
y
+
p2
->
y
)
*
0.5
,
0
,
coeffs
,
eexps
);
_point
*
p13
=
_point
::
New
(
(
p1
->
x
+
p3
->
x
)
*
0.5
,(
p1
->
y
+
p3
->
y
)
*
0.5
,
0
,
coeffs
,
eexps
);
_point
*
p23
=
_point
::
New
(
(
p3
->
x
+
p2
->
x
)
*
0.5
,(
p3
->
y
+
p2
->
y
)
*
0.5
,
0
,
coeffs
,
eexps
);
_triangle
*
t1
=
new
_triangle
(
p1
,
p1
2
,
p1
3
);
_triangle
*
t1
=
new
_triangle
(
p1
,
p1
3
,
p1
2
);
Recur_Create
(
t1
,
maxlevel
,
level
,
coeffs
,
eexps
);
_triangle
*
t2
=
new
_triangle
(
p12
,
p23
,
p2
);
Recur_Create
(
t2
,
maxlevel
,
level
,
coeffs
,
eexps
);
_triangle
*
t3
=
new
_triangle
(
p23
,
p13
,
p3
);
Recur_Create
(
t3
,
maxlevel
,
level
,
coeffs
,
eexps
);
_triangle
*
t4
=
new
_triangle
(
p12
,
p
2
3
,
p
1
3
);
_triangle
*
t4
=
new
_triangle
(
p12
,
p
1
3
,
p
2
3
);
Recur_Create
(
t4
,
maxlevel
,
level
,
coeffs
,
eexps
);
t
->
t
[
0
]
=
t1
;
t
->
t
[
1
]
=
t2
;
t
->
t
[
2
]
=
t3
;
t
->
t
[
3
]
=
t4
;
...
...
@@ -215,18 +228,15 @@ void Adaptive_Post_View:: zoomElement (Post_View * view ,
{
_point
*
p
=
(
_point
*
)
&
(
*
it
);
p
->
val
=
res
(
kk
);
// for ( int k=0;k<N;++k)
// {
// p->val += p->shape_functions[k] * (*_STval )( ielem , k );
// }
// p->X = (*_STposX) ( ielem , 0 ) * ( 1.-p->x-p->y) + (*_STposX) ( ielem , 1 ) * p->x + (*_STposX) ( ielem , 2 ) * p->y;
// p->Y = (*_STposY) ( ielem , 0 ) * ( 1.-p->x-p->y) + (*_STposY) ( ielem , 1 ) * p->x + (*_STposY) ( ielem , 2 ) * p->y;
// p->Z = (*_STposZ) ( ielem , 0 ) * ( 1.-p->x-p->y) + (*_STposZ) ( ielem , 1 ) * p->x + (*_STposZ) ( ielem , 2 ) * p->y;
p
->
X
=
XYZ
(
kk
,
0
);
p
->
Y
=
XYZ
(
kk
,
1
);
p
->
Z
=
XYZ
(
kk
,
2
);
/// -----------------------------------------------
/// TEST TEST ZZUT CHIOTTE VIREZ MOI CA VITE FAIT
/// -----------------------------------------------
// p->val = p->X * p->X + p->Y*p->Y - 1;
if
(
min
>
p
->
val
)
min
=
p
->
val
;
if
(
max
<
p
->
val
)
max
=
p
->
val
;
kk
++
;
...
...
This diff is collapsed.
Click to expand it.
Plugin/Integrate.cpp
+
25
−
4
View file @
a9b14a1d
// $Id: Integrate.cpp,v 1.
1
2004-11-
13 23:57:28 geuzain
e Exp $
// $Id: Integrate.cpp,v 1.
2
2004-11-
22 11:35:26 remacl
e Exp $
//
// Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
//
...
...
@@ -30,7 +30,8 @@
extern
Context_T
CTX
;
StringXNumber
IntegrateOptions_Number
[]
=
{
{
GMSH_FULLRC
,
"iView"
,
NULL
,
-
1.
}
{
GMSH_FULLRC
,
"iView"
,
NULL
,
-
1.
},
{
GMSH_FULLRC
,
"computeLevelsetPositive"
,
NULL
,
0.
}
};
extern
"C"
...
...
@@ -63,7 +64,11 @@ void GMSH_IntegratePlugin::getInfos(char *author, char *copyright,
"line/surface elements. If `iView' < 0, the plugin
\n
"
"is run on the current view.
\n
"
"
\n
"
"Plugin(Integrate) creates one new view.
\n
"
);
"If computeLevelsetPositive is not 0, then the plugin
\n
"
"computes the positive area (volume)of the map
\n
"
"
\n
"
"Plugin(Integrate) creates one new view.
\n
"
);
}
int
GMSH_IntegratePlugin
::
getNbOptions
()
const
...
...
@@ -86,6 +91,8 @@ static double integrate(int nbList, List_T *list, int dim,
{
if
(
!
nbList
)
return
0.
;
const
int
levelsetPositive
=
(
int
)
IntegrateOptions_Number
[
1
].
def
;
double
res
=
0.
;
int
nb
=
List_Nbr
(
list
)
/
nbList
;
for
(
int
i
=
0
;
i
<
List_Nbr
(
list
);
i
+=
nb
)
{
...
...
@@ -110,7 +117,20 @@ static double integrate(int nbList, List_T *list, int dim,
else
if
(
dim
==
2
){
if
(
nbNod
==
3
){
triangle
t
(
x
,
y
,
z
);
if
(
nbComp
==
1
)
res
+=
t
.
integrate
(
v
);
if
(
nbComp
==
1
)
{
if
(
!
levelsetPositive
)
res
+=
t
.
integrate
(
v
);
else
{
double
ONES
[]
=
{
1.0
,
1.0
,
1.0
};
const
double
area
=
t
.
integrate
(
ONES
);
const
double
SUM
=
v
[
0
]
+
v
[
1
]
+
v
[
2
];
const
double
SUMABS
=
fabs
(
v
[
0
])
+
fabs
(
v
[
1
])
+
fabs
(
v
[
2
]);
const
double
XI
=
SUM
/
SUMABS
;
res
+=
area
*
(
1
-
XI
)
*
0.5
;
}
}
else
if
(
nbComp
==
3
)
res
+=
t
.
integrateFlux
(
v
);
}
else
if
(
nbNod
==
4
){
...
...
@@ -138,6 +158,7 @@ static double integrate(int nbList, List_T *list, int dim,
}
}
}
printf
(
"integration res = %22.15E
\n
"
,
res
);
return
res
;
}
...
...
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