CFD Online Logo CFD Online URL
Home > Forums > Main CFD Forum

data structure question

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

LinkBack Thread Tools Display Modes
Old   August 25, 2010, 17:58
Default data structure question
New Member
Join Date: Jun 2009
Posts: 27
Rep Power: 10
dshawul is on a distinguished road
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
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
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


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 09:24
Data structure handling in multiblock approach CH Main CFD Forum 3 October 5, 2006 18:51
Saving particle (DPM) data to file? Philip FLUENT 2 June 12, 2006 01:41
MESH DATA QUESTION Sandeep Patel FLUENT 0 August 6, 2001 16:59

All times are GMT -4. The time now is 14:43.