|
[Sponsors] |
August 25, 2010, 17:58 |
data structure question
|
#1 |
New Member
Join Date: Jun 2009
Posts: 27
Rep Power: 16 |
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]; }; }; Code:
Vector U[100]; Scalar T[100]; ... P.S : Is there a programming sub-forum where this kind of posts belong ? |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
export data at nodes | Meenu | FLUENT | 1 | December 30, 2011 01: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 |