Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
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
Package registry
Container 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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
abc902f0
Commit
abc902f0
authored
5 years ago
by
Beerwerth, Randolf
Browse files
Options
Downloads
Patches
Plain Diff
Add RoughnessModel enumerate
parent
827725b5
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
Core/Multilayer/RoughnessModels.cpp
+34
-0
34 additions, 0 deletions
Core/Multilayer/RoughnessModels.cpp
Core/Multilayer/RoughnessModels.h
+36
-0
36 additions, 0 deletions
Core/Multilayer/RoughnessModels.h
with
70 additions
and
0 deletions
Core/Multilayer/RoughnessModels.cpp
0 → 100644
+
34
−
0
View file @
abc902f0
// ************************************************************************** //
//
// BornAgain: simulate and fit scattering at grazing incidence
//
//! @file Core/Multilayer/SpecularMatrix.cpp
//! @brief Implements class SpecularMatrix.
//!
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2018
//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
//
// ************************************************************************** //
#include
"RoughnessModels.h"
#include
<map>
namespace
{
const
std
::
map
<
RoughnessModel
,
std
::
string
>
roughnessModelNames
=
{
{
RoughnessModel
::
DEFAULT
,
"RoughnessModel::DEFAULT"
},
{
RoughnessModel
::
TANH
,
"RoughnessModel::TANH"
},
{
RoughnessModel
::
NEVOT_CROCE
,
"RoughnessModel::NEVOT_CROCE"
}
};
}
std
::
string
RoughnessModelWrap
::
roughnessModelName
(
RoughnessModel
model
)
{
auto
iter
=
roughnessModelNames
.
find
(
model
);
if
(
iter
!=
roughnessModelNames
.
end
())
return
iter
->
second
;
return
"Invalid roughness model"
;
}
This diff is collapsed.
Click to expand it.
Core/Multilayer/RoughnessModels.h
0 → 100644
+
36
−
0
View file @
abc902f0
// ************************************************************************** //
//
// BornAgain: simulate and fit scattering at grazing incidence
//
//! @file Core/Computation/ProcessedSample.cpp
//! @brief Implements class ProcessedSample.
//!
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2018
//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
//
// ************************************************************************** //
#ifndef ROUGHNESSMODELS_H
#define ROUGHNESSMODELS_H
#include
<string>
#include
"WinDllMacros.h"
// workaround for SWIG (instead of just writing enum class RoughnessModel ...)
struct
BA_CORE_API_
RoughnessModelWrap
{
enum
RoughnessModel
{
DEFAULT
,
TANH
,
NEVOT_CROCE
};
#ifndef SWIG
// TODO: to automatize enum to string convertion, one can possibly use this solution
// https://stackoverflow.com/questions/147267/easy-way-to-use-variables-of-enum-types-as-string-in-c#202511
static
std
::
string
roughnessModelName
(
RoughnessModel
model
);
#endif
};
typedef
RoughnessModelWrap
::
RoughnessModel
RoughnessModel
;
#endif // ROUGHNESSMODELS_H
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