Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
alta
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alta
alta
Commits
9457fdc7
Commit
9457fdc7
authored
Nov 14, 2013
by
Laurent Belcour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allowing to change the parametrization of the ABC model using command line argument
parent
bab8c2e4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
1 deletion
+29
-1
sources/core/params.h
sources/core/params.h
+2
-1
sources/plugins/nonlinear_function_abc/function.cpp
sources/plugins/nonlinear_function_abc/function.cpp
+27
-0
No files found.
sources/core/params.h
View file @
9457fdc7
...
...
@@ -326,7 +326,8 @@ class parametrized
else
{
std
::
cout
<<
"<<ERROR>> an input parametrization is already defined: "
<<
params
::
get_name
(
_in_param
)
<<
std
::
endl
;
std
::
cout
<<
"<<ERROR>> trying to change to: "
<<
params
::
get_name
(
new_param
)
<<
std
::
endl
;
std
::
cout
<<
"<<ERROR>> changing to: "
<<
params
::
get_name
(
new_param
)
<<
std
::
endl
;
_in_param
=
new_param
;
}
}
...
...
sources/plugins/nonlinear_function_abc/function.cpp
View file @
9457fdc7
...
...
@@ -143,6 +143,19 @@ void abc_function::bootstrap(const data* d, const arguments& args)
_b
[
i
]
=
1.0
;
_c
[
i
]
=
1.0
;
}
if
(
args
.
is_defined
(
"param"
))
{
setParametrization
(
params
::
parse_input
(
args
[
"param"
]));
}
else
{
setParametrization
(
params
::
COS_TH
);
}
if
(
params
::
dimension
(
input_parametrization
())
!=
1
)
{
std
::
cerr
<<
"<<ERROR>> the parametrization specifed in the file for the ABC model is incorrect"
<<
std
::
endl
;
}
}
//! Load function specific files
...
...
@@ -175,6 +188,19 @@ bool abc_function::load(std::istream& in)
std
::
cerr
<<
"<<ERROR>> parsing the stream. function name is not the next token."
<<
std
::
endl
;
return
false
;
}
in
>>
token
;
if
(
token
.
compare
(
"#PARAM"
)
!=
0
)
{
std
::
cerr
<<
"<<ERROR>> parsing the stream. The #PARAM is not the next line defined."
<<
std
::
endl
;
return
false
;
}
in
>>
token
;
setParametrization
(
params
::
parse_input
(
token
));
if
(
params
::
dimension
(
input_parametrization
())
!=
1
)
{
std
::
cerr
<<
"<<ERROR>> the parametrization specifed in the file for the ABC model is incorrect"
<<
std
::
endl
;
}
// Parse the lobe
for
(
int
i
=
0
;
i
<
_nY
;
++
i
)
...
...
@@ -195,6 +221,7 @@ void abc_function::save_call(std::ostream& out, const arguments& args) const
if
(
is_alta
)
{
out
<<
"#FUNC nonlinear_function_abc"
<<
std
::
endl
;
out
<<
"#PARAM "
<<
params
::
get_name
(
input_parametrization
())
<<
std
::
endl
;
for
(
int
i
=
0
;
i
<
_nY
;
++
i
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment