HyPar  1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
TimeGetAuxSolutions.c File Reference

Returns any "auxiliary" solutions. More...

#include <stdio.h>
#include <string.h>
#include <hypar.h>
#include <timeintegration.h>

Go to the source code of this file.

Functions

int TimeGetAuxSolutions (int *N, double **uaux, void *s, int nu, int ns)
 

Detailed Description

Returns any "auxiliary" solutions.

Author
Debojyoti Ghosh

Definition in file TimeGetAuxSolutions.c.

Function Documentation

◆ TimeGetAuxSolutions()

int TimeGetAuxSolutions ( int *  N,
double **  uaux,
void *  s,
int  nu,
int  ns 
)

Return auxiliary solution: Some time integrators may have the concept of auxiliary solutions that they evolve along with the main solution HyPar::u (these may be used for error estimation, for example). This function returns a pointer to such an auxiliary solution. Note that the auxiliary solution has the same dimensions and array layout as the main solution.

  • Call with the final argument n less than 0 to get the total number of auxiliary solutions (this value will be stored in the argument N at exit).
  • Call with the final argument n less than or equal to zero to get the n-th auxiliary solution (the argument uaux will point to this at exit).

Note that auxiliary solutions are numbered in the C convention: 0,1,...,N-1.

Time integration methods which use auxiliary solutions currently implemented:

Parameters
NNumber of auxiliary solutions
uauxPointer to the array holding the auxiliary solution
sSolver object of type HyPar
nuIndex of the auxiliary solution to return
nsIndex of the simulation domain of which the auxiliary solution to return

Definition at line 29 of file TimeGetAuxSolutions.c.

36 {
37  HyPar *solver = (HyPar*) s;
39 
40  if (nu >= 0) {
41  if (!strcmp(solver->time_scheme,_GLM_GEE_)) {
42  GLMGEEParameters *params = (GLMGEEParameters*) solver->msti;
43  *uaux = (TS->U[params->r+nu] + TS->u_offsets[ns]);
44  }
45  } else {
46  if (!TS) *N = 0;
47  else {
48  if (!strcmp(solver->time_scheme,_GLM_GEE_)) {
49  GLMGEEParameters *params = (GLMGEEParameters*) solver->msti;
50  *N = params->r - 1;
51  } else *N = 0;
52  }
53  }
54 
55  return(0);
56 }
Structure of variables/parameters and function pointers for time integration.
void * time_integrator
Definition: hypar.h:165
Structure containing all solver-specific variables and functions.
Definition: hypar.h:23
char time_scheme[_MAX_STRING_SIZE_]
Definition: hypar.h:78
#define _GLM_GEE_
void * msti
Definition: hypar.h:366
Structure containing the parameters for the General Linear Methods with Global Error Estimators (GLM-...