Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91961347
vec_akantu.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
Sat, Nov 16, 04:09
Size
3 KB
Mime Type
text/x-c
Expires
Mon, Nov 18, 04:09 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22351019
Attached To
rLIBMULTISCALE LibMultiScale
vec_akantu.hh
View Options
/**
* @file vec_akantu.hh
*
* @author Guillaume Anciaux <guillaume.anciaux@epfl.ch>
*
* @date Mon Jun 16 17:13:26 2014
*
* @brief This is a wrapper to Akantu arrays
*
* @section LICENSE
*
* Copyright (©) 2010-2011 EPFL (Ecole Polytechnique Fédérale de Lausanne)
* Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides)
*
* LibMultiScale 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.
*
* LibMultiScale 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 LibMultiScale. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef __LIBMULTISCALE_VEC_AKANTU_HH__
#define __LIBMULTISCALE_VEC_AKANTU_HH__
/* -------------------------------------------------------------------------- */
#include "aka_array.hh"
/* -------------------------------------------------------------------------- */
__BEGIN_LIBMULTISCALE__
class
VecAkantu
{
/* ------------------------------------------------------------------------ */
/* Constructors/Destructors */
/* ------------------------------------------------------------------------ */
public
:
VecAkantu
();
VecAkantu
(
akantu
::
Array
<
Real
>
&
vec
);
/* ------------------------------------------------------------------------ */
/* Methods */
/* ------------------------------------------------------------------------ */
inline
Real
&
operator
()(
const
UInt
i
);
inline
Real
&
operator
[](
const
UInt
i
);
void
close
();
inline
void
add
(
UInt
i
,
Real
value
);
private
:
akantu
::
Array
<
Real
>
*
vec
;
};
/* -------------------------------------------------------------------------- */
inline
VecAkantu
::
VecAkantu
(){
vec
=
NULL
;
}
/* -------------------------------------------------------------------------- */
inline
VecAkantu
::
VecAkantu
(
akantu
::
Array
<
Real
>
&
vec
){
this
->
vec
=
&
vec
;
}
/* -------------------------------------------------------------------------- */
inline
Real
&
VecAkantu
::
operator
()(
const
UInt
i
){
return
vec
->
storage
()[
i
];
}
/* -------------------------------------------------------------------------- */
inline
Real
&
VecAkantu
::
operator
[](
const
UInt
i
){
return
vec
->
storage
()[
i
];
}
/* -------------------------------------------------------------------------- */
inline
void
VecAkantu
::
close
(){
/// do nothing as long as akantu is used on the base of a ghost element parallelisation
}
/* -------------------------------------------------------------------------- */
inline
void
VecAkantu
::
add
(
UInt
i
,
Real
value
){
vec
->
storage
()[
i
]
+=
value
;
}
/* -------------------------------------------------------------------------- */
__END_LIBMULTISCALE__
#endif
/* __LIBMULTISCALE_VEC_AKANTU_HH__ */
Event Timeline
Log In to Comment