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
dc2aa07d
Commit
dc2aa07d
authored
17 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
fix const in snprintf
parent
5424371a
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
Geo/GeoStringInterface.cpp
+2
-2
2 additions, 2 deletions
Geo/GeoStringInterface.cpp
Post/PViewDataGModel.cpp
+10
-7
10 additions, 7 deletions
Post/PViewDataGModel.cpp
with
12 additions
and
9 deletions
Geo/GeoStringInterface.cpp
+
2
−
2
View file @
dc2aa07d
// $Id: GeoStringInterface.cpp,v 1.1
7
2008-02-2
3
15:3
0:07
geuzaine Exp $
// $Id: GeoStringInterface.cpp,v 1.1
8
2008-02-2
5
15:3
6:38
geuzaine Exp $
//
//
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
//
//
...
@@ -37,7 +37,7 @@ extern Context_T CTX;
...
@@ -37,7 +37,7 @@ extern Context_T CTX;
// Some old systems don't have snprintf... Just call sprintf instead.
// Some old systems don't have snprintf... Just call sprintf instead.
#if defined(HAVE_NO_SNPRINTF)
#if defined(HAVE_NO_SNPRINTF)
int
snprintf
(
const
char
*
str
,
size_t
size
,
const
char
*
fmt
,
...){
int
snprintf
(
char
*
str
,
size_t
size
,
const
char
*
fmt
,
...){
va_list
args
;
va_list
args
;
va_start
(
args
,
fmt
);
va_start
(
args
,
fmt
);
int
ret
=
vsprintf
(
str
,
fmt
,
args
);
int
ret
=
vsprintf
(
str
,
fmt
,
args
);
...
...
This diff is collapsed.
Click to expand it.
Post/PViewDataGModel.cpp
+
10
−
7
View file @
dc2aa07d
// $Id: PViewDataGModel.cpp,v 1.
19
2008-02-2
4 21:05:04
geuzaine Exp $
// $Id: PViewDataGModel.cpp,v 1.
20
2008-02-2
5 15:36:38
geuzaine Exp $
//
//
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
//
//
...
@@ -24,9 +24,9 @@
...
@@ -24,9 +24,9 @@
#include
"PViewDataGModel.h"
#include
"PViewDataGModel.h"
#include
"MElement.h"
#include
"MElement.h"
#include
"Message.h"
PViewDataGModel
::
PViewDataGModel
(
GModel
*
model
)
:
_model
(
model
)
PViewDataGModel
::
PViewDataGModel
(
GModel
*
model
)
:
_model
(
model
)
{
{
// store vector of GEntities so we can index them efficiently
// store vector of GEntities so we can index them efficiently
for
(
GModel
::
eiter
it
=
_model
->
firstEdge
();
it
!=
_model
->
lastEdge
();
++
it
)
for
(
GModel
::
eiter
it
=
_model
->
firstEdge
();
it
!=
_model
->
lastEdge
();
++
it
)
...
@@ -50,16 +50,19 @@ PViewDataGModel::PViewDataGModel(GModel *model) : _model(model)
...
@@ -50,16 +50,19 @@ PViewDataGModel::PViewDataGModel(GModel *model) : _model(model)
When reading a .msh file:
When reading a .msh file:
nodeData.resize(std::max(_model->getMaxNodeDataIndex(), numDataInFile));
if(nodeData[step - 1].size())
nodeData[step].values.resize(nodeData[step - 1].size());
else
nodeData[step].values.resize(numDataInFile);
loop over lines:
loop over lines:
* get node number in file
* get node number in file
* get vertex pointer from _model->getVertexByTag(num)
* get vertex pointer from _model->getVertexByTag(num)
* if MVertex has no dataIndex:
* if MVertex has no dataIndex:
increment it (need global value stored in GModel)
increment it (need global value stored in GModel)
fill std::vector<double> tmp
else
nodeData[step].push_back(tmp)
use the one that's stored
else:
* if(dataIndex > nodeData[step].size()) nodeData[step].resize(dataIndex + 1)
add data
nodeData[step][dataIndex]
* fill
nodeData[step]
.value
[dataIndex]
.msh file format:
.msh file format:
...
...
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