Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
SWIFT
SWIFTsim
Commits
36701c0e
Commit
36701c0e
authored
8 years ago
by
Bert Vandenbroucke
Browse files
Options
Downloads
Patches
Plain Diff
Forgot to add new files.
parent
7e4f1880
No related branches found
No related tags found
1 merge request
!321
1D and 2D moving mesh algorithm
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/hydro_space.c
+52
-0
52 additions, 0 deletions
src/hydro_space.c
src/hydro_space.h
+43
-0
43 additions, 0 deletions
src/hydro_space.h
with
95 additions
and
0 deletions
src/hydro_space.c
0 → 100644
+
52
−
0
View file @
36701c0e
/*******************************************************************************
* This file is part of SWIFT.
* Copyright (c) 2017 Bert Vandenbroucke (bert.vandenbroucke@gmail.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#include
"hydro_space.h"
#include
"space.h"
/**
* @brief Initialize the extra space information needed for some hydro schemes.
*
* @param hs #hydro_space to initialize.
* @param s #space containing the hydro space.
*/
#ifdef SHADOWFAX_SPH
__attribute__
((
always_inline
))
INLINE
void
hydro_space_init
(
struct
hydro_space
*
hs
,
const
struct
space
*
s
)
{
if
(
s
->
periodic
)
{
hs
->
anchor
[
0
]
=
-
0
.
5
f
*
s
->
dim
[
0
];
hs
->
anchor
[
1
]
=
-
0
.
5
f
*
s
->
dim
[
1
];
hs
->
anchor
[
2
]
=
-
0
.
5
f
*
s
->
dim
[
2
];
hs
->
side
[
0
]
=
2
.
0
f
*
s
->
dim
[
0
];
hs
->
side
[
1
]
=
2
.
0
f
*
s
->
dim
[
1
];
hs
->
side
[
2
]
=
2
.
0
f
*
s
->
dim
[
2
];
}
else
{
hs
->
anchor
[
0
]
=
0
.
0
f
;
hs
->
anchor
[
1
]
=
0
.
0
f
;
hs
->
anchor
[
2
]
=
0
.
0
f
;
hs
->
side
[
0
]
=
s
->
dim
[
0
];
hs
->
side
[
1
]
=
s
->
dim
[
1
];
hs
->
side
[
2
]
=
s
->
dim
[
2
];
}
}
#else
__attribute__
((
always_inline
))
INLINE
void
hydro_space_init
(
struct
hydro_space
*
hs
,
const
struct
space
*
s
)
{}
#endif
This diff is collapsed.
Click to expand it.
src/hydro_space.h
0 → 100644
+
43
−
0
View file @
36701c0e
/*******************************************************************************
* This file is part of SWIFT.
* Copyright (c) 2017 Bert Vandenbroucke (bert.vandenbroucke@gmail.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#ifndef SWIFT_HYDRO_SPACE_H
#define SWIFT_HYDRO_SPACE_H
#include
"../config.h"
struct
space
;
/**
* @brief Extra space information that is needed for some hydro schemes.
*/
#ifdef SHADOWFAX_SPH
struct
hydro_space
{
/*! Anchor of the simulation space. */
double
anchor
[
3
];
/*! Side lengths of the simulation space. */
double
side
[
3
];
};
#else
struct
hydro_space
{};
#endif
void
hydro_space_init
(
struct
hydro_space
*
hs
,
const
struct
space
*
s
);
#endif
/* SWIFT_HYDRO_SPACE_H */
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