15#include "../common/grid_common.h"
25 assert(handle != NULL);
39 handle->
scratch = malloc(32768 *
sizeof(
double));
40 assert(handle->
scratch != NULL);
47 handle->
device_id = (
int *)malloc(
sizeof(
double) * 12);
52 handle->
map = (
int **)malloc(3 *
sizeof(
int *));
53 assert(handle->
map != NULL);
54 handle->
map[0] = (
int *)malloc(
sizeof(
int) * 512 * 3);
55 assert(handle->
map[0] != NULL);
56 handle->
map[1] = handle->
map[0] + 512;
57 handle->
map[2] = handle->
map[1] + 512;
58 handle->
cmax = 512 * 3;
97 const size_t mem_alloc_size_ =
110 assert(handler->
scratch != NULL);
127 const size_t mem_alloc_size_ = tmp1 + tmp2;
139 assert(handler->
scratch != NULL);
144 const double dh[3][3],
145 const double dh_inv[3][3]) {
146 handler->
dh[0][0] =
dh[0][0];
147 handler->
dh[0][1] =
dh[0][1];
148 handler->
dh[0][2] =
dh[0][2];
149 handler->
dh[1][0] =
dh[1][0];
150 handler->
dh[1][1] =
dh[1][1];
151 handler->
dh[1][2] =
dh[1][2];
152 handler->
dh[2][0] =
dh[2][0];
153 handler->
dh[2][1] =
dh[2][1];
154 handler->
dh[2][2] =
dh[2][2];
167 handler->
dx[2] = handler->
dh[0][0] * handler->
dh[0][0] +
168 handler->
dh[0][1] * handler->
dh[0][1] +
169 handler->
dh[0][2] * handler->
dh[0][2];
170 handler->
dx[1] = handler->
dh[1][0] * handler->
dh[1][0] +
171 handler->
dh[1][1] * handler->
dh[1][1] +
172 handler->
dh[1][2] * handler->
dh[1][2];
173 handler->
dx[0] = handler->
dh[2][0] * handler->
dh[2][0] +
174 handler->
dh[2][1] * handler->
dh[2][1] +
175 handler->
dh[2][2] * handler->
dh[2][2];
static int imax(int x, int y)
Returns the larger of two given integers (missing from the C standard)
void initialize_basis_vectors(collocation_integration *const handler, const double dh[3][3], const double dh_inv[3][3])
void initialize_W_and_T_integrate(collocation_integration *const handler, const int num_block, const tensor *coef, const tensor *block)
void collocate_destroy_handle(void *gaussian_handle)
void initialize_W_and_T(collocation_integration *const handler, const tensor *cube, const tensor *coef)
struct collocation_integration_ * collocate_create_handle(void)
size_t realloc_tensor(tensor *t)
static size_t compute_memory_space_tensor_4(const int n1, const int n2, const int n3, const int n4)
static size_t compute_memory_space_tensor_3(const int n1, const int n2, const int n3)
tensor blocks_coordinates
size_t scratch_alloc_size