Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TurTLE
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TurTLE
TurTLE
Commits
7e3ebdc1
Commit
7e3ebdc1
authored
9 years ago
by
Cristian Lalescu
Browse files
Options
Downloads
Patches
Plain Diff
particle code compiles, but not finished
parent
a3dc03cd
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
makefile
+2
-1
2 additions, 1 deletion
makefile
src/base.hpp
+5
-0
5 additions, 0 deletions
src/base.hpp
src/slab_field_particles.hpp
+21
-2
21 additions, 2 deletions
src/slab_field_particles.hpp
with
28 additions
and
3 deletions
makefile
+
2
−
1
View file @
7e3ebdc1
...
...
@@ -63,7 +63,8 @@ base_files := \
p3DFFT_to_iR
\
vector_field
\
fluid_solver_base
\
fluid_solver
fluid_solver
\
slab_field_particles
#headers := $(patsubst %, ./src/%.hpp, ${base_files})
src
:=
$(
patsubst %, ./src/%.cpp,
${
base_files
})
...
...
This diff is collapsed.
Click to expand it.
src/base.hpp
+
5
−
0
View file @
7e3ebdc1
...
...
@@ -31,6 +31,11 @@ static const int message_buffer_length = 1024;
static
char
debug_message_buffer
[
message_buffer_length
];
extern
int
myrank
,
nprocs
;
int
MOD
(
int
a
,
int
n
)
{
return
((
a
%
n
)
+
n
)
%
n
;
}
#ifndef NDEBUG
inline
void
DEBUG_MSG
(
const
char
*
format
,
...)
...
...
This diff is collapsed.
Click to expand it.
src/slab_field_particles.hpp
+
21
−
2
View file @
7e3ebdc1
...
...
@@ -18,6 +18,8 @@
*
************************************************************************/
#include
<stdio.h>
#include
<stdlib.h>
#include
<iostream>
...
...
@@ -35,7 +37,6 @@ class slab_field_particles
{
public:
fluid_solver_base
<
rnumber
>
*
fs
;
int
nparticles
;
/* is_active is a matrix of shape [nprocs][nparticles], with
* is_active[r][p] being true if particle p is in the domain
...
...
@@ -48,11 +49,17 @@ class slab_field_particles
* a general ncomponents is better, since we may change our minds.
* */
double
*
state
;
int
nparticles
;
int
ncomponents
;
int
array_size
;
int
buffer_size
;
double
*
lbound
;
double
*
ubound
;
/* simulation parameters */
char
name
[
256
];
int
iteration
;
double
dt
;
/* physical parameters of field */
rnumber
dx
,
dy
,
dz
;
...
...
@@ -60,8 +67,20 @@ class slab_field_particles
/* methods */
slab_field_particles
(
const
char
*
NAME
,
fluid_solver_base
<
rnumber
>
*
FSOLVER
);
fluid_solver_base
<
rnumber
>
*
FSOLVER
,
const
int
NPARTICLES
,
const
int
NCOMPONENTS
,
const
int
BUFFERSIZE
);
~
slab_field_particles
();
/* an Euler step is needed to compute an estimate of future positions,
* which is needed for synchronization.
* function is virtual since we want children to do different things,
* depending on the type of particle. this particular function just
* copies the old state into the new state.
* */
virtual
void
jump_estimate
(
double
*
jump_length
);
void
synchronize
();
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment