Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
iwr
amdis
Commits
ea26c5eb
Commit
ea26c5eb
authored
Jan 22, 2019
by
Praetorius, Simon
Browse files
correct parallel evalAtPoint functions if point is found on multiple partitions
parent
8aa43b17
Changes
1
Hide whitespace changes
Inline
Side-by-side
AMDiS/src/DOFVector.hh
View file @
ea26c5eb
...
@@ -124,10 +124,10 @@ namespace AMDiS {
...
@@ -124,10 +124,10 @@ namespace AMDiS {
{
{
this
->
name
=
n
;
this
->
name
=
n
;
this
->
feSpace
=
f
;
this
->
feSpace
=
f
;
if
(
this
->
feSpace
&&
this
->
feSpace
->
getAdmin
())
if
(
this
->
feSpace
&&
this
->
feSpace
->
getAdmin
())
(
this
->
feSpace
->
getAdmin
())
->
addDOFIndexed
(
this
);
(
this
->
feSpace
->
getAdmin
())
->
addDOFIndexed
(
this
);
this
->
boundaryManager
=
new
BoundaryManager
(
f
);
this
->
boundaryManager
=
new
BoundaryManager
(
f
);
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
if
(
addToSynch
&&
Parallel
::
MeshDistributor
::
globalMeshDistributor
!=
NULL
)
if
(
addToSynch
&&
Parallel
::
MeshDistributor
::
globalMeshDistributor
!=
NULL
)
...
@@ -142,7 +142,7 @@ namespace AMDiS {
...
@@ -142,7 +142,7 @@ namespace AMDiS {
if
(
Parallel
::
MeshDistributor
::
globalMeshDistributor
!=
NULL
)
if
(
Parallel
::
MeshDistributor
::
globalMeshDistributor
!=
NULL
)
Parallel
::
MeshDistributor
::
globalMeshDistributor
->
removeInterchangeVector
(
this
);
Parallel
::
MeshDistributor
::
globalMeshDistributor
->
removeInterchangeVector
(
this
);
#endif
#endif
#ifdef _OPENMP
#ifdef _OPENMP
#pragma omp critical
#pragma omp critical
#endif
#endif
...
@@ -1090,7 +1090,7 @@ namespace AMDiS {
...
@@ -1090,7 +1090,7 @@ namespace AMDiS {
ElInfo
*
elInfo
=
mesh
->
createNewElInfo
();
ElInfo
*
elInfo
=
mesh
->
createNewElInfo
();
double
value
=
0.0
;
double
value
=
0.0
;
bool
inside
=
false
;
unsigned
short
inside
=
0
;
if
(
oldElInfo
&&
oldElInfo
->
getMacroElement
())
{
if
(
oldElInfo
&&
oldElInfo
->
getMacroElement
())
{
inside
=
mesh
->
findElInfoAtPoint
(
p
,
elInfo
,
lambda
,
oldElInfo
->
getMacroElement
(),
NULL
,
NULL
);
inside
=
mesh
->
findElInfoAtPoint
(
p
,
elInfo
,
lambda
,
oldElInfo
->
getMacroElement
(),
NULL
,
NULL
);
...
@@ -1101,28 +1101,24 @@ namespace AMDiS {
...
@@ -1101,28 +1101,24 @@ namespace AMDiS {
if
(
oldElInfo
)
if
(
oldElInfo
)
oldElInfo
=
elInfo
;
oldElInfo
=
elInfo
;
if
(
inside
)
{
if
(
inside
>
0
)
{
basFcts
->
getLocalIndices
(
elInfo
->
getElement
(),
this
->
feSpace
->
getAdmin
(),
localIndices
);
basFcts
->
getLocalIndices
(
elInfo
->
getElement
(),
this
->
feSpace
->
getAdmin
(),
localIndices
);
ElementVector
uh
(
nBasFcts
);
ElementVector
uh
(
nBasFcts
);
for
(
int
i
=
0
;
i
<
nBasFcts
;
i
++
)
for
(
int
i
=
0
;
i
<
nBasFcts
;
i
++
)
uh
[
i
]
=
operator
[](
localIndices
[
i
]);
uh
[
i
]
=
operator
[](
localIndices
[
i
]);
value
=
basFcts
->
evalUh
(
lambda
,
uh
);
value
=
basFcts
->
evalUh
(
lambda
,
uh
);
}
else
{
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
value
=
0.0
;
#else
ERROR_EXIT
(
"Can not eval DOFVector at point p, because point is outside geometry."
);
#endif
}
}
if
(
oldElInfo
==
NULL
)
if
(
oldElInfo
==
NULL
)
delete
elInfo
;
delete
elInfo
;
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
Parallel
::
mpi
::
globalAdd
(
value
);
Parallel
::
mpi
::
globalAdd
(
value
);
Parallel
::
mpi
::
globalAdd
(
inside
);
#endif
#endif
return
value
;
TEST_EXIT
(
inside
>
0
)(
"Can not eval DOFVector at point p, because point is outside geometry."
);
return
value
/
inside
;
}
}
...
@@ -1140,7 +1136,7 @@ namespace AMDiS {
...
@@ -1140,7 +1136,7 @@ namespace AMDiS {
DimVec
<
double
>
lambda
(
dim
,
NO_INIT
);
DimVec
<
double
>
lambda
(
dim
,
NO_INIT
);
ElInfo
*
elInfo
=
mesh
->
createNewElInfo
();
ElInfo
*
elInfo
=
mesh
->
createNewElInfo
();
WorldVector
<
double
>
value
(
DEFAULT_VALUE
,
0.0
);
WorldVector
<
double
>
value
(
DEFAULT_VALUE
,
0.0
);
bool
inside
=
false
;
unsigned
short
inside
=
0
;
if
(
oldElInfo
&&
oldElInfo
->
getMacroElement
())
{
if
(
oldElInfo
&&
oldElInfo
->
getMacroElement
())
{
inside
=
mesh
->
findElInfoAtPoint
(
p
,
elInfo
,
lambda
,
oldElInfo
->
getMacroElement
(),
NULL
,
NULL
);
inside
=
mesh
->
findElInfoAtPoint
(
p
,
elInfo
,
lambda
,
oldElInfo
->
getMacroElement
(),
NULL
,
NULL
);
...
@@ -1151,19 +1147,24 @@ namespace AMDiS {
...
@@ -1151,19 +1147,24 @@ namespace AMDiS {
if
(
oldElInfo
)
if
(
oldElInfo
)
oldElInfo
=
elInfo
;
oldElInfo
=
elInfo
;
if
(
inside
)
{
if
(
inside
>
0
)
{
basFcts
->
getLocalIndices
(
elInfo
->
getElement
(),
this
->
feSpace
->
getAdmin
(),
localIndices
);
basFcts
->
getLocalIndices
(
elInfo
->
getElement
(),
this
->
feSpace
->
getAdmin
(),
localIndices
);
mtl
::
dense_vector
<
WorldVector
<
double
>
>
uh
(
nBasFcts
);
mtl
::
dense_vector
<
WorldVector
<
double
>
>
uh
(
nBasFcts
);
for
(
int
i
=
0
;
i
<
nBasFcts
;
i
++
)
for
(
int
i
=
0
;
i
<
nBasFcts
;
i
++
)
uh
[
i
]
=
operator
[](
localIndices
[
i
]);
uh
[
i
]
=
operator
[](
localIndices
[
i
]);
value
=
basFcts
->
evalUh
(
lambda
,
uh
);
value
=
basFcts
->
evalUh
(
lambda
,
uh
);
}
else
{
ERROR_EXIT
(
"Can not eval DOFVector at point p, because point is outside geometry."
);
}
}
if
(
oldElInfo
==
NULL
)
if
(
oldElInfo
==
NULL
)
delete
elInfo
;
delete
elInfo
;
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
Parallel
::
mpi
::
globalAdd
(
value
);
Parallel
::
mpi
::
globalAdd
(
inside
);
#endif
TEST_EXIT
(
inside
>
0
)(
"Can not eval DOFVector at point p, because point is outside geometry."
);
value
*=
1.0
/
inside
;
return
value
;
return
value
;
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment