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
3d1b7d3e
Commit
3d1b7d3e
authored
16 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
modif to sum point values
parent
d1ec78bb
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Plugin/Integrate.cpp
+26
-13
26 additions, 13 deletions
Plugin/Integrate.cpp
with
26 additions
and
13 deletions
Plugin/Integrate.cpp
+
26
−
13
View file @
3d1b7d3e
...
@@ -77,7 +77,8 @@ PView *GMSH_IntegratePlugin::execute(PView * v)
...
@@ -77,7 +77,8 @@ PView *GMSH_IntegratePlugin::execute(PView * v)
List_Add
(
data2
->
SP
,
&
y
);
List_Add
(
data2
->
SP
,
&
y
);
List_Add
(
data2
->
SP
,
&
z
);
List_Add
(
data2
->
SP
,
&
z
);
for
(
int
step
=
0
;
step
<
data1
->
getNumTimeSteps
();
step
++
){
for
(
int
step
=
0
;
step
<
data1
->
getNumTimeSteps
();
step
++
){
double
res
=
0
;
double
res
=
0
,
resv
[
9
]
=
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
};
bool
simpleSum
=
false
;
for
(
int
ent
=
0
;
ent
<
data1
->
getNumEntities
(
step
);
ent
++
){
for
(
int
ent
=
0
;
ent
<
data1
->
getNumEntities
(
step
);
ent
++
){
for
(
int
ele
=
0
;
ele
<
data1
->
getNumElements
(
step
,
ent
);
ele
++
){
for
(
int
ele
=
0
;
ele
<
data1
->
getNumElements
(
step
,
ent
);
ele
++
){
if
(
data1
->
skipElement
(
step
,
ent
,
ele
))
continue
;
if
(
data1
->
skipElement
(
step
,
ent
,
ele
))
continue
;
...
@@ -86,7 +87,7 @@ PView *GMSH_IntegratePlugin::execute(PView * v)
...
@@ -86,7 +87,7 @@ PView *GMSH_IntegratePlugin::execute(PView * v)
bool
scalar
=
(
numComp
==
1
);
bool
scalar
=
(
numComp
==
1
);
bool
circulation
=
(
numComp
==
3
&&
numEdges
==
1
);
bool
circulation
=
(
numComp
==
3
&&
numEdges
==
1
);
bool
flux
=
(
numComp
==
3
&&
(
numEdges
==
3
||
numEdges
==
4
));
bool
flux
=
(
numComp
==
3
&&
(
numEdges
==
3
||
numEdges
==
4
));
if
(
!
scalar
&&
!
circulation
&&
!
flux
)
continue
;
//
if(!scalar && !circulation && !flux) continue;
int
numNodes
=
data1
->
getNumNodes
(
step
,
ent
,
ele
);
int
numNodes
=
data1
->
getNumNodes
(
step
,
ent
,
ele
);
int
dim
=
data1
->
getDimension
(
step
,
ent
,
ele
);
int
dim
=
data1
->
getDimension
(
step
,
ent
,
ele
);
double
x
[
8
],
y
[
8
],
z
[
8
],
val
[
8
*
3
];
double
x
[
8
],
y
[
8
],
z
[
8
],
val
[
8
*
3
];
...
@@ -95,19 +96,31 @@ PView *GMSH_IntegratePlugin::execute(PView * v)
...
@@ -95,19 +96,31 @@ PView *GMSH_IntegratePlugin::execute(PView * v)
for
(
int
comp
=
0
;
comp
<
numComp
;
comp
++
)
for
(
int
comp
=
0
;
comp
<
numComp
;
comp
++
)
data1
->
getValue
(
step
,
ent
,
ele
,
nod
,
comp
,
val
[
numComp
*
nod
+
comp
]);
data1
->
getValue
(
step
,
ent
,
ele
,
nod
,
comp
,
val
[
numComp
*
nod
+
comp
]);
}
}
elementFactory
factory
;
if
(
numNodes
==
1
){
element
*
element
=
factory
.
create
(
numNodes
,
dim
,
x
,
y
,
z
);
simpleSum
=
true
;
if
(
!
element
)
continue
;
for
(
int
comp
=
0
;
comp
<
numComp
;
comp
++
)
if
(
scalar
)
resv
[
comp
]
+=
val
[
comp
];
res
+=
element
->
integrate
(
val
);
}
else
if
(
circulation
)
else
{
res
+=
element
->
integrateCirculation
(
val
);
elementFactory
factory
;
else
if
(
flux
)
element
*
element
=
factory
.
create
(
numNodes
,
dim
,
x
,
y
,
z
);
res
+=
element
->
integrateFlux
(
val
);
if
(
!
element
)
continue
;
delete
element
;
if
(
scalar
)
res
+=
element
->
integrate
(
val
);
else
if
(
circulation
)
res
+=
element
->
integrateCirculation
(
val
);
else
if
(
flux
)
res
+=
element
->
integrateFlux
(
val
);
delete
element
;
}
}
}
}
}
Msg
::
Info
(
"Step %d: integral = %.16g"
,
step
,
res
);
if
(
simpleSum
)
Msg
::
Info
(
"Step %d: sum = %g %g %g %g %g %g %g %g %g"
,
step
,
resv
[
0
],
resv
[
1
],
resv
[
2
],
resv
[
3
],
resv
[
4
],
resv
[
5
],
resv
[
6
],
resv
[
7
],
resv
[
8
],
resv
[
9
]);
else
Msg
::
Info
(
"Step %d: integral = %.16g"
,
step
,
res
);
List_Add
(
data2
->
SP
,
&
res
);
List_Add
(
data2
->
SP
,
&
res
);
}
}
data2
->
NbSP
=
1
;
data2
->
NbSP
=
1
;
...
...
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