Computational Physics - Department of Physics
5.4 Treatment of Singular Integrals 129 where we have isolated the principal value part in the last integral. Defining a new var ...
130 5 Numerical Integration I(x) =P ∫+ 1 − 1 dte t t . (5.22) The integrand diverges atx=t= 0. We rewrite it using Eq. (5.20) as ...
5.5 Parallel Computing 131 5.5 Parallel Computing We end this chapter by discussing modern supercomputing concepts like parallel ...
132 5 Numerical Integration hardware with the open source software (Linux) infrastructure. The designer can improve performance ...
5.5 Parallel Computing 133 T 1 = 3 n∆t. Suppose now that we have access to a parallel supercomputer withPprocessors. Assume also ...
134 5 Numerical Integration problem, or memory problems, or that a so-called startup time penalty known as latency may slow down ...
5.5 Parallel Computing 135 cout <<"Hello world, I have rank "<< my_rank <<" out of "<< numprocs << ...
136 5 Numerical Integration while for C++ we use the functionMPI_Finalize(). In addition to these calls, we have also included c ...
5.5 Parallel Computing 137 Hello world, I’ve rank 0 out of 10 procs. Hello world, I’ve rank 1 out of 10 procs. Hello world, I’ve ...
138 5 Numerical Integration Hello world, I’ve rank 7 out of 10 procs. Hello world, I’ve rank 8 out of 10 procs. Hello world, I’v ...
5.5 Parallel Computing 139 Furthermore, when an MPI routine is called, the Fortran or C++ data type which is passed must match t ...
140 5 Numerical Integration http://folk.uio.no/mhjensen/compphys/programs/chapter05/program5.cpp 1 // Reactangle rule and numeri ...
5.5 Parallel Computing 141 In line 17 we define also the step lengthh. In lines 19 and 20 we use the broadcast function MPI_Bcas ...
142 5 Numerical Integration MPI_Allreduce(voidsenddata,voidresultdata,intcount, MPI_Datatype datatype, MPI_Op, MPI_Comm comm) Th ...
5.6 An Integration Class 143 // End MPI MPI_Finalize (); return0; }// end of main program // this function defines the function ...
144 5 Numerical Integration returnexp(x)*cos(x); } }; intmain(){ // Declare first an object of the function to be integrated Exp ...
5.6 An Integration Class 145 ifndefFUNCTION_H defineFUNCTION_H include"Array.h" classFunction{ public: //! Destructor virtual~Fu ...
146 5 Numerical Integration /** *@brief Evaluate the integral. *@return The value of the integral in double precision. **/ virtu ...
5.7 Exercises 147 }; classGauss_Legendre:publicIntegral{ private: static const doubleZERO = 1.0E-10; static const doublePI = 3.1 ...
148 5 Numerical Integration I= ∫ 1 0 4 1 +x^2 =π, and I= ∫∞ 0 xexp(−x)sinx= 1 2. Discuss strategies for choosing the integration ...
«
3
4
5
6
7
8
9
10
11
12
»
Free download pdf