FEI Package Browser (Single Doxygen Collection)
Version of the Day
test_utils
FEData.cpp
Go to the documentation of this file.
1
/*--------------------------------------------------------------------*/
2
/* Copyright 2005 Sandia Corporation. */
3
/* Under the terms of Contract DE-AC04-94AL85000, there is a */
4
/* non-exclusive license for use of this work by or on behalf */
5
/* of the U.S. Government. Export of this program may require */
6
/* a license from the United States Government. */
7
/*--------------------------------------------------------------------*/
8
9
#include <cstring>
10
11
#include <
fei_sstream.hpp
>
12
13
#include <
test_utils/FEData.hpp
>
14
15
#undef fei_file
16
#define fei_file "FEData.cpp"
17
18
#include <
fei_ErrMacros.hpp
>
19
20
int
FEData::parameters
(
int
numParams,
char
** params)
21
{
22
const
char
* param =
snl_fei::getParamValue
(
"debugOutput"
,
23
numParams,params);
24
if
(param != NULL){
25
setDebugLog
(1, param);
26
}
27
28
dbgOut
() <<
"parameters"
<<
FEI_ENDL
29
<<
" numParams: "
<< numParams <<
FEI_ENDL
;
30
for
(
int
i=0; i<numParams; i++) {
31
dbgOut
() <<
" param "
<<i<<
": '"
<< params[i] <<
"'"
<<
FEI_ENDL
;
32
}
33
34
return
(0);
35
}
36
37
int
FEData::setDebugLog
(
int
debugOutputLevel,
const
char
* path)
38
{
39
delete
[]
dbgPath_
;
40
dbgPath_
= NULL;
41
42
if
(
dbgFileOpened_
==
true
)
return
(0);
43
44
if
(path != NULL) {
45
dbgPath_
=
new
char
[strlen(path)+1];
46
std::strcpy(
dbgPath_
, path);
47
}
48
else
{
49
dbgPath_
=
new
char
[2];
50
std::strcpy(
dbgPath_
,
"."
);
51
}
52
53
debugOutputLevel_
= debugOutputLevel;
54
55
if
(
debugOutputLevel_
<= 0) {
56
dbgOStreamPtr_
= NULL;
57
}
58
else
{
59
if
(
dbgOStreamPtr_
!= NULL)
delete
dbgOStreamPtr_
;
60
dbgOStreamPtr_
= NULL;
61
62
FEI_OSTRINGSTREAM
fname;
63
fname <<
dbgPath_
<<
"/FEData."
<<
numProcs_
<<
"."
<<
localProc_
;
64
dbgFStreamPtr_
=
new
FEI_OFSTREAM
(fname.str().c_str());
65
dbgFileOpened_
=
true
;
66
dbgOStreamPtr_
=
dbgFStreamPtr_
;
67
}
68
69
return
(0);
70
}
71
FEData::dbgFileOpened_
bool dbgFileOpened_
Definition:
FEData.hpp:404
FEI_ENDL
#define FEI_ENDL
Definition:
fei_iostream.hpp:34
FEData::setDebugLog
int setDebugLog(int debugOutputLevel, const char *path)
Definition:
FEData.cpp:37
FEData::dbgFStreamPtr_
FEI_OFSTREAM * dbgFStreamPtr_
Definition:
FEData.hpp:405
FEData::dbgOStreamPtr_
FEI_OSTREAM * dbgOStreamPtr_
Definition:
FEData.hpp:403
FEData::parameters
int parameters(int numParams, char **params)
Definition:
FEData.cpp:20
dbgOut
#define dbgOut()
Definition:
FEData.hpp:17
FEData::numProcs_
int numProcs_
Definition:
FEData.hpp:399
FEI_OSTRINGSTREAM
#define FEI_OSTRINGSTREAM
Definition:
fei_sstream.hpp:32
fei_sstream.hpp
FEData::debugOutputLevel_
int debugOutputLevel_
Definition:
FEData.hpp:401
snl_fei::getParamValue
const char * getParamValue(const char *key, int numParams, const char *const *paramStrings, char separator=' ')
Definition:
snl_fei_Utils.cpp:41
FEData::dbgPath_
char * dbgPath_
Definition:
FEData.hpp:402
fei_ErrMacros.hpp
FEData.hpp
FEData::localProc_
int localProc_
Definition:
FEData.hpp:399
FEI_OFSTREAM
#define FEI_OFSTREAM
Definition:
fei_fstream.hpp:14
Generated by
1.8.16