Streamer fluid modeling - An overview of ARCoS  1.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Macros | Functions
mapper.c File Reference

All functions related to the mapping of whatever variable (densities, electric field...) from one tree into another. More...

#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include "cstream.h"
#include "grid.h"
#include "interpol2.h"
#include "mapper.h"
#include "proto.h"
#include "species.h"
Include dependency graph for mapper.c:

Go to the source code of this file.

Macros

#define MAX_MAPPERS   32
 With this, we limit the number of mappers.
 

Functions

static void map_same (mapper_t **mappers, grid_t *source, grid_t *target, int ntheta, int r0, int z0, int r1, int z1)
 The level of the source and target grids is the same.
 
static void map_interpol (mapper_t **mappers, grid_t *source, grid_t *target, int ntheta, int r0, int z0, int r1, int z1, int level_diff)
 The source grid is coarser than the target grid.
 
static void interpol_inner (mapper_t **mappers, grid_t *source, grid_t *target, int pr, int pz, int ntheta, interpol_t **interpols, int *extend_r, int *extend_z)
 Calculates all the points in a target grid, finer than a source grid that are interpolated from a stencil centered at pr, pz in the source grid.
 
static void map_coarsen (mapper_t **mappers, grid_t *source, grid_t *target, int ntheta, int r0, int z0, int r1, int z1, int level_diff)
 The target grid is coarser than the source grid.
 
void map_grid (mapper_t **mappers, grid_t *source, grid_t *target, int ntheta, int copy, int interpol, int coarsen, int s_buff, int t_buff)
 Maps two grids.
 
void map_grid_r (mapper_t **mappers, grid_t *source, grid_t *target, int ntheta, int copy, int interpol, int coarsen, int s_buff, int t_buff)
 Recursive version of map_grid.
 
void map_trees_r (mapper_t **mappers, grid_t *source, grid_t *target, int ntheta, int copy, int interpol, int coarsen, int s_buff, int t_buff)
 Double-recursive version:
 

Detailed Description

All functions related to the mapping of whatever variable (densities, electric field...) from one tree into another.

Here the relevant data structure is defined by mapper_t, which tells us what functions should we call to perform copying, interpolation and coarsening from one grid into another (not neccesarily ofthe same type).

Definition in file mapper.c.

Macro Definition Documentation

#define MAX_MAPPERS   32

With this, we limit the number of mappers.

But it is extremely improbable that someone would like to use more than 32 mappers at the same time.

Definition at line 174 of file mapper.c.

Function Documentation

static void map_same ( mapper_t **  mappers,
grid_t source,
grid_t target,
int  ntheta,
int  r0,
int  z0,
int  r1,
int  z1 
)
static

The level of the source and target grids is the same.

This is the easiest case.

Definition at line 147 of file mapper.c.

Here is the caller graph for this function:

static void map_interpol ( mapper_t **  mappers,
grid_t source,
grid_t target,
int  ntheta,
int  r0,
int  z0,
int  r1,
int  z1,
int  level_diff 
)
static

The source grid is coarser than the target grid.

Definition at line 178 of file mapper.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static void interpol_inner ( mapper_t **  mappers,
grid_t source,
grid_t target,
int  pr,
int  pz,
int  ntheta,
interpol_t **  interpols,
int *  extend_r,
int *  extend_z 
)
static

Calculates all the points in a target grid, finer than a source grid that are interpolated from a stencil centered at pr, pz in the source grid.

interpol_xxx are interpolation objects that can thus be reused. extend_r and extend_z are here because one call to interpol_inner can actually set (1 << level_diff + 1) fine grid points, but the boundaries are shared with the next/previous call.

In the first call in a row/column, we set all the points, since the right/lower boundary is not shared.

Definition at line 251 of file mapper.c.

Here is the caller graph for this function:

static void map_coarsen ( mapper_t **  mappers,
grid_t source,
grid_t target,
int  ntheta,
int  r0,
int  z0,
int  r1,
int  z1,
int  level_diff 
)
static

The target grid is coarser than the source grid.

Definition at line 316 of file mapper.c.

Here is the caller graph for this function:

void map_grid ( mapper_t **  mappers,
grid_t source,
grid_t target,
int  ntheta,
int  copy,
int  interpol,
int  coarsen,
int  s_buff,
int  t_buff 
)

Maps two grids.

The arguments copy, interpol and coarsen are booleans that specify whether we should apply these methods in the mapping.

Definition at line 41 of file mapper.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void map_grid_r ( mapper_t **  mappers,
grid_t source,
grid_t target,
int  ntheta,
int  copy,
int  interpol,
int  coarsen,
int  s_buff,
int  t_buff 
)

Recursive version of map_grid.

Recurses over the source tree depth-first

Definition at line 105 of file mapper.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void map_trees_r ( mapper_t **  mappers,
grid_t source,
grid_t target,
int  ntheta,
int  copy,
int  interpol,
int  coarsen,
int  s_buff,
int  t_buff 
)

Double-recursive version:

Also recurses over the target tree.

Definition at line 126 of file mapper.c.

Here is the call graph for this function:

Here is the caller graph for this function: