Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
waLBerla
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
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tobias Schruff
waLBerla
Commits
04cfe2a4
Commit
04cfe2a4
authored
7 years ago
by
Sebastian Eibl
Browse files
Options
Downloads
Patches
Plain Diff
added test for load from config functions
parent
ffe9f242
Branches
Branches containing commit
Tags
release/0.3.0
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/pe/cr/HCSITS.h
+4
-0
4 additions, 0 deletions
src/pe/cr/HCSITS.h
tests/pe/CMakeLists.txt
+3
-0
3 additions, 0 deletions
tests/pe/CMakeLists.txt
tests/pe/LoadFromConfig.cfg
+18
-0
18 additions, 0 deletions
tests/pe/LoadFromConfig.cfg
tests/pe/LoadFromConfig.cpp
+66
-0
66 additions, 0 deletions
tests/pe/LoadFromConfig.cpp
with
91 additions
and
0 deletions
src/pe/cr/HCSITS.h
+
4
−
0
View file @
04cfe2a4
...
...
@@ -135,6 +135,10 @@ public:
virtual
inline
size_t
getNumberOfContactsTreated
()
const
WALBERLA_OVERRIDE
;
inline
const
std
::
map
<
IBlockID
::
IDType
,
ContactCache
>
getContactCache
()
const
{
return
blockToContactCache_
;
}
inline
real_t
getSpeedLimitFactor
()
const
;
inline
size_t
getMaxIterations
()
const
{
return
maxIterations_
;
}
inline
real_t
getRelaxationParameter
()
const
{
return
relaxationParam_
;
}
inline
real_t
getErrorReductionParameter
()
const
{
return
erp_
;
}
inline
RelaxationModel
getRelaxationModel
()
const
{
return
relaxationModel_
;
}
//@}
//**********************************************************************************************
...
...
This diff is collapsed.
Click to expand it.
tests/pe/CMakeLists.txt
+
3
−
0
View file @
04cfe2a4
...
...
@@ -42,6 +42,9 @@ waLBerla_execute_test( NAME PE_HASHGRIDS_DBG COMMAND $<TARGET_FILE:PE_HASHGRID
waLBerla_compile_test
(
NAME PE_HCSITS FILES HCSITS.cpp DEPENDS core blockforest
)
waLBerla_execute_test
(
NAME PE_HCSITS
)
waLBerla_compile_test
(
NAME PE_LOADFROMCONFIG FILES LoadFromConfig.cpp DEPENDS core blockforest
)
waLBerla_execute_test
(
NAME PE_LOADFROMCONFIG COMMAND $<TARGET_FILE:PE_LOADFROMCONFIG>
${
CMAKE_CURRENT_SOURCE_DIR
}
/LoadFromConfig.cfg
)
waLBerla_compile_test
(
NAME PE_MARSHALLING FILES Marshalling.cpp DEPENDS core
)
waLBerla_execute_test
(
NAME PE_MARSHALLING
)
...
...
This diff is collapsed.
Click to expand it.
tests/pe/LoadFromConfig.cfg
0 → 100644
+
18
−
0
View file @
04cfe2a4
LoadFromConfig
{
setupRun
0
;
path
.
;
simulationCorner
<
-15,
-15,
0
>
;
simulationDomain
<
12,
23,
34
>
;
blocks
<
3,
4,
5
>
;
isPeriodic
<
0,
1,
0
>
;
HCSITSmaxIterations
123
;
HCSITSRelaxationParameter
0.123
;
HCSITSErrorReductionParameter
0.123
;
HCSITSRelaxationModelStr
ApproximateInelasticCoulombContactByDecoupling
;
globalLinearAcceleration
<
1,
-2,
3
>
;
}
This diff is collapsed.
Click to expand it.
tests/pe/LoadFromConfig.cpp
0 → 100644
+
66
−
0
View file @
04cfe2a4
//======================================================================================================================
//
// This file is part of waLBerla. waLBerla is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// waLBerla is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with waLBerla (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
//
//! \file LoadFromConfig.cpp
//! \author Sebastian Eibl <sebastian.eibl@fau.de>
//
//======================================================================================================================
#include
"blockforest/all.h"
#include
"core/all.h"
#include
"domain_decomposition/all.h"
#include
"pe/basic.h"
#include
"pe/utility/CreateWorld.h"
#include
"core/debug/TestSubsystem.h"
#include
<boost/tuple/tuple.hpp>
using
namespace
walberla
;
using
namespace
walberla
::
pe
;
int
main
(
int
argc
,
char
**
argv
)
{
walberla
::
debug
::
enterTestMode
();
Environment
env
(
argc
,
argv
);
const
Config
::
BlockHandle
configBlock
=
env
.
config
()
->
getBlock
(
"LoadFromConfig"
);
shared_ptr
<
BodyStorage
>
globalBodyStorage
=
make_shared
<
BodyStorage
>
();
// create blocks
shared_ptr
<
BlockForest
>
forest
=
createBlockForestFromConfig
(
configBlock
);
WALBERLA_CHECK_EQUAL
(
forest
->
getXSize
(),
3
);
WALBERLA_CHECK_EQUAL
(
forest
->
getYSize
(),
4
);
WALBERLA_CHECK_EQUAL
(
forest
->
getZSize
(),
5
);
WALBERLA_CHECK
(
!
forest
->
isXPeriodic
()
);
WALBERLA_CHECK
(
forest
->
isYPeriodic
()
);
WALBERLA_CHECK
(
!
forest
->
isZPeriodic
()
);
WALBERLA_CHECK_FLOAT_EQUAL
(
forest
->
getDomain
().
minCorner
(),
Vec3
(
-
15
,
-
15
,
0
)
);
WALBERLA_CHECK_FLOAT_EQUAL
(
forest
->
getDomain
().
maxCorner
(),
Vec3
(
-
3
,
8
,
34
)
);
BlockDataID
blockDataID
;
cr
::
HCSITS
hcsits
(
globalBodyStorage
,
forest
,
blockDataID
,
blockDataID
,
blockDataID
);
configure
(
configBlock
,
hcsits
);
WALBERLA_CHECK_EQUAL
(
hcsits
.
getRelaxationModel
(),
cr
::
HCSITS
::
RelaxationModel
::
ApproximateInelasticCoulombContactByDecoupling
);
WALBERLA_CHECK_EQUAL
(
hcsits
.
getMaxIterations
(),
123
);
WALBERLA_CHECK_FLOAT_EQUAL
(
hcsits
.
getRelaxationParameter
(),
real_t
(
0.123
)
);
WALBERLA_CHECK_FLOAT_EQUAL
(
hcsits
.
getErrorReductionParameter
(),
real_t
(
0.123
)
);
WALBERLA_CHECK_FLOAT_EQUAL
(
hcsits
.
getGlobalLinearAcceleration
(),
Vec3
(
1
,
-
2
,
3
)
);
return
EXIT_SUCCESS
;
}
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