Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Core Modules
dune-common
Commits
03e7489b
Commit
03e7489b
authored
19 years ago
by
Robert Klöfkorn
Browse files
Options
Downloads
Patches
Plain Diff
use string instead of char *
[[Imported from SVN: r2016]]
parent
14c79e87
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
fem/dfadapt.hh
+6
-6
6 additions, 6 deletions
fem/dfadapt.hh
fem/discfuncarray/dfadapt.cc
+14
-14
14 additions, 14 deletions
fem/discfuncarray/dfadapt.cc
with
20 additions
and
20 deletions
fem/dfadapt.hh
+
6
−
6
View file @
03e7489b
...
...
@@ -136,23 +136,23 @@ namespace Dune {
//! write data of discrete function to file filename|timestep
//! with xdr methods
bool
write_xdr
(
const
char
*
filename
);
bool
write_xdr
(
const
std
::
basic_string
<
char
>
filename
);
//! write data of discrete function to file filename|timestep
//! with xdr methods
bool
read_xdr
(
const
char
*
filename
);
bool
read_xdr
(
const
std
::
basic_string
<
char
>
filename
);
//! write function data to file filename|timestep in ascii Format
bool
write_ascii
(
const
char
*
filename
);
bool
write_ascii
(
const
std
::
basic_string
<
char
>
filename
);
//! read function data from file filename|timestep in ascii Format
bool
read_ascii
(
const
char
*
filename
);
bool
read_ascii
(
const
std
::
basic_string
<
char
>
filename
);
//! write function data in pgm fromat file
bool
write_pgm
(
const
char
*
filename
);
bool
write_pgm
(
const
std
::
basic_string
<
char
>
filename
);
//! read function data from pgm fromat file
bool
read_pgm
(
const
char
*
filename
);
bool
read_pgm
(
const
std
::
basic_string
<
char
>
filename
);
//! return name of this discrete function
const
char
*
name
()
const
{
return
name_
;
}
...
...
This diff is collapsed.
Click to expand it.
fem/discfuncarray/dfadapt.cc
+
14
−
14
View file @
03e7489b
...
...
@@ -141,14 +141,14 @@ namespace Dune
//**************************************************************************
template
<
class
DiscreteFunctionSpaceType
>
inline
bool
DFAdapt
<
DiscreteFunctionSpaceType
>::
write_xdr
(
const
char
*
fn
)
write_xdr
(
const
std
::
basic_string
<
char
>
fn
)
{
FILE
*
file
;
XDR
xdrs
;
file
=
fopen
(
fn
,
"wb"
);
file
=
fopen
(
fn
.
c_str
()
,
"wb"
);
if
(
!
file
)
{
printf
(
"
\a
ERROR in DFAdapt::write_xdr(..): couldnot open <%s>!
\n
"
,
fn
);
printf
(
"
\a
ERROR in DFAdapt::write_xdr(..): couldnot open <%s>!
\n
"
,
fn
.
c_str
()
);
fflush
(
stderr
);
return
false
;
}
...
...
@@ -164,15 +164,15 @@ namespace Dune
template
<
class
DiscreteFunctionSpaceType
>
inline
bool
DFAdapt
<
DiscreteFunctionSpaceType
>::
read_xdr
(
const
char
*
fn
)
read_xdr
(
const
std
::
basic_string
<
char
>
fn
)
{
FILE
*
file
;
XDR
xdrs
;
std
::
cout
<<
"Reading <"
<<
fn
<<
">
\n
"
;
file
=
fopen
(
fn
,
"rb"
);
file
=
fopen
(
fn
.
c_str
()
,
"rb"
);
if
(
!
file
)
{
printf
(
"
\a
ERROR in DFAdapt::read_xdr(..): couldnot open <%s>!
\n
"
,
fn
);
printf
(
"
\a
ERROR in DFAdapt::read_xdr(..): couldnot open <%s>!
\n
"
,
fn
.
c_str
()
);
fflush
(
stderr
);
return
(
false
);
}
...
...
@@ -188,12 +188,12 @@ namespace Dune
template
<
class
DiscreteFunctionSpaceType
>
inline
bool
DFAdapt
<
DiscreteFunctionSpaceType
>::
write_ascii
(
const
char
*
fn
)
write_ascii
(
const
std
::
basic_string
<
char
>
fn
)
{
std
::
fstream
outfile
(
fn
,
std
::
ios
::
out
);
std
::
fstream
outfile
(
fn
.
c_str
()
,
std
::
ios
::
out
);
if
(
!
outfile
)
{
printf
(
"
\a
ERROR in DFAdapt::write_ascii(..): couldnot open <%s>!
\n
"
,
fn
);
printf
(
"
\a
ERROR in DFAdapt::write_ascii(..): couldnot open <%s>!
\n
"
,
fn
.
c_str
()
);
fflush
(
stderr
);
return
false
;
}
...
...
@@ -216,10 +216,10 @@ namespace Dune
template
<
class
DiscreteFunctionSpaceType
>
inline
bool
DFAdapt
<
DiscreteFunctionSpaceType
>::
read_ascii
(
const
char
*
fn
)
read_ascii
(
const
std
::
basic_string
<
char
>
fn
)
{
FILE
*
infile
=
0
;
infile
=
fopen
(
fn
,
"r"
);
infile
=
fopen
(
fn
.
c_str
()
,
"r"
);
assert
(
infile
!=
0
);
{
int
length
;
...
...
@@ -238,7 +238,7 @@ namespace Dune
template
<
class
DiscreteFunctionSpaceType
>
inline
bool
DFAdapt
<
DiscreteFunctionSpaceType
>::
write_pgm
(
const
char
*
fn
)
write_pgm
(
const
std
::
basic_string
<
char
>
fn
)
{
std
::
ofstream
out
(
fn
);
...
...
@@ -264,12 +264,12 @@ namespace Dune
template
<
class
DiscreteFunctionSpaceType
>
inline
bool
DFAdapt
<
DiscreteFunctionSpaceType
>::
read_pgm
(
const
char
*
fn
)
read_pgm
(
const
std
::
basic_string
<
char
>
fn
)
{
FILE
*
in
;
int
v
;
in
=
fopen
(
fn
,
"r"
);
in
=
fopen
(
fn
.
c_str
()
,
"r"
);
assert
(
in
);
fscanf
(
in
,
"P2
\n
%d %d
\n
%d
\n
"
,
&
v
,
&
v
,
&
v
);
...
...
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