Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F82397070
test_selection_fixture.hh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Sep 11, 04:25
Size
2 KB
Mime Type
text/x-c++
Expires
Fri, Sep 13, 04:25 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
20694174
Attached To
rAKA akantu
test_selection_fixture.hh
View Options
/**
* @file test_selection.cc
*
* @author Mohit Pundir <mohit.pundir@epfl.ch>
*
* @date creation: Sat Feb 29 2020
* @date last modification: Sat Feb 29 2020
*
* @brief Generic test for selection of nodes across different surfaces
*
* @section LICENSE
*
* Copyright (©) 2010-2018 EPFL (Ecole Polytechnique Fédérale de Lausanne)
* Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides)
*
* Akantu is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* Akantu 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 Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Akantu. If not, see <http://www.gnu.org/licenses/>.
*
*/
/* -------------------------------------------------------------------------- */
#include "aka_iterators.hh"
#include "communicator.hh"
#include "surface_selector.hh"
/* -------------------------------------------------------------------------- */
#include "test_gtest_utils.hh"
/* -------------------------------------------------------------------------- */
#include <gtest/gtest.h>
#include <vector>
/* -------------------------------------------------------------------------- */
using
namespace
akantu
;
template
<
typename
dim_
>
class
TestSurfaceSelecionFixture
:
public
::
testing
::
Test
{
public
:
static
constexpr
size_t
spatial_dimension
=
dim_
::
value
;
void
Setup
()
override
{
mesh
=
std
::
make_unique
<
Mesh
>
(
spatial_dimension
);
mesh
->
read
(
"selection_"
+
std
::
string
(
spatial_dimension
)
+
"D.msh"
);
selector
=
make_unique
<
PhysicalSurfaceSelector
>
(
*
mesh
);
}
void
TearDown
()
{
mesh
.
reset
(
nullptr
);
selector
.
reset
(
nullptr
);
}
bool
checkNbSlaveNodes
(
UInt
&
act_slave_nodes
)
{
auto
&
slave_list
=
this
->
selectior
->
getSlaveList
();
auto
nb_slave_nodes
=
slave_list
.
size
();
EXCEP_EQ
(
nb_slave_nodes
,
act_slave_nodes
)
}
bool
checkNbmasterNodes
(
UInt
&
act_master_nodes
)
{
auto
&
master_list
=
this
->
selectior
->
getMasterList
();
auto
nb_master_nodes
=
master_list
.
size
();
EXCEP_EQ
(
nb_master_nodes
,
act_master_nodes
)
}
protected
:
std
::
unique_ptr
<
Mesh
>
mesh
;
std
::
unique_ptr
<
PhysicalSurfaceSelector
>
selector
};
using
dim_types
=
gtest_list_t
<
std
::
tuple
<
1
,
2
,
3
>>
;
TYPED_TEST_SUITE
(
TestSurfaceSelectionFixture
,
dim_types
);
Event Timeline
Log In to Comment