AdH Kraken 0.0.0
Next generation Adaptive Hydraulics
Loading...
Searching...
No Matches
heat_residual.c File Reference
#include "adh.h"

Functions

int heat_residual (SMODEL_SUPER *mod, double *elem_rhs, int ie, double perturbation, int perturb_node, int perturb_var, int perturb_sign, int DEBUG)
 Returns the 2D Heat residual with constant RHS on an element, used for testing. More...
 

Detailed Description

This file collections functions responsible for the 2D Heat equation with constant RHS, used for testing https://jsdokken.com/dolfinx-tutorial/chapter2/heat_code.html

Function Documentation

◆ heat_residual()

int heat_residual ( SMODEL_SUPER mod,
double *  elem_rhs,
int  ie,
double  perturbation,
int  perturb_node,
int  perturb_var,
int  perturb_sign,
int  DEBUG 
)

Returns the 2D Heat residual with constant RHS on an element, used for testing.

Author
Mark Loveland, Ph.D.
Bug:
none
Warning
none
Parameters
[in]mod(SMODEL_SUPER*) - pointer to SMODEL_SUPER struct
[in,out]elem_rhs(double*) - array of doubles that will store elemental residual
[in]ie(int) - the elemental id
[in]pertubation(double) - the Newton pertubation
[in]perturb_node(int) - the node to be pertubed
[in]perturb_var(int) - the variable code to be perturbed
[in]perturb_sign(int) - the direction of Newton perturbation (-1 or +1)
[in]DEBUG(int) - a debug flag
Returns
integer code

Solves the body integals of the following weak, discrete body terms of the 2D Poisson equation:
$
 \int_{\Omega} \frac{\partial u_i}{\partial t} + \nabla u_i \cdot \nabla v_i dx - \int_{\Omega} f dx = 0 \\
 f= \beta - 2 -2\alpha \\
 u_{exact} = 1 + x^2 + \alpha y^2 + \beta t\\
 $