quadpts.h

Go to the documentation of this file.
00001 
00002 
00003 //
00008 
00009 //--------------------------------------------------------------------------
00010 //--------------------------------------------------------------------------
00011 //  
00012 //  libMoM Library - a library for stochastic simulations in engineering.
00013 // 
00014 //  Copyright (C) 2010 Rochan R. Upadhyay
00015 // 
00016 //  This library is free software; you can redistribute it and/or
00017 //  modify it under the terms of the Version 2.1 GNU Lesser General
00018 //  Public License as published by the Free Software Foundation.
00019 // 
00020 //  This library is distributed in the hope that it will be useful,
00021 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00022 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00023 //  Lesser General Public License for more details.
00024 // 
00025 //  You should have received a copy of the GNU Lesser General Public
00026 //  License along with this library; if not, write to the Free Software
00027 //  Foundation, Inc. 51 Franklin Street, Fifth Floor, 
00028 //  Boston, MA  02110-1301  USA
00029 // 
00030 //--------------------------------------------------------------------------
00031 
00032 #ifndef _QUADPTS_H
00033 #define _QUADPTS_H
00034 
00035 #include <stdio.h>
00036 #include <stdlib.h>
00037 #include <gsl/gsl_errno.h>
00038 #include <gsl/gsl_odeiv.h>
00039 #include "gsl_vector_integer.h"
00040 #include "gsl_vector_double.h"
00041 #include "gsl_matrix_double.h"
00042 #include "gsl_matrix_integer.h"
00043 #include "gsl_vector_matrix_ops.h"
00044 #include "gsl_ode_solver.h"
00045 #include "moments.h"
00046 
00047 class moments;
00048 
00050 //
00052 
00053 class quadpts : public vector
00054 {
00055  
00056 public:
00057 
00059 //
00060 
00061     quadpts();
00062 
00064 // 
00066 //
00067 
00068     quadpts ( size_t a );
00069 
00071 //
00075 //
00077 //
00078 
00079     moments getmoments ( size_t a, size_t b ) const;
00080 
00082 //
00086 //
00088 //
00089 
00090     moments get_fixed_number_moments_1D ( size_t num_moments, size_t num_points ) const;
00091 
00093 //
00097 //
00100 //
00101 
00102     moments get_user_defined_moments_GLD_1D ( size_t dimension, size_t num_points ) const;
00103     
00104      moments get_user_defined_moments_1D ( size_t dimension, size_t num_points, size_t number ) const;
00105 
00107 //
00111 //
00112     
00113     matrix get_non_singular_Jacobian ( size_t a, size_t b ) const;
00114 
00116 //
00122 //
00123 
00124     vector get_source ( size_t dimension, size_t num_points ) const;
00125 
00128 //
00134 //
00135     
00136     void solve ( size_t dimension, size_t num_points, double dt,
00137                                     long int num_steps, int print_interval );
00138 
00141 //
00147 //
00149 //
00150 
00151     void solve_with_gsl ( size_t dimension, size_t num_points, double dt,
00152                                     long int num_steps, int print_interval );                                
00153 
00155 //
00161 //
00162     
00163     void post_process_quadpts (size_t dimension, size_t num_points, double time) const;
00164     
00166 //
00170 //
00171 
00172     matrix get_cdf_empirical (size_t dimension, size_t num_points, size_t num_intervals) const;
00173 
00175 //
00183 //
00184 
00185     void return_quadwts_quadpts_vector (size_t dimension, size_t num_points, double y[]) const;
00186 
00187 private:
00188 
00190 //
00191     vector quads;
00192     
00193 };
00194   
00195 
00196 class my_ode_function : public ode_function
00197 {
00198    public:   
00199 
00200    vector operator()(double time, const vector& x);   
00201 
00202 };
00203 
00204 #endif // QUADPTS_H
00205 
All Classes Files Functions Variables Typedefs Friends Defines