Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
amdis
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
Container Registry
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
iwr
amdis
Commits
bf5b2316
Commit
bf5b2316
authored
13 years ago
by
Praetorius, Simon
Browse files
Options
Downloads
Patches
Plain Diff
readArgv method for Initfile-class
parent
d71df77e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
AMDiS/AMDiSConfig.cmake.in
+1
-1
1 addition, 1 deletion
AMDiS/AMDiSConfig.cmake.in
AMDiS/src/Initfile.cc
+15
-1
15 additions, 1 deletion
AMDiS/src/Initfile.cc
AMDiS/src/Initfile.h
+14
-4
14 additions, 4 deletions
AMDiS/src/Initfile.h
demo/CMakeLists.txt
+1
-0
1 addition, 0 deletions
demo/CMakeLists.txt
with
31 additions
and
6 deletions
AMDiS/AMDiSConfig.cmake.in
+
1
−
1
View file @
bf5b2316
...
...
@@ -41,7 +41,7 @@ find_library(_AMDIS_LIB amdis PATHS ${AMDIS_LIBRARY_DIR} ${AMDIS_DIR}/../../lib/
if(_AMDIS_LIB)
get_filename_component(AMDIS_LIBRARY_DIR ${_AMDIS_LIB} PATH CACHE)
set(AMDIS_LIBRARY_DIRS ${AMDIS_LIBRARY_DIR})
set(AMDIS_LIBRARIES "${_AMDIS_LIB};${AMDIS_LIBRARY_DIR}/libcompositeFEM.so" CACHE STRING "amdis libraries")
set(AMDIS_LIBRARIES "${_AMDIS_LIB};${AMDIS_LIBRARY_DIR}/libcompositeFEM.so
;${AMDIS_LIBRARY_DIR}/libreinit.so
" CACHE STRING "amdis libraries")
else()
message(ERROR "could not detect the AMDiS library directory. Please set the variable AMDIS_LIBRARY_DIR to the directory containg the AMDiS library")
endif()
...
...
This diff is collapsed.
Click to expand it.
AMDiS/src/Initfile.cc
+
15
−
1
View file @
bf5b2316
...
...
@@ -98,10 +98,20 @@ void Initfile::read(istream& in) {
}
};
void
Initfile
::
readArgv
(
int
argc
,
char
**
argv
)
{
for
(
int
i
=
0
;
i
<
argc
;
++
i
)
{
if
(
strcmp
(
"-rs"
,
argv
[
i
])
==
0
)
{
std
::
string
input
(
argv
[
i
+
1
]);
add
(
"argv->rs"
,
input
,
0
);
}
}
}
/// read standard values for output and information of parameter-values
void
Initfile
::
getInternalParameters
()
{
int
val
=
1
0
;
int
val
=
0
;
get
(
"level of information"
,
val
,
0
);
msgInfo
=
val
;
...
...
@@ -113,6 +123,10 @@ void Initfile::getInternalParameters()
get
(
"parameter information"
,
val
,
0
);
paramInfo
=
val
;
val
=
0
;
get
(
"break on missing tag"
,
val
,
0
);
breakOnMissingTag
=
val
;
if
(
msgInfo
==
0
)
paramInfo
=
0
;
};
...
...
This diff is collapsed.
Click to expand it.
AMDiS/src/Initfile.h
+
14
−
4
View file @
bf5b2316
...
...
@@ -240,6 +240,9 @@ struct Initfile : public std::map< std::string, std::string > {
struct
TagNotFound
:
std
::
invalid_argument
{
TagNotFound
(
std
::
string
m
)
:
std
::
invalid_argument
(
m
)
{}
};
struct
TagNotFoundBreak
:
std
::
invalid_argument
{
// print 'tag not found' and exit
TagNotFoundBreak
(
std
::
string
m
)
:
std
::
invalid_argument
(
m
)
{}
};
/** initialize init-file from file with filename in, read data and save it to singleton-map
* @param in: filename string
...
...
@@ -313,6 +316,9 @@ struct Initfile : public std::map< std::string, std::string > {
set
(
tag
,
value
,
debug_info
);
}
/// rescheduling parameter
static
void
readArgv
(
int
argc
,
char
**
argv
);
/// Returns specified info level
static
int
getMsgInfo
()
{
...
...
@@ -355,7 +361,7 @@ struct Initfile : public std::map< std::string, std::string > {
}
protected
:
Initfile
()
:
msgInfo
(
1
0
),
msgWait
(
1
),
paramInfo
(
1
)
{}
Initfile
()
:
msgInfo
(
0
),
msgWait
(
1
),
paramInfo
(
1
)
,
breakOnMissingTag
(
0
)
{}
static
void
initIntern
()
{
if
(
singlett
==
NULL
)
...
...
@@ -371,8 +377,12 @@ protected:
/// return the value of the given tag or throws an exception if the tag does not exist
std
::
string
checkedGet
(
const
std
::
string
&
tag
)
const
{
super
::
const_iterator
it
=
find
(
tag
);
if
(
it
==
end
())
throw
TagNotFound
(
"there is no tag '"
+
tag
+
"'"
);
if
(
it
==
end
())
{
if
(
breakOnMissingTag
==
0
||
msgInfo
<=
2
)
throw
TagNotFound
(
"there is no tag '"
+
tag
+
"'"
);
else
throw
TagNotFoundBreak
(
"required tag '"
+
tag
+
"' not found"
);
}
return
it
->
second
;
}
...
...
@@ -398,7 +408,7 @@ protected:
/// read parameters for msgInfo, msgWait, paramInfo
void
getInternalParameters
();
int
msgInfo
,
msgWait
,
paramInfo
;
int
msgInfo
,
msgWait
,
paramInfo
,
breakOnMissingTag
;
};
...
...
This diff is collapsed.
Click to expand it.
demo/CMakeLists.txt
+
1
−
0
View file @
bf5b2316
project
(
"amdis_demo"
)
cmake_minimum_required
(
VERSION 2.8
)
set
(
AMDIS_DIR /u/spraetor/amdis-trunk/AMDiS_seq/share/amdis
)
#find_package(AMDIS REQUIRED COMPONENTS umfpack )
find_package
(
AMDIS REQUIRED
)
...
...
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