CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   on taylor's series and C++ arrays (https://www.cfd-online.com/Forums/main/3588-taylors-series-c-arrays.html)

yfyap June 10, 2001 21:28

on taylor's series and C++ arrays
 
1) is taylor's series still true for a non-orthogonal boundary fitted coordinate? 2) what is the largest array that C++ can handle? thanks in advance for any information. regards, yfyap

freak June 11, 2001 01:57

Re: on taylor's series and C++ arrays
 
you have to transform the coordinatesystem in to an orthogonal system for example with elliptical transformation. than you have an nummerical and an physikal coordinatesystem and every point in the one system has an brother in the other system. now you can use taylor (equal distant increment in the nummerical system). with c++ i can not help you because i have an problem wit it to (instability - overflown error).

Sebastien Perron June 11, 2001 06:52

Re: on taylor's series and C++ arrays
 
It depends on Operating system. But, I have dealt with medium size problems (1 million unknowns) and the maximum array size wasn't an issue in C++.

yfyap June 11, 2001 07:53

Re: on taylor's series and C++ arrays
 
thanks. is it that i have to transform the non-orthogonal coordinate system into an orthogonal coordinate first, before i can use taylor's series? is this implies that taylor's series is only valid for orthogonal coordinate system?

clifford bradford June 14, 2001 19:30

Re: on taylor's series and C++ arrays
 
Taylor's series is valid for any continuous function with continuous derivatives to the order you wish to go. See your calculus book. As far as I know the limit on array size is simply the amount of RAM you have. The ANSI C spec. (which your C++ code should follow) does not specify a matrix size limit.

John C. Chien June 14, 2001 21:40

Re: on taylor's series and C++ arrays
 
(1). Array is given by its name and index, say A[i], where i is integer index. (2). In C++, the limit for int integer is 2^31 - 1. (slightly larger 2 billion)

yfyap June 14, 2001 21:59

Re: on taylor's series and C++ arrays
 
thanks

yfyap June 14, 2001 22:01

Re: on taylor's series and C++ arrays
 
thanks.

andy June 22, 2001 08:36

Re: on taylor's series and C++ arrays
 
This is wrong. C/C++ does not specify a size for int which is a cause of much grief for non-system programmers like us. The compiler writer can use whatever size is natural for the particular processor (or not) as they wish. So a C/C++ compiler on a 16 bit machines such as an old PC is likely to use 16 bits for an int (but might use 32) - use the sizeof operator to find out. A current 32 bit processor such as a Pentium is almost certain to use 32 bits as you suggest. But a compiler for a current 64 bit processor such as the Alpha is more likely to use 64 bits for an int than 32. So what is the size of long and short? These can be the same size as int but the short must not be bigger than int and the long must not be smaller but they do not have to be shorter or longer as their name implies!. In addition you do not have to use two's complement notation either and so the maximum and minimum size may vary by +/- 1 between implementations.

The consequence of all this is that if you write a CFD program in a language like C/C++ without taking a great deal of care concerning this sort of low level nonsense it may well fail on a different platform or even the same platform with a compiler from a different supplier.


John C. Chien June 22, 2001 13:24

Re: on taylor's series and C++ arrays
 
(1). I am aware of that. But I just didn't want to cover the basic things here. (2). Your comment is always printed in C/C++ books, so , everyone should have learned that already. (3). Anyway, my answer is one correct answer, but it did not cover all the possibilities. Basically, "your int is likely to be different from my int". Thank you for the detailed information about these basic things.


All times are GMT -4. The time now is 00:24.