/* Last edited on 2009-11-09 16:37:07 by stolfilocal */ /*************************************************************************** * 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 _INICIALIZA_H_ #define _INICIALIZA_H_ #include #include #include #include #include "bool.h" #include "definicoes.h" #include "arvore.h" #include "jsmath.h" /** * @brief Condicao inicial do problema de equacoes diferenciais parciais * Escolhe funcoes diferentes segundo a dimensao d * @param d [in] dimensao do dominio * @param x [in] coordenadas dum ponto no dominio * @return */ double condicaoinicial(int d, double x[]); double pulso(int d, double x[]) ; double seno(int d, double x[]); double riemann(int d, double x[]); double riemann2(int d, double x[]); double riemann3(int d, double x[]); double bseno(int d, double x[]) ; double sol_burg_riem(int d, double x[]); /** * @brief Condicao inicial do problema de equacoes diferenciais parciais * Sempre uma funcao gaussiana. * @param d [in] dimensao do dominio * @param x [in] coordenadas dum ponto no dominio * @return */ double gaussinicial(int d, double x[]); /** * @brief Fluxo continuo. Representado por {f} na equacao diferencial u_t + div f(u) = 0; * @param x [in] media de {u} na celula * @return; */ double adveccao(double x); double burger(double x); double diferente(double x); double buckleyLeverett(double x); void solanalitica_advec ( int d, double xmin[], double xmax[], Funcao *f, /* Supostamente com periodo {[xmin _ xmax]} */ int niv_tot, int N, double dt, int tp, VNo pac[], QuadraturaSA integraSA, Preditor pred ); void solanalitica_burg ( int d, double xmin[], double xmax[], Funcao *f, /* Supostamente com periodo {[xmin _ xmax]} */ int niv_tot, int N, double dt, int tp, VNo pac[], QuadraturaSA integraSA, Preditor pred ); /** * Constroi a representacao por pacote {pac} da funcao {f} na celula de dimensao {d} * cujos limites sao {xmin[0..d-1]} e {xmax[0..d-1]}. As arvores terao * profundidade maxima {niv_max}. Elimina nos que sao superfluos * pelos criterio {eps}. O pacote tem {tp} elementos em cada dimensao, * ou seja {tp^d} elementos no total. * @param d [in] dimensao do dominio * @param xmin [in] limite inferior da celula * @param xmax [in] limite superior da celula * @param f [in] funcao a ser aproximada, supostamente periodica * @param niv_max [in] nivel maximo de refinamento da malha * @param eps [in] parametro de tolerancia no nivel mais refinado * @param tp [in] tamanho do pacorte, depende da ordem de interpolacao adotada * @param integra [in] rotina que calcula integral de {f} na celula * @param pred [in] rotina de previsao para media celular nos filhos da celula * @param poda [in] diz se eh para eliminar os nos superfluos ou nao * @return */ void aproxima_funcao ( int d, double xmin[], double xmax[], Funcao *f, /* Supostamente com periodo {[xmin _ xmax]} */ int niv_max, double eps, int tp, VNo pac[], Quadratura integra, Preditor pred, bool_t podar, bool_t haar, bool_t op ); /* Define {u->fval} e {u->fv[1]}. */ #endif