MASA-0.44.0
Functions
laplacian_utils.c File Reference

Utility functions used with laplacian.c. More...

#include "laplacian.h"
Include dependency graph for laplacian_utils.c:

Detailed Description

Utility functions used with laplacian.c.

Functions

void init_masa (pstruct *model)
 Initializes MASA library and applies right-hand side forcing function at all solution points. More...
 
void enforce_dirichlet_bc (const int row_id, const int col_id, const double value, pstruct *model)
 Enforces a Dirichlet BC in the model system by nullifying all but the diagonal entry for the row corresponding to a given solution value. The model RHS forcing function is set to the desired Dirchlet value and the diagonal is set to unity to enforce the desired constraint. More...
 
void print_matrix (pstruct *model)
 Prints model system matrix and right-hand side vector to stdout. More...
 
void assemble_matrix (const int fd_method, pstruct *model)
 Assembles system matrix entries using a finite-difference approximation. The fd_method parameter controls the choice of underlying FD stencil. More...
 
void apply_bcs (pstruct *model)
 
void solve_gauss (pstruct *model)
 
int converged (double *a, double *b, double eps, int n, double *diff)
 
void solve_cg (pstruct *model)
 
double compute_l2_error (pstruct *model)
 
void compute_error (pstruct *model)
 

Function Documentation

assemble_matrix ( const int  fd_method,
pstruct model 
)

Assembles system matrix entries using a finite-difference approximation. The fd_method parameter controls the choice of underlying FD stencil.

Parameters
fd_methodDesired finite-difference stencil
modelPointer to the primary model data-structure
enforce_dirichlet_bc ( const int  row_id,
const int  col_id,
const double  value,
pstruct model 
)

Enforces a Dirichlet BC in the model system by nullifying all but the diagonal entry for the row corresponding to a given solution value. The model RHS forcing function is set to the desired Dirchlet value and the diagonal is set to unity to enforce the desired constraint.

Parameters
row_idRow index to enforce the constraint
col_idColumn index to enforce the constraint
valueDesired solution value
modelPointer to the primary model data-structure
init_masa ( pstruct model)

Initializes MASA library and applies right-hand side forcing function at all solution points.

Parameters
modelPointer to the primary model data-structure
print_matrix ( pstruct model)

Prints model system matrix and right-hand side vector to stdout.

Parameters
modelPointer to the primary model data-structure

Generated on Tue Apr 21 2015 10:22:49 for MASA-0.44.0 by  doxygen 1.8.5