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
1b9cc743
Commit
1b9cc743
authored
15 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
name cl sizes when exporting unrolled geo files (thanks Laurent!)
parent
cf7d2ef6
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Geo/GModelIO_Geo.cpp
+18
-3
18 additions, 3 deletions
Geo/GModelIO_Geo.cpp
Geo/GVertex.cpp
+10
-3
10 additions, 3 deletions
Geo/GVertex.cpp
Geo/GVertex.h
+1
-1
1 addition, 1 deletion
Geo/GVertex.h
Geo/Geo.cpp
+0
-1
0 additions, 1 deletion
Geo/Geo.cpp
with
29 additions
and
8 deletions
Geo/GModelIO_Geo.cpp
+
18
−
3
View file @
1b9cc743
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
// See the LICENSE.txt file for license information. Please report all
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
// bugs and problems to <gmsh@geuz.org>.
#include
<sstream>
#include
<stdlib.h>
#include
<stdlib.h>
#include
"GmshConfig.h"
#include
"GmshConfig.h"
#include
"GmshMessage.h"
#include
"GmshMessage.h"
...
@@ -31,7 +32,7 @@ void GModel::_createGEOInternals()
...
@@ -31,7 +32,7 @@ void GModel::_createGEOInternals()
void
GModel
::
_deleteGEOInternals
()
void
GModel
::
_deleteGEOInternals
()
{
{
delete
_geo_internals
;
if
(
_geo_internals
)
delete
_geo_internals
;
_geo_internals
=
0
;
_geo_internals
=
0
;
}
}
...
@@ -43,6 +44,7 @@ int GModel::readGEO(const std::string &name)
...
@@ -43,6 +44,7 @@ int GModel::readGEO(const std::string &name)
int
GModel
::
exportDiscreteGEOInternals
()
int
GModel
::
exportDiscreteGEOInternals
()
{
{
if
(
_geo_internals
)
delete
_geo_internals
;
_geo_internals
=
new
GEO_Internals
;
_geo_internals
=
new
GEO_Internals
;
for
(
viter
it
=
firstVertex
();
it
!=
lastVertex
();
it
++
){
for
(
viter
it
=
firstVertex
();
it
!=
lastVertex
();
it
++
){
...
@@ -329,8 +331,21 @@ int GModel::writeGEO(const std::string &name, bool printLabels)
...
@@ -329,8 +331,21 @@ int GModel::writeGEO(const std::string &name, bool printLabels)
{
{
FILE
*
fp
=
fopen
(
name
.
c_str
(),
"w"
);
FILE
*
fp
=
fopen
(
name
.
c_str
(),
"w"
);
for
(
viter
it
=
firstVertex
();
it
!=
lastVertex
();
it
++
)
std
::
map
<
double
,
std
::
string
>
meshSizeParameters
;
(
*
it
)
->
writeGEO
(
fp
);
int
cpt
=
0
;
for
(
viter
it
=
firstVertex
();
it
!=
lastVertex
();
it
++
){
double
val
=
(
*
it
)
->
prescribedMeshSizeAtVertex
();
if
(
meshSizeParameters
.
find
(
val
)
==
meshSizeParameters
.
end
()){
std
::
ostringstream
paramName
;
paramName
<<
"cl"
<<
++
cpt
;
fprintf
(
fp
,
"%s = %.16g;
\n
"
,
paramName
.
str
().
c_str
(),
val
);
meshSizeParameters
.
insert
(
std
::
make_pair
(
val
,
paramName
.
str
()));
}
}
for
(
viter
it
=
firstVertex
();
it
!=
lastVertex
();
it
++
){
double
val
=
(
*
it
)
->
prescribedMeshSizeAtVertex
();
(
*
it
)
->
writeGEO
(
fp
,
meshSizeParameters
[
val
]);
}
for
(
eiter
it
=
firstEdge
();
it
!=
lastEdge
();
it
++
)
for
(
eiter
it
=
firstEdge
();
it
!=
lastEdge
();
it
++
)
(
*
it
)
->
writeGEO
(
fp
);
(
*
it
)
->
writeGEO
(
fp
);
for
(
fiter
it
=
firstFace
();
it
!=
lastFace
();
it
++
)
for
(
fiter
it
=
firstFace
();
it
!=
lastFace
();
it
++
)
...
...
This diff is collapsed.
Click to expand it.
Geo/GVertex.cpp
+
10
−
3
View file @
1b9cc743
...
@@ -60,10 +60,17 @@ std::string GVertex::getAdditionalInfoString()
...
@@ -60,10 +60,17 @@ std::string GVertex::getAdditionalInfoString()
return
sstream
.
str
();
return
sstream
.
str
();
}
}
void
GVertex
::
writeGEO
(
FILE
*
fp
)
void
GVertex
::
writeGEO
(
FILE
*
fp
,
const
std
::
string
&
meshSizeParameter
)
{
{
fprintf
(
fp
,
"Point(%d) = {%.16g, %.16g, %.16g, %.16g};
\n
"
,
if
(
meshSizeParameter
.
size
())
tag
(),
x
(),
y
(),
z
(),
prescribedMeshSizeAtVertex
());
fprintf
(
fp
,
"Point(%d) = {%.16g, %.16g, %.16g, %s};
\n
"
,
tag
(),
x
(),
y
(),
z
(),
meshSizeParameter
.
c_str
());
else
if
(
prescribedMeshSizeAtVertex
()
!=
MAX_LC
)
fprintf
(
fp
,
"Point(%d) = {%.16g, %.16g, %.16g, %.16g};
\n
"
,
tag
(),
x
(),
y
(),
z
(),
prescribedMeshSizeAtVertex
());
else
fprintf
(
fp
,
"Point(%d) = {%.16g, %.16g, %.16g};
\n
"
,
tag
(),
x
(),
y
(),
z
());
}
}
unsigned
int
GVertex
::
getNumMeshElements
()
unsigned
int
GVertex
::
getNumMeshElements
()
...
...
This diff is collapsed.
Click to expand it.
Geo/GVertex.h
+
1
−
1
View file @
1b9cc743
...
@@ -66,7 +66,7 @@ class GVertex : public GEntity
...
@@ -66,7 +66,7 @@ class GVertex : public GEntity
virtual
std
::
string
getAdditionalInfoString
();
virtual
std
::
string
getAdditionalInfoString
();
// export in GEO format
// export in GEO format
virtual
void
writeGEO
(
FILE
*
fp
);
virtual
void
writeGEO
(
FILE
*
fp
,
const
std
::
string
&
meshSizeParameter
=
""
);
// get number of elements in the mesh
// get number of elements in the mesh
unsigned
int
getNumMeshElements
();
unsigned
int
getNumMeshElements
();
...
...
This diff is collapsed.
Click to expand it.
Geo/Geo.cpp
+
0
−
1
View file @
1b9cc743
...
@@ -3389,7 +3389,6 @@ void setVolumeSurfaces(Volume *v, List_T *loops)
...
@@ -3389,7 +3389,6 @@ void setVolumeSurfaces(Volume *v, List_T *loops)
List_Add
(
v
->
SurfacesByTag
,
&
is
);
List_Add
(
v
->
SurfacesByTag
,
&
is
);
}
}
else
{
else
{
printf
(
"surface %d is not in GModel !
\n
"
,
abs
(
is
));
Msg
::
Error
(
"Unknown surface %d"
,
is
);
Msg
::
Error
(
"Unknown surface %d"
,
is
);
return
;
return
;
}
}
...
...
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