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
1d90e12b
Commit
1d90e12b
authored
14 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
No commit message
No commit message
parent
fa5bbf4c
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
Numeric/cartesian.h
+12
-13
12 additions, 13 deletions
Numeric/cartesian.h
utils/api_demos/mainCartesian.cpp
+14
-3
14 additions, 3 deletions
utils/api_demos/mainCartesian.cpp
with
26 additions
and
16 deletions
Numeric/cartesian.h
+
12
−
13
View file @
1d90e12b
...
...
@@ -40,7 +40,7 @@ class cartesianBox {
// set of active cells; the value stored for cell (i,j,k) is the
// linear index (i + _Nxi * j + _Nxi *_Neta * k)
std
::
set
<
int
>
_activeCells
;
// map of stored nodal values, index by the linear index (i +
// map of stored nodal values, index
ed
by the linear index (i +
// (_Nxi+1) * j + (_Nxi+1) * (_Neta+1) * k). Along with the value is
// stored a node tag (used for global numbering of the nodes across
// the grid levels)
...
...
@@ -48,7 +48,7 @@ class cartesianBox {
// level of the box (coarset box has highest level; finest box has
// level==1)
int
_level
;
// pointer to a finer (refined by 2) level box
(
if any
)
// pointer to a finer (refined by 2) level box
,
if any
cartesianBox
<
scalar
>
*
_childBox
;
int
_getNumNodes
()
{
...
...
@@ -82,16 +82,15 @@ class cartesianBox {
int
i
,
j
,
k
;
getCellIJK
(
*
it
,
i
,
j
,
k
);
if
(
!
simplex
){
fprintf
(
f
,
"%d 5 3 1 1 1"
,
num
++
);
fprintf
(
f
,
" %d"
,
std
::
abs
(
getNodeTag
(
getNodeIndex
(
i
,
j
,
k
))));
fprintf
(
f
,
" %d"
,
std
::
abs
(
getNodeTag
(
getNodeIndex
(
i
+
1
,
j
,
k
))));
fprintf
(
f
,
" %d"
,
std
::
abs
(
getNodeTag
(
getNodeIndex
(
i
+
1
,
j
+
1
,
k
))));
fprintf
(
f
,
" %d"
,
std
::
abs
(
getNodeTag
(
getNodeIndex
(
i
,
j
+
1
,
k
))));
fprintf
(
f
,
" %d"
,
std
::
abs
(
getNodeTag
(
getNodeIndex
(
i
,
j
,
k
+
1
))));
fprintf
(
f
,
" %d"
,
std
::
abs
(
getNodeTag
(
getNodeIndex
(
i
+
1
,
j
,
k
+
1
))));
fprintf
(
f
,
" %d"
,
std
::
abs
(
getNodeTag
(
getNodeIndex
(
i
+
1
,
j
+
1
,
k
+
1
))));
fprintf
(
f
,
" %d"
,
std
::
abs
(
getNodeTag
(
getNodeIndex
(
i
,
j
+
1
,
k
+
1
))));
fprintf
(
f
,
"
\n
"
);
fprintf
(
f
,
"%d 5 3 1 1 1 %d %d %d %d %d %d %d %d
\n
"
,
num
++
,
std
::
abs
(
getNodeTag
(
getNodeIndex
(
i
,
j
,
k
))),
std
::
abs
(
getNodeTag
(
getNodeIndex
(
i
+
1
,
j
,
k
))),
std
::
abs
(
getNodeTag
(
getNodeIndex
(
i
+
1
,
j
+
1
,
k
))),
std
::
abs
(
getNodeTag
(
getNodeIndex
(
i
,
j
+
1
,
k
))),
std
::
abs
(
getNodeTag
(
getNodeIndex
(
i
,
j
,
k
+
1
))),
std
::
abs
(
getNodeTag
(
getNodeIndex
(
i
+
1
,
j
,
k
+
1
))),
std
::
abs
(
getNodeTag
(
getNodeIndex
(
i
+
1
,
j
+
1
,
k
+
1
))),
std
::
abs
(
getNodeTag
(
getNodeIndex
(
i
,
j
+
1
,
k
+
1
))));
}
else
{
int
idx
[
6
][
4
]
=
{
...
...
@@ -165,7 +164,7 @@ class cartesianBox {
if
(
it
!=
_nodalValues
.
end
())
values
.
push_back
(
it
->
second
.
first
);
else
{
Msg
::
Error
(
"Could not find value i,j,k=%d,%d,%d for cell %d
\n
"
,
Msg
::
Error
(
"Could not find value i,j,k=%d,%d,%d for cell %d"
,
i
+
I
,
j
+
J
,
k
+
K
,
t
);
values
.
push_back
(
0.
);
}
...
...
This diff is collapsed.
Click to expand it.
utils/api_demos/mainCartesian.cpp
+
14
−
3
View file @
1d90e12b
// lx ly lz rmax levels
//
// plaqueEp.stp 0.2 0.2 0.2 0.3 3
// plaqueEpRotated.stp 0.3 0.3 0.3 0.3 3
// jonction_collee2.stp 6 6 6 10 3
// panneau_raidi_simple.stp 3 3 50 10 1
// plaque_trouee.stp 1 1 1 2 3
#include
"Gmsh.h"
#include
"GModel.h"
#include
"MVertex.h"
...
...
@@ -184,10 +192,12 @@ int main(int argc,char *argv[])
double
rmax
=
atof
(
argv
[
5
]);
int
levels
=
(
argc
>
6
)
?
atof
(
argv
[
6
])
:
1
;
// minimum distance between points in the cloud at the coarsest level
// minimum distance between points in the cloud at the coarsest
// level
double
sampling
=
std
::
min
(
rmax
,
std
::
min
(
lx
,
std
::
min
(
ly
,
lz
)));
// radius of the "tube" created around edges at the coarsest level
// radius of the "tube" created around parts to refine at the
// coarsest level
double
rtube
=
std
::
max
(
lx
,
std
::
max
(
ly
,
lz
))
*
2.
;
GModel
*
gm
=
GModel
::
current
();
...
...
@@ -270,7 +280,8 @@ int main(int argc,char *argv[])
Msg
::
Info
(
"Renumbering mesh vertices across levels"
);
box
.
renumberNodes
();
box
.
writeMSH
(
"yeah.msh"
,
true
);
bool
decomposeInSimplex
=
false
;
box
.
writeMSH
(
"yeah.msh"
,
decomposeInSimplex
);
Msg
::
Info
(
"Done!"
);
GmshFinalize
();
...
...
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