Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F83979697
ntn_base_contact_inline_impl.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
Fri, Sep 20, 02:29
Size
4 KB
Mime Type
text/x-c
Expires
Sun, Sep 22, 02:29 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
20924213
Attached To
rAKA akantu
ntn_base_contact_inline_impl.hh
View Options
/**
* @file ntn_base_contact_inline_impl.hh
*
* @author David Simon Kammer <david.kammer@epfl.ch>
*
* @date creation: Fri Mar 16 2018
* @date last modification: Sun Dec 30 2018
*
* @brief ntn base contact inline functions
*
*
* @section LICENSE
*
* Copyright (©) 2016-2021 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 "ntn_base_contact.hh"
/* -------------------------------------------------------------------------- */
namespace
akantu
{
/* -------------------------------------------------------------------------- */
inline
Int
NTNBaseContact
::
getNbData
(
const
Array
<
Element
>
&
elements
,
const
SynchronizationTag
&
tag
)
const
{
AKANTU_DEBUG_IN
();
Int
size
=
0
;
Int
spatial_dimension
=
this
->
model
.
getSpatialDimension
();
Int
nb_nodes
=
0
;
for
(
const
auto
&
el
:
elements
)
{
nb_nodes
+=
Mesh
::
getNbNodesPerElement
(
el
.
type
);
}
switch
(
tag
)
{
case
SynchronizationTag
::
_cf_nodal:
{
size
+=
nb_nodes
*
spatial_dimension
*
sizeof
(
Real
)
*
3
;
// disp, vel and cur_pos
break
;
}
case
SynchronizationTag
::
_cf_incr:
{
size
+=
nb_nodes
*
spatial_dimension
*
sizeof
(
Real
)
*
1
;
break
;
}
default
:
{
}
}
AKANTU_DEBUG_OUT
();
return
size
;
}
/* -------------------------------------------------------------------------- */
inline
void
NTNBaseContact
::
packData
(
CommunicationBuffer
&
buffer
,
const
Array
<
Element
>
&
elements
,
const
SynchronizationTag
&
tag
)
const
{
AKANTU_DEBUG_IN
();
switch
(
tag
)
{
case
SynchronizationTag
::
_cf_nodal:
{
DataAccessor
::
packNodalDataHelper
(
this
->
model
.
getDisplacement
(),
buffer
,
elements
,
this
->
model
.
getMesh
());
DataAccessor
::
packNodalDataHelper
(
this
->
model
.
getCurrentPosition
(),
buffer
,
elements
,
this
->
model
.
getMesh
());
DataAccessor
::
packNodalDataHelper
(
this
->
model
.
getVelocity
(),
buffer
,
elements
,
this
->
model
.
getMesh
());
break
;
}
case
SynchronizationTag
::
_cf_incr:
{
DataAccessor
::
packNodalDataHelper
(
this
->
model
.
getIncrement
(),
buffer
,
elements
,
this
->
model
.
getMesh
());
break
;
}
default
:
{
}
}
AKANTU_DEBUG_OUT
();
}
/* -------------------------------------------------------------------------- */
inline
void
NTNBaseContact
::
unpackData
(
CommunicationBuffer
&
buffer
,
const
Array
<
Element
>
&
elements
,
const
SynchronizationTag
&
tag
)
{
AKANTU_DEBUG_IN
();
switch
(
tag
)
{
case
SynchronizationTag
::
_cf_nodal:
{
DataAccessor
::
unpackNodalDataHelper
(
this
->
model
.
getDisplacement
(),
buffer
,
elements
,
this
->
model
.
getMesh
());
DataAccessor
::
unpackNodalDataHelper
(
const_cast
<
Array
<
Real
>
&>
(
this
->
model
.
getCurrentPosition
()),
buffer
,
elements
,
this
->
model
.
getMesh
());
DataAccessor
::
unpackNodalDataHelper
(
this
->
model
.
getVelocity
(),
buffer
,
elements
,
this
->
model
.
getMesh
());
break
;
}
case
SynchronizationTag
::
_cf_incr:
{
DataAccessor
::
unpackNodalDataHelper
(
this
->
model
.
getIncrement
(),
buffer
,
elements
,
this
->
model
.
getMesh
());
break
;
}
default
:
{
}
}
AKANTU_DEBUG_OUT
();
}
}
// namespace akantu
Event Timeline
Log In to Comment