CFD Online URL
[Sponsors]
Home > Forums > Main CFD Forum

data structure question

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

Reply
 
LinkBack Thread Tools Display Modes
Old   August 25, 2010, 18:58
Default data structure question
  #1
New Member
 
Join Date: Jun 2009
Posts: 27
Rep Power: 7
dshawul is on a distinguished road
Hi
After writing a SIMPLE solver on unstructured collocated grid, I realized I made a bad design decision. The vertices, facets and cell lists are interlinked with pointers, and all the data for a cell is at one place. That means I have u,v,w and other scalar terms like T (temperature or whatever) for a cell at the same place. That is what good c++ code should do ,but now I suspect that it is better to have a field for each variable separately (like u[100],v[100] etc..) so that different operations can be done separately. When the scalar transport equation is solved for u, we don't need T for example, good for cache I suppose..
Before I go on doing that I want to know which method is being used by fastest cfd solvers.
I have the following
Code:
struct Field {
    union {
        struct {
            Vector U;
            Scalar p;
            Scalar T;
            Scalar pp;
        };
        Scalar f[6];
    };
};
and am going to change it in to the following for 100 cells
Code:
Vector U[100];
Scalar T[100];
...
thanks in advance
P.S : Is there a programming sub-forum where this kind of posts belong ?
dshawul is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
export data at nodes Meenu FLUENT 1 December 30, 2011 02:24
XYZ (ASCII format) data points into GAMBIT Neil FLUENT 1 August 7, 2007 10:24
Data structure handling in multiblock approach CH Main CFD Forum 3 October 5, 2006 19:51
Saving particle (DPM) data to file? Philip FLUENT 2 June 12, 2006 02:41
MESH DATA QUESTION Sandeep Patel FLUENT 0 August 6, 2001 17:59


All times are GMT -4. The time now is 06:16.