Basilisk CFD
Adaptive Cartesian mesh PDE framework
Loading...
Searching...
No Matches
harmonic.h File Reference

Go to the source code of this file.

Functions

static double de (int n, double *ha, double *hx, double **M)
 
void harmonic_decomposition (scalar s, double t, double *omega, scalar e={-1})
 
void event_cleanup (void)
 Event: cleanup (t = end)
 

Variables

 attribute
 

Function Documentation

◆ de()

static double de ( int  n,
double ha,
double hx,
double **  M 
)
static

Definition at line 26 of file harmonic.h.

References ha, hx, i, j, n, and x.

◆ event_cleanup()

void event_cleanup ( void  )

Event: cleanup (t = end)

Definition at line 189 of file harmonic.h.

References free(), matrix_free(), s, x, and Z.

Here is the call graph for this function:

◆ harmonic_decomposition()

void harmonic_decomposition ( scalar  s,
double  t,
double omega,
scalar  e = {-1} 
)

Definition at line 42 of file harmonic.h.

Variable Documentation

◆ attribute

attribute
Initial value:
{
struct {
double * omega;
scalar * A, * B, Z, E;
double ** M, ** Mn;
bool invertible;
int x
Definition common.h:76
scalar E[]
#define A(i)
Definition rpe.h:57
scalar omega[]
We allocate the vorticity field , the streamfunction field and a structure to store the statistics o...
Definition stream.h:39
#define Z
Definition tribox3.h:23

Harmonic decomposition

The harmonic_decomposition() function performs a continuous, least-square fit of the coefficients \(Z\) and $(a_i,b_i)$ of the harmonic fonction

\[ Z + \sum_i a_i \cos(\omega_i t) + b_i \sin(\omega_i t) \]

to the scalar field s, with the \(\omega_i\) given as input.

If the optional argument e is given, it is used to store the residual (i.e. the standard deviation) of the fit.

Definition at line 17 of file harmonic.h.