Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
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
Package registry
Model registry
Operate
Environments
Terraform modules
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
Tobias Leibner
dune-common
Commits
e0740379
Commit
e0740379
authored
21 years ago
by
Christian Engwer
Browse files
Options
Downloads
Patches
Plain Diff
extra methods for the randfiels stuff
[[Imported from SVN: r74]]
parent
3d8c427b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
grid/spgrid.hh
+18
-0
18 additions, 0 deletions
grid/spgrid.hh
with
18 additions
and
0 deletions
grid/spgrid.hh
+
18
−
0
View file @
e0740379
...
...
@@ -243,6 +243,7 @@ namespace Dune {
!
((
periodic_
[
d
]
==
false
)
&&
(
process
[
d
]
==
dim_
[
d
]
-
1
));
};
const
array
<
DIM
>
&
process
()
const
{
return
process_
;
}
int
process
(
int
dir
)
const
{
return
process_
[
dir
];
}
int
father_id
(
level
l
,
const
array
<
DIM
>
&
coord
)
const
;
int
coord_shift
(
level
,
int
d
)
const
;
//! return the step size on level l in direction d
...
...
@@ -251,6 +252,23 @@ namespace Dune {
bool
periodic
(
int
dir
)
const
{
return
periodic_
[
dir
];
}
//! inform about global arrangement of the processors
int
dim
(
int
dir
)
const
{
return
dim_
[
dir
];
}
//! map from global to local coords
bool
global_to_local
(
level
lvl
,
const
array
<
DIM
>
&
global
,
array
<
DIM
>
&
local
)
const
{
for
(
int
d
=
0
;
d
<
DIM
;
d
++
)
{
local
[
d
]
=
global
[
d
]
-
global_offset
(
lvl
,
d
)
+
front_overlap
(
lvl
,
d
);
if
(
local
[
d
]
<
0
)
return
false
;
if
(
local
[
d
]
>=
front_overlap
(
lvl
,
d
)
+
size
(
lvl
,
d
)
+
end_overlap
(
lvl
,
d
))
return
false
;
}
return
true
;
}
int
global_offset
(
level
lvl
,
int
d
)
const
{
return
process
(
d
)
*
(
globalsize
(
lvl
,
d
)
/
dim
(
d
));
}
};
/* end spgrid */
////////////////////////////////////////////////////////////////////////////
...
...
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