FlexELA
Loading...
Searching...
No Matches
Functions
ELA.h File Reference

Provides functions to setup ELA. More...

#include <mpi.h>

Go to the source code of this file.

Functions

void ELA_Init (const int *N, const int *pad, const int &numELA, MPI_Comm cart_comm)
 Initialize the ELA library.
 
void ELA_DeInit ()
 Cleanup ELA.
 
void ELA_InitLabels (const double *vof, const int &num, const int *labels)
 Initialize the source vector field ([Gaylo2022], Eq. 17)
 
int ELA_GetLabel (const int &i, const int &j, const int &k, const int &n)
 Get the first label at (i, j, k) for ELA instance n.
 
int ELA_ContainsNaNs ()
 Check if any values are NaN.
 
void ELA_CreateCheckpoint (const char *filename)
 Create a checkpoint file.
 
void ELA_LoadCheckpoint (const char *filename)
 Load a checkpoint.
 

Detailed Description

Provides functions to setup ELA.

These calls setup the library and creat the initial vector source fraction feild(s).

Function Documentation

◆ ELA_ContainsNaNs()

int ELA_ContainsNaNs ( )

Check if any values are NaN.

Returns
int 0 if no values are NaN
int 1 if one or more values are NaN
Note
For calling from Fortran, use ELA_ContainsNaNs(out) where out is the return value

◆ ELA_CreateCheckpoint()

void ELA_CreateCheckpoint ( const char *  filename)

Create a checkpoint file.

Parameters
filename

◆ ELA_DeInit()

void ELA_DeInit ( )

Cleanup ELA.

Dealocates memory reserved by ELA_Init()

◆ ELA_GetLabel()

int ELA_GetLabel ( const int &  i,
const int &  j,
const int &  k,
const int &  n 
)

Get the first label at (i, j, k) for ELA instance n.

Parameters
iFirst index
jSecond index
kThird index
nThe ELA instance
Returns
int The label l
Note
For calling from Fortran, use ELA_GetLabel(i,j,k,l) where l is the return value

◆ ELA_Init()

void ELA_Init ( const int *  N,
const int *  pad,
const int &  numELA,
MPI_Comm  cart_comm 
)

Initialize the ELA library.

The ELA library assumes all fields passed to it have the size and padding set here. The domain size is defined by the padding in each direction ( \( n_{i-} \), \( n_{i+} \)) and the number of cell in the domain in each direction ( \(N_i\)). Below is a 2D example.

Example (2D) Processor Domain
Note
The assumed ordering of the data ([i][j][k] or [k][j][i]) is set at compile time.
For the flux term in ELA_SolverAdvectLabels() to work correctly there must be atleast one layer of negative padding, \( n_{i-} \ge 1\)
Parameters
NThe number of cells in each direction, \(\left[N_{i},N_{j},N_{k}\right]\)
padThe number of ghost cells in each direction, \(\left[n_{i-},n_{i+},n_{j-},n_{j+},n_{k-},n_{k+}\right]\)
numELAThe number of ELA instances
cart_commThe MPI cartesian communicator (only if built with ELA_USE_MPI=on)

◆ ELA_InitLabels()

void ELA_InitLabels ( const double *  vof,
const int &  num,
const int *  labels 
)

Initialize the source vector field ([Gaylo2022], Eq. 17)

This function initializes a the source vector feild \( \mathbf{s} \) for ELA instance num. Each element \( s_l \) in the cell \( \Omega_{ijk} \) is given by

\[ (s_l)_{ijk} \gets \begin{cases} 1-f_{ijk} & \text{if} \quad \Omega_{ijk} \in \text{blob } l \\ 0 & \text{otherwise} \end{cases} \]

for \( l \in 0\dots M \). Cells belonging to the blob \( l =0 \) are included. Which blob \( l \) a cell \(\Omega_{ijk}\) is in is determined by the label feild labels, and a cell can only be in one blob. The number of blobs \( M \) is determined based on labels provided.

Parameters
vofThe volume fraction \( f \)
numThe ELA instance
labelsThe label feild

◆ ELA_LoadCheckpoint()

void ELA_LoadCheckpoint ( const char *  filename)

Load a checkpoint.

Note
Cannot be called before ELA_Init()
Parameters
filename