Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Backofen, Rainer
amdis
Commits
041231a5
Commit
041231a5
authored
Nov 28, 2013
by
Praetorius, Simon
Browse files
refine operationen added to DOFVector
parent
99fdbce7
Changes
6
Hide whitespace changes
Inline
Side-by-side
AMDiS/src/DOFVector.cc
View file @
041231a5
...
...
@@ -55,13 +55,24 @@ namespace AMDiS {
template
<
>
void
DOFVector
<
double
>::
refineInterpol
(
RCNeighbourList
&
list
,
int
n
)
{
(
const_cast
<
BasisFunction
*>
(
feSpace
->
getBasisFcts
()))
->
refineInter
(
this
,
&
list
,
n
);
switch
(
refineOperation
)
{
case
NO_OPERATION
:
return
;
break
;
case
REFINE_INTERPOL
:
default:
(
const_cast
<
BasisFunction
*>
(
feSpace
->
getBasisFcts
()))
->
refineInter
(
this
,
&
list
,
n
);
break
;
}
}
template
<
>
void
DOFVector
<
WorldVector
<
double
>
>::
refineInterpol
(
RCNeighbourList
&
list
,
int
n
)
{
if
(
refineOperation
==
NO_OPERATION
)
return
;
if
(
n
<
1
)
return
;
...
...
AMDiS/src/DOFVector.h
View file @
041231a5
...
...
@@ -276,8 +276,9 @@ namespace AMDiS {
typedef
enum
{
NO_OPERATION
=
0
,
COARSE_RESTRICT
=
1
,
COARSE_INTERPOL
=
2
}
CoarsenOperation
;
COARSE_INTERPOL
=
2
,
REFINE_INTERPOL
=
4
}
RefineCoarsenOperation
;
/** \ingroup DOFAdministration
...
...
@@ -386,17 +387,29 @@ namespace AMDiS {
std
::
vector
<
DegreeOfFreedom
>
&
newDof
);
/// Sets \ref coarsenOperation to op
inline
void
setCoarsenOperation
(
CoarsenOperation
op
)
inline
void
setCoarsenOperation
(
Refine
CoarsenOperation
op
)
{
coarsenOperation
=
op
;
}
/// Returns \ref coarsenOperation
inline
CoarsenOperation
getCoarsenOperation
()
inline
Refine
CoarsenOperation
getCoarsenOperation
()
{
return
coarsenOperation
;
}
/// Sets \ref refineOperation to op
inline
void
setRefineOperation
(
RefineCoarsenOperation
op
)
{
refineOperation
=
op
;
}
/// Returns \ref refineOperation
inline
RefineCoarsenOperation
getRefineOperation
()
{
return
refineOperation
;
}
/// Restriction after coarsening. Implemented for DOFVector<double>
inline
void
coarseRestrict
(
RCNeighbourList
&
,
int
)
{}
...
...
@@ -633,7 +646,8 @@ namespace AMDiS {
std
::
vector
<
T
>
vec
;
/// Specifies what operation should be performed after coarsening
CoarsenOperation
coarsenOperation
;
RefineCoarsenOperation
coarsenOperation
;
RefineCoarsenOperation
refineOperation
;
};
...
...
AMDiS/src/DOFVector.hh
View file @
041231a5
...
...
@@ -112,7 +112,8 @@ namespace AMDiS {
template
<
typename
T
>
DOFVector
<
T
>::
DOFVector
(
const
FiniteElemSpace
*
f
,
std
::
string
n
)
:
DOFVectorBase
<
T
>
(
f
,
n
),
coarsenOperation
(
COARSE_INTERPOL
)
coarsenOperation
(
COARSE_INTERPOL
),
refineOperation
(
REFINE_INTERPOL
)
{
vec
.
resize
(
0
);
init
(
f
,
n
);
...
...
@@ -1029,6 +1030,7 @@ namespace AMDiS {
vec
=
rhs
.
vec
;
this
->
elementVector
.
change_dim
(
this
->
nBasFcts
);
coarsenOperation
=
rhs
.
coarsenOperation
;
refineOperation
=
rhs
.
refineOperation
;
this
->
operators
=
rhs
.
operators
;
this
->
operatorFactor
=
rhs
.
operatorFactor
;
...
...
AMDiS/src/Mesh.cc
View file @
041231a5
...
...
@@ -1338,7 +1338,7 @@ namespace AMDiS {
}
// === Check if number of pre refinements is set in
i
init file. ===
// === Check if number of pre refinements is set in init file. ===
int
tmp
=
-
1
;
Parameters
::
get
(
"parallel->pre refine"
,
tmp
);
...
...
@@ -1426,10 +1426,7 @@ namespace AMDiS {
else
globalRefinements
-=
nParallelPreRefinements
;
stringstream
oss
;
oss
<<
globalRefinements
;
string
tmpStr
=
oss
.
str
();
Parameters
::
add
(
name
+
"->global refinements"
,
tmpStr
);
Parameters
::
set
(
name
+
"->global refinements"
,
globalRefinements
);
// === Print a note to the screen that another mesh file will be used. ===
...
...
AMDiS/src/SystemVector.h
View file @
041231a5
...
...
@@ -166,12 +166,18 @@ namespace AMDiS {
vectors
[
i
]
->
set
(
value
);
}
inline
void
setCoarsenOperation
(
CoarsenOperation
op
)
inline
void
setCoarsenOperation
(
Refine
CoarsenOperation
op
)
{
for
(
int
i
=
0
;
i
<
static_cast
<
int
>
(
vectors
.
size
());
i
++
)
vectors
[
i
]
->
setCoarsenOperation
(
op
);
}
inline
void
setRefineOperation
(
RefineCoarsenOperation
op
)
{
for
(
int
i
=
0
;
i
<
static_cast
<
int
>
(
vectors
.
size
());
i
++
)
vectors
[
i
]
->
setRefineOperation
(
op
);
}
/// Sets all entries in all vectors to value.
inline
SystemVector
&
operator
=
(
double
value
)
{
...
...
AMDiS/src/parallel/MeshDistributor.cc
View file @
041231a5
...
...
@@ -143,6 +143,9 @@ namespace AMDiS { namespace Parallel {
if
(
partStr
==
"simple"
)
partitioner
=
new
SimplePartitioner
(
"parallel->partitioner"
,
&
mpiComm
);
if
(
!
partitioner
)
{
ERROR_EXIT
(
"Unknown partitioner or no partitioner specified!
\n
"
);
}
// === Create initial partitioner object. ===
...
...
@@ -363,8 +366,38 @@ namespace AMDiS { namespace Parallel {
Parameters
::
get
(
mesh
->
getName
()
+
"->global refinements"
,
globalRefinement
);
if
(
globalRefinement
>
0
)
{
bool
doRefineInter
=
true
;
Parameters
::
get
(
mesh
->
getName
()
+
"->refinement interpol"
,
doRefineInter
);
std
::
map
<
DOFVector
<
double
>*
,
RefineCoarsenOperation
>
rememberOp
;
if
(
!
doRefineInter
)
{
// no refinement during initial global refinement
for
(
int
iadmin
=
0
;
iadmin
<
mesh
->
getNumberOfDOFAdmin
();
iadmin
++
)
{
std
::
list
<
DOFIndexedBase
*>::
iterator
it
;
DOFAdmin
*
admin
=
const_cast
<
DOFAdmin
*>
(
&
mesh
->
getDofAdmin
(
iadmin
));
std
::
list
<
DOFIndexedBase
*>::
iterator
end
=
admin
->
endDOFIndexed
();
for
(
it
=
admin
->
beginDOFIndexed
();
it
!=
end
;
it
++
)
{
DOFVector
<
double
>*
vec
=
dynamic_cast
<
DOFVector
<
double
>*>
(
*
it
);
if
(
vec
)
{
rememberOp
[
vec
]
=
vec
->
getRefineOperation
();
vec
->
setRefineOperation
(
NO_OPERATION
);
}
}
}
}
refineManager
->
globalRefine
(
mesh
,
globalRefinement
);
if
(
!
doRefineInter
)
{
// no refinement during initial global refinement
for
(
int
iadmin
=
0
;
iadmin
<
mesh
->
getNumberOfDOFAdmin
();
iadmin
++
)
{
std
::
list
<
DOFIndexedBase
*>::
iterator
it
;
DOFAdmin
*
admin
=
const_cast
<
DOFAdmin
*>
(
&
mesh
->
getDofAdmin
(
iadmin
));
std
::
list
<
DOFIndexedBase
*>::
iterator
end
=
admin
->
endDOFIndexed
();
for
(
it
=
admin
->
beginDOFIndexed
();
it
!=
end
;
it
++
)
{
DOFVector
<
double
>*
vec
=
dynamic_cast
<
DOFVector
<
double
>*>
(
*
it
);
if
(
vec
)
vec
->
setRefineOperation
(
rememberOp
[
vec
]);
}
}
}
updateLocalGlobalNumbering
();
#if (DEBUG != 0)
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment