Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F61173018
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
Sun, May 5, 00:11
Size
1 KB
Mime Type
text/x-c++
Expires
Tue, May 7, 00:11 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
17475762
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