#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include "crusde_api.h"
Functions | |
const char * | get_name () |
const char * | get_version () |
const char * | get_authors () |
PluginCategory | get_category () |
const char * | get_description () |
void | request_plugins () |
void | register_output_fields () |
void | run () |
Performs the fast convolution. | |
void | clear () |
void | init () |
Initialization of the convolution. Allocation of memory for inputs and outputs. | |
void | register_parameter () |
Register parameters this Kernel claims from the input. | |
double | get_value_at (unsigned int t) |
Variables | |
double * | p_tR [100] |
double | tR |
int | my_id = 0 |
Sinusoidal load history that calculates a load height depending on the current time step (t), a period length (p) and the timestep when the load is supposed to be at maximum (dm):
with hm being the maximum load height.
void clear | ( | ) |
freeing mallocs
Frees memory allocated during init(). FFTW plans are destroyed.
const char* get_authors | ( | ) |
PluginCategory get_category | ( | ) |
References CRUSTALDECAY_PLUGIN.
Referenced by register_parameter().
const char* get_description | ( | ) |
const char* get_name | ( | ) |
Referenced by register_output_fields(), and run().
double get_value_at | ( | unsigned int | t | ) |
References crusde_get_current_load_component(), my_id, p_tR, and tR.
const char* get_version | ( | ) |
void init | ( | ) |
Initialization of the convolution. Allocation of memory for inputs and outputs.
empty
The field sizes are adjusted according to the needs to avoid wrap around effects in the spectal domain and allow for effective use of DFT (lenght and width are a power of 2). Memory is allocated using fftw_malloc for DFT inputs and outputs (load_in, load_out, green_in, green_out, conv_in, conv_out). Three FFTW plans are created for DFT transform of Green and load arrays and IDFT of the convolution result back to original domain.
initializes local vars
initializes local variables
void register_output_fields | ( | ) |
empty
void register_parameter | ( | ) |
Register parameters this Kernel claims from the input.
Register parameters this load function claims from the input.
empty
This plugin calls register_kernel_param() defined in crusde_api.h to register references to parameters this Kernel will need to operate properly. For command line use the order of registration in this function defines the identification of parameters in the command line string (i.e. './green -KfirstRegistered/secondRegistered/...'). In case an XML is used to configure the experiment, the reference to this parameter will be identified by the string passed as second argument to register_kernel_param().
This function registers the references in the following order:
Thus, the command line parameter string is: -K
References crusde_get_current_load_component(), crusde_register_param_double(), get_category(), my_id, and p_tR.
void request_plugins | ( | ) |
empty
we re-use spatial convolution!
void run | ( | ) |
Performs the fast convolution.
empty
Requests values for each point in the examined area from Green's function (only once when modeltime == 0) and load function (every timestep). Does the origin shifting necessary for the Green's function values. The Green's function values are requested for each displacement direction the Green's function registered with the CrusDe.
FFTW plan is executed for the load. Then for each Green's function displacement direction the FFTW plan is executed, a complex multiplication of the DFT results performed and then for product the FFTW plan is executed (IDFT). The result of the convolution is extracted from the oversized IDFT result and cropped to the original size of the examined region.
CAN ONLY BE USE FOR ONE LOAD (i.e. multiple loads in one load file), to realize reuse of this operator in fast_conv_time_space - the loads want to have independent load histories!
Requests values for each point in the examined area from Green's function (only once when modeltime == 0) and load function (every timestep). Does the origin shifting necessary for the Green's function values. The Green's function values are requested for each displacement direction the Green's function registered with the CrusDe.
FFTW plan is executed for the load. Then for each Green's function displacement direction the FFTW plan is executed, a complex multiplication of the DFT results performed and then for product the FFTW plan is executed (IDFT). The result of the convolution is extracted from the oversized IDFT result and cropped to the original size of the examined region.
ATTN: result[d][x] still holds the values from the last time run was called. This way adding up the results of multiple jobs is realized!
does the conversion.
does the calculation
int my_id = 0 |
Referenced by get_value_at(), init(), and register_parameter().
double* p_tR[100] |
effective relaxation time [yr]
Referenced by get_value_at(), and register_parameter().
double tR |
effective relaxation time [yr]
Referenced by get_value_at().