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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
2f0dec31
Commit
2f0dec31
authored
May 15, 2011
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
merge DIFFPACK patch from Jacques Lechelle
parent
6f063866
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Common/OpenFile.cpp
+3
-0
3 additions, 0 deletions
Common/OpenFile.cpp
Geo/GModelIO_Mesh.cpp
+52
-50
52 additions, 50 deletions
Geo/GModelIO_Mesh.cpp
with
55 additions
and
50 deletions
Common/OpenFile.cpp
+
3
−
0
View file @
2f0dec31
...
...
@@ -299,6 +299,9 @@ int MergeFile(std::string fileName, bool warnIfMissing)
else
if
(
ext
==
".mesh"
||
ext
==
".MESH"
){
status
=
GModel
::
current
()
->
readMESH
(
fileName
);
}
else
if
(
ext
==
".diff"
||
ext
==
".DIFF"
){
status
=
GModel
::
current
()
->
readDIFF
(
fileName
);
}
else
if
(
ext
==
".med"
||
ext
==
".MED"
||
ext
==
".mmed"
||
ext
==
".MMED"
||
ext
==
".rmed"
||
ext
==
".RMED"
){
status
=
GModel
::
readMED
(
fileName
);
...
...
...
...
This diff is collapsed.
Click to expand it.
Geo/GModelIO_Mesh.cpp
+
52
−
50
View file @
2f0dec31
...
...
@@ -3059,8 +3059,7 @@ int GModel::readDIFF(const std::string &name)
std
::
map
<
int
,
MVertex
*>
vertexMap
;
std
::
vector
<
MVertex
*>
vertexVector
;
while
(
1
)
{
{
while
(
strstr
(
str
,
"Number of space dim. ="
)
==
NULL
){
if
(
!
fgets
(
str
,
sizeof
(
str
),
fp
)
||
feof
(
fp
))
break
;
...
...
@@ -3100,20 +3099,23 @@ int GModel::readDIFF(const std::string &name)
bool
several_subdomains
;
if
(
!
fgets
(
str
,
sizeof
(
str
),
fp
)
||
feof
(
fp
))
return
0
;
while
(
strstr
(
str
,
"Only one subdomain el :"
)
==
NULL
){
if
(
!
fgets
(
str
,
sizeof
(
str
),
fp
)
||
feof
(
fp
))
break
;
if
(
!
strncmp
(
&
str
[
2
],
"Only one material"
,
17
)
||
!
strncmp
(
&
str
[
2
],
"Only one subdomain"
,
18
)){
if
(
!
strncmp
(
&
str
[
37
],
"dpTRUE"
,
6
)
||
!
strncmp
(
&
str
[
37
],
"true"
,
4
)
||
!
strncmp
(
&
str
[
36
],
"dpTRUE"
,
6
)
||
!
strncmp
(
&
str
[
36
],
"true"
,
4
)){
several_subdomains
=
false
;
}
if
(
!
strncmp
(
&
str
[
39
],
"dpFALSE"
,
6
))
else
{
several_subdomains
=
true
;
else
several_subdomains
=
false
;
Msg
::
Info
(
"several_subdomains %x"
,
several_subdomains
);
}
Msg
::
Info
(
"
several_subdomains
%x %s"
,
several_subdomains
,
str
)
;
}
int
nbi
;
std
::
vector
<
int
>
bi
;
if
(
!
fgets
(
str
,
sizeof
(
str
),
fp
)
||
feof
(
fp
))
return
0
;
while
(
strstr
(
str
,
"Boundary indicators:"
)
==
NULL
){
while
(
strstr
(
str
,
"Boundary indicators:"
)
==
NULL
&&
strstr
(
str
,
"boundary indicators:"
)
==
NULL
){
if
(
!
fgets
(
str
,
sizeof
(
str
),
fp
)
||
feof
(
fp
))
break
;
}
...
...
@@ -3148,8 +3150,8 @@ int GModel::readDIFF(const std::string &name)
if
(
!
fgets
(
str
,
sizeof
(
str
),
fp
))
return
0
;
double
xyz
[
3
];
int
tmp
;
if
(
sscanf
(
str
,
"%d ( %lf , %lf , %lf ) [%d]"
,
&
num
,
&
xyz
[
0
],
&
xyz
[
1
],
&
xyz
[
2
],
&
tmp
)
!=
5
)
return
0
;
if
(
sscanf
(
str
,
"%d ( %lf , %lf , %lf ) [%d]"
,
&
num
,
&
xyz
[
0
],
&
xyz
[
1
],
&
xyz
[
2
],
&
tmp
)
!=
5
)
return
0
;
elementary
[
i
].
resize
(
tmp
+
1
);
elementary
[
i
][
0
]
=
tmp
;
minVertex
=
std
::
min
(
minVertex
,
num
);
...
...
@@ -3160,7 +3162,7 @@ int GModel::readDIFF(const std::string &name)
vertexMap
[
num
]
=
new
MVertex
(
xyz
[
0
],
xyz
[
1
],
xyz
[
2
],
0
,
num
);
if
(
numVertices
>
100000
)
Msg
::
ProgressMeter
(
i
+
1
,
numVertices
,
"Reading nodes"
);
// If the vertex numbering is dense, tran
s
fer the map into a
// If the vertex numbering is dense, tranfer the map into a
// vector to speed up element creation
if
((
int
)
vertexMap
.
size
()
==
numVertices
&&
((
minVertex
==
1
&&
maxVertex
==
numVertices
)
||
...
...
@@ -3197,7 +3199,7 @@ int GModel::readDIFF(const std::string &name)
}
std
::
vector
<
int
>
material
(
numElements
);
std
::
vector
<
std
::
vector
<
int
>
>
ElementsNodes
(
numElements
);
for
(
int
i
=
0
;
i
<
num
Vertice
s
;
i
++
){
for
(
int
i
=
0
;
i
<
num
Element
s
;
i
++
){
ElementsNodes
[
i
].
resize
(
numVerticesPerElement
);
}
char
eleTypec
[
20
]
=
""
;
...
...
@@ -3412,7 +3414,7 @@ int GModel::writeDIFF(const std::string &name, bool binary, bool saveAll,
fprintf
(
fp
,
" Number of nodes = %d
\n\n
"
,
numVertices
);
fprintf
(
fp
,
" All elements are of the same type : dpTRUE
\n
"
);
fprintf
(
fp
,
" Max number of nodes in an element: %d
\n
"
,
maxNumNodesPerElement
);
fprintf
(
fp
,
" Only one subdomain
el
: dpFALSE
\n
"
);
fprintf
(
fp
,
" Only one subdomain : dpFALSE
\n
"
);
fprintf
(
fp
,
" Lattice data ? 0
\n\n\n\n
"
);
fprintf
(
fp
,
" %d Boundary indicators: "
,
(
int
)
boundaryIndicators
.
size
());
for
(
std
::
list
<
int
>::
iterator
it
=
boundaryIndicators
.
begin
();
...
...
...
...
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