# A Question on Multi-Rectangular Grids

 Register Blogs Members List Search Today's Posts Mark Forums Read

 June 11, 2000, 04:02 A Question on Multi-Rectangular Grids #1 Bharanidharan Rajamani Guest   Posts: n/a Hi, I am confronted with a problem of writing a code for generating a multi-rectangular domain. The domain will have different number of maxima and minima in both x and y direction (which should be given at users discretion). I want to use the optimal resource of memeory by an effective programming technique, like say Dynamic Memeory Allocation (Not sure if this will work) so that the relevant grid points alone are stored and not all points in the rectangle encompassing the whole grid which in other words means that my grid file should not store data more than it needs to. Also if somebody can help me solve this problem, generally without the above-specified programming issues, it will be helpful. Thanks. Bharanidharan Rajamani.

 June 11, 2000, 11:48 Re: A Question on Multi-Rectangular Grids #2 John C. Chien Guest   Posts: n/a (1). In C++, you can use NEW to reserve memory space and get the pointer which pointed to the type of the variable reserved. You can assign this pointer to the declared pointer variable. (2). You can use the pointer to manipulate the values stored. When you are done with the variable, release the memory space by using the DELETE pointer. (3). For more information, read the C++ text books. (4). You can use NEW to reserve the memory space form the "free store" for interger, floating point variables, array, structure, class,..

 June 12, 2000, 18:58 Re: A Question on Multi-Rectangular Grids #3 Cfd Guest   Posts: n/a Hello Ram, Is the number of active cells going to be much smaller than the peak value of Imax*Jmax? Because otherwise, optimisation is pointless. If the answer is yes, one possibility is to save the logical indices (if needed) in a separate array, and just have the number of cells needed. For example, suppose you want to limit the grid to 100,000 cells totally, with peak values Imax=1000, Jmax=1000. Then define all your arrays to 100,000 eg U(100000), V(100000) etc, and an index array INDEX(100000) which can store the I and J [INDEX(ICELL)=(J-1)*1000+I]. It may also help to save the neighbours of each cell to avoid searches on I and J (eg. NORTH(ICELL) saves the J+1 neighbour of cell ICELL). This will cost you 4 additional arrays. The bright side of doing all this right: You are now ready to go to unstructured grids! Just ignore all the business about I and J, and simply use the neighbour lists.

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post niklas OpenFOAM 2 July 31, 2013 16:03 ben souissi Phoenics 1 August 4, 2005 18:02 S. Wang Main CFD Forum 3 March 2, 2001 14:44 K.L.Huang CD-adapco 1 March 29, 2000 04:57 Prabhu Main CFD Forum 5 October 20, 1999 19:43

All times are GMT -4. The time now is 23:58.