Representing structures for simulations
- From: "justabeginner" <nom_de_plume79@xxxxxxxxxxx>
- Date: 24 Apr 2005 00:43:08 -0700
Hello. I am planning on programming my own small smooth particle
hydrodynamics code. I have no prior experience with programming such
code, or even other meshed methods. This SPH code will be interfaced
with another program I have written to study hypervelocity impact.
I guess the main question I have at the moment is how I should
represent structures in my code. How is it normally approached, in both
meshless and mesh-free methods?
For example, say you have a 2D plate of material. I could discretise
space and represent the plate in a 2D memory array. The size of my
array would be proportional to the size of the plate, or the level of
discretisation. This method would be a memory hog for large structures
or fine resolutions, but it would be faster (assuming the structure can
be stored in RAM) because you immediately know which elements/particles
are adjacent to one another. You don't need to run adjacency checks to
determine which sections affect which - you can tell just by the array
co-ordinates.
Alternatively, I could store element/particle information in memory in
a manner unrelated to their spatial positions (like representing a 3D
structure in a very long 1D array). Spatial co-ordinates are stored as
entries in the array. This means that I will need to do adjacency
checks, which is CPU intensive.
Suppose you had to represent a cube of material (so no voids). The
amount of information you must store is the same, regardless of which
storage scheme you choose. Therefore the best scheme is to store it in
a 3D array, since you'd be using the same memory (theoretically) in
either case, but losing on CPU costs for the 1D array scheme. However,
if the material has lots of voids, then the best option may be the long
1D array, because it doesn't allocate memory to wastefully defining
voids.
Are there alternative means of storing structures in memory I have not
thought about? What thoughts do you guys have?
Thanks.
.
- Follow-Ups:
- Re: Representing structures for simulations
- From: Brooks Moses
- Re: Representing structures for simulations
- From: Jon Harrop
- Re: Representing structures for simulations
- Prev by Date: Re: Detect EOF for direct access, unformatted files?
- Next by Date: Re: Detect EOF for direct access, unformatted files?
- Previous by thread: Multidimensional integration of complex vector functions over real intervals
- Next by thread: Re: Representing structures for simulations
- Index(es):
Relevant Pages
|