/*************************************************************************** * Copyright (C) 2009 by Douglas Castro * * douglas@ime.unicamp.br * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #ifndef _FLUXO_H_ #define _FLUXO_H_ #include #include #include #include #include "definicoes.h" #include "jsmath.h" #include "inicializa.h" #include "arvore.h" #define MIN(a,b) ((a)>(b)?(b):(a)) #define MAX(a,b) ((a)>(b)?(a):(b)) /** * Funcao para calcular o fluxo numerico na interface das celulas i e i+1 para equacao de adveccao. * Isto e, o fluxo no ponto i+1/2 * @param u1 [in] valor da media na celula i-1 * @param u2 [in] valor da media na celula i * @param u3 [in] valor da media na celula i+1 * @param c [in] velocidade de adveccao .. deefinida na equacao diferencial */ double flux(double u1, double u2, double u3, double c); double fluxo_roe(double u1, double u2, double u3, double u4, double div, Fluxo f); double fluxo_upwind(double u1, double u2, double df, Fluxo f); double minmod(double a, double b); bool_t folhasounulos(int d, int ord, VNo pac[]); void calcula_fluxosT(int d, int prof, VNo pac[], double xmin[], double xmax[], Preditor pred, Fluxo f, int lim, bool_t op); void calcula_fluxos_upwind(int d, int prof, VNo pac[], double xmin[], double xmax[], Preditor pred, Fluxo f, int lim, bool_t op); void calcula_fluxo_weno_v2(int d, int prof, VNo pac[], double xmin[], double xmax[],Fluxo f, Preditor pred, bool_t rd, bool_t op, int lim); double ReconstrucaoR2(int j, double x, int sdfu, double xmaxx, double xminn, double u[]); double ReconstrucaoR3(int j, double x, int sdfu, double xmaxx, double xminn, double u[]); // implementar aqui o fluxo H(.,.), que eh Lipschitz // monotona nao decrescente no primeiro argumento e // monotona nao crescente no segundo argumento // Liu, Osher, Chan, Journal of Computational Physics 115, 200-212 1994. double H(double a, double b, Fluxo f); #endif