Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F72648156
Allocate.h
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
Tue, Jul 16, 09:22
Size
1 KB
Mime Type
text/x-c++
Expires
Thu, Jul 18, 09:22 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
19086937
Attached To
rGOOSEFEM GooseFEM
Allocate.h
View Options
/*
(c - GPLv3) T.W.J. de Geus (Tom) | tom@geus.me | www.geus.me | github.com/tdegeus/GooseFEM
*/
#ifndef GOOSEFEM_ALLOCATE_H
#define GOOSEFEM_ALLOCATE_H
#include "config.h"
namespace
GooseFEM
{
// "Broadcast" a scalar stored in an array (e.g. [m, n]) to the same scalar of all tensor components
// of a tensor of certain rank (e.g. for rank 2 [m, n, i, j])
template
<
size_t
dim
,
size_t
rank
>
inline
void
asTensor
(
const
xt
::
xtensor
<
double
,
dim
>&
arg
,
xt
::
xtensor
<
double
,
dim
+
rank
>&
ret
);
template
<
size_t
dim
,
size_t
rank
>
inline
xt
::
xtensor
<
double
,
dim
+
rank
>
AsTensor
(
const
xt
::
xtensor
<
double
,
dim
>&
arg
,
const
std
::
array
<
size_t
,
rank
>&
shape
);
template
<
size_t
dim
,
size_t
rank
>
inline
xt
::
xtensor
<
double
,
dim
+
rank
>
AsTensor
(
const
xt
::
xtensor
<
double
,
dim
>&
arg
,
size_t
n
);
template
<
class
T
>
inline
xt
::
xarray
<
double
>
AsTensor
(
size_t
rank
,
const
T
&
arg
,
const
std
::
vector
<
size_t
>&
shape
);
template
<
class
T
>
inline
xt
::
xarray
<
double
>
AsTensor
(
size_t
rank
,
const
T
&
arg
,
size_t
n
);
// Zero-pad columns to a matrix until is that shape [m, 3]
inline
xt
::
xtensor
<
double
,
2
>
as3d
(
const
xt
::
xtensor
<
double
,
2
>&
data
);
}
// namespace GooseFEM
#include "Allocate.hpp"
#endif
Event Timeline
Log In to Comment