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
bb580238
Commit
bb580238
authored
Apr 18, 2008
by
Thomas Witkowski
Browse files
* Output support for higher order Lagrange Elements
parent
a12fef07
Changes
11
Show whitespace changes
Inline
Side-by-side
AMDiS/src/DataCollector.cc
View file @
bb580238
...
...
@@ -116,6 +116,7 @@ namespace AMDiS {
elInfo
=
stack
.
traverseNext
(
elInfo
);
}
// Remove all interpolation marks and, instead, set to each
// interpolation point its continous index starting from 0.
int
i
=
0
;
...
...
@@ -126,7 +127,8 @@ namespace AMDiS {
}
// Traverse elements to create interpolation values.
elInfo
=
stack
.
traverseFirst
(
mesh_
,
level_
,
traverseFlag_
);
counter
=
0
;
elInfo
=
stack
.
traverseFirst
(
mesh_
,
level_
,
traverseFlag_
|
Mesh
::
FILL_COORDS
);
while
(
elInfo
)
{
if
(
!
writeElem_
||
writeElem_
(
elInfo
))
addInterpData
(
elInfo
);
...
...
@@ -268,71 +270,52 @@ namespace AMDiS {
{
FUNCNAME
(
"DataCollector::addValueData()"
);
const
DegreeOfFreedom
**
dof
=
elInfo
->
getElement
()
->
getDOF
();
const
BasisFunction
*
basisFcts
=
feSpace_
->
getBasisFcts
();
const
DegreeOfFreedom
*
localDOFs
=
basisFcts
->
getLocalIndices
(
elInfo
->
getElement
(),
localAdmin_
,
NULL
);
const
int
nBasisFcts
=
basisFcts
->
getNumber
();
/* vertex dofs */
int
dof_offset
=
localAdmin_
->
getNumberOfPreDOFs
(
VERTEX
);
for
(
int
i
=
0
;
i
<
mesh_
->
getGeo
(
VERTEX
);
i
++
)
{
(
*
interpPointInd_
)[
dof
[
i
][
dof_offset
]]
=
-
2
;
// mark as vertex
(
*
interpPointInd_
)[
localDOFs
[
i
]]
=
-
2
;
// mark as vertex
// get coords of this vertex
WorldVector
<
double
>
vertexCoords
=
elInfo
->
getCoord
(
i
);
// search for coords at this dof
::
std
::
list
<
WorldVector
<
double
>
>::
iterator
it
=
find
((
*
dofCoords_
)[
dof
[
i
][
dof_offset
]].
begin
(),
(
*
dofCoords_
)[
dof
[
i
][
dof_offset
]].
end
(),
find
((
*
dofCoords_
)[
localDOFs
[
i
]].
begin
(),
(
*
dofCoords_
)[
localDOFs
[
i
]].
end
(),
vertexCoords
);
// coords not yet in list?
if
(
it
==
(
*
dofCoords_
)[
dof
[
i
][
dof_offset
]].
end
())
{
if
(
it
==
(
*
dofCoords_
)[
localDOFs
[
i
]].
end
())
{
// add new coords to list
(
*
dofCoords_
)[
dof
[
i
][
dof_offset
]].
push_back
(
vertexCoords
);
(
*
dofCoords_
)[
localDOFs
[
i
]].
push_back
(
vertexCoords
);
}
}
int
nInterpPoints
=
0
;
const
BasisFunction
*
basisFcts
=
feSpace_
->
getBasisFcts
();
for
(
int
i
=
1
;
i
<=
dim_
;
i
++
)
{
int
num_dofs
=
localAdmin_
->
getNumberOfDOFs
(
INDEX_OF_DIM
(
i
,
dim_
));
int
node_offset
=
mesh_
->
getNode
(
INDEX_OF_DIM
(
i
,
dim_
));
dof_offset
=
localAdmin_
->
getNumberOfPreDOFs
(
INDEX_OF_DIM
(
i
,
dim_
));
for
(
int
j
=
0
;
j
<
mesh_
->
getGeo
(
INDEX_OF_DIM
(
i
,
dim_
));
j
++
)
{
int
node
=
node_offset
+
j
;
for
(
int
k
=
0
;
k
<
num_dofs
;
k
++
)
{
int
dof_index
=
dof_offset
+
k
;
for
(
int
i
=
mesh_
->
getGeo
(
VERTEX
);
i
<
nBasisFcts
;
i
++
)
{
WorldVector
<
double
>
interpolCoords
;
elInfo
->
coordToWorld
((
*
basisFcts
->
getCoords
(
mesh_
->
getGeo
(
VERTEX
)
+
nInterpPoints
)),
&
interpolCoords
);
elInfo
->
coordToWorld
(
*
basisFcts
->
getCoords
(
i
),
&
interpolCoords
);
nInterpPoints
++
;
if
((
*
interpPointInd_
)[
dof
[
node
][
dof_index
]]
==
-
1
)
{
if
((
*
interpPointInd_
)[
localDOFs
[
i
]]
==
-
1
)
{
// mark as interpolation point
(
*
interpPointInd_
)[
dof
[
node
][
dof_index
]]
=
-
3
;
(
*
interpPointInd_
)[
localDOFs
[
i
]]
=
-
3
;
// search for interpolation point coordinates, and insert them to the
// dof-entry, if not contained in the list
::
std
::
list
<
WorldVector
<
double
>
>::
iterator
it
=
find
((
*
interpPointCoords_
)[
dof
[
node
][
dof_index
]].
begin
(),
(
*
interpPointCoords_
)[
dof
[
node
][
dof_index
]].
end
(),
find
((
*
interpPointCoords_
)[
localDOFs
[
i
]].
begin
(),
(
*
interpPointCoords_
)[
localDOFs
[
i
]].
end
(),
interpolCoords
);
if
(
it
==
(
*
interpPointCoords_
)[
dof
[
node
][
dof_index
]].
end
())
{
(
*
interpPointCoords_
)[
dof
[
node
][
dof_index
]].
push_back
(
interpolCoords
);
}
if
(
it
==
(
*
interpPointCoords_
)[
localDOFs
[
i
]].
end
())
{
(
*
interpPointCoords_
)[
localDOFs
[
i
]].
push_back
(
interpolCoords
);
nInterpPoints_
++
;
}
}
}
}
return
(
0
);
}
...
...
@@ -341,25 +324,15 @@ namespace AMDiS {
{
FUNCNAME
(
"DataCollector::addInterpData()"
);
const
DegreeOfFreedom
**
dof
=
elInfo
->
getElement
()
->
getDOF
();
::
std
::
vector
<
int
>
elemInterpPoints
;
elemInterpPoints
.
clear
();
for
(
int
i
=
1
;
i
<=
dim_
;
i
++
)
{
int
num_dofs
=
localAdmin_
->
getNumberOfDOFs
(
INDEX_OF_DIM
(
i
,
dim_
));
int
node_offset
=
mesh_
->
getNode
(
INDEX_OF_DIM
(
i
,
dim_
));
int
dof_offset
=
localAdmin_
->
getNumberOfPreDOFs
(
INDEX_OF_DIM
(
i
,
dim_
));
for
(
int
j
=
0
;
j
<
mesh_
->
getGeo
(
INDEX_OF_DIM
(
i
,
dim_
));
j
++
)
{
int
node
=
node_offset
+
j
;
for
(
int
k
=
0
;
k
<
num_dofs
;
k
++
)
{
int
dof_index
=
dof_offset
+
k
;
const
BasisFunction
*
basisFcts
=
feSpace_
->
getBasisFcts
();
const
DegreeOfFreedom
*
localDOFs
=
basisFcts
->
getLocalIndices
(
elInfo
->
getElement
(),
localAdmin_
,
NULL
);
const
int
nBasisFcts
=
basisFcts
->
getNumber
();
elemInterpPoints
.
push_back
((
*
interpPointInd_
)[
dof
[
node
][
dof_index
]]);
}
}
for
(
int
i
=
mesh_
->
getGeo
(
VERTEX
);
i
<
nBasisFcts
;
i
++
)
{
elemInterpPoints
.
push_back
((
*
interpPointInd_
)[
localDOFs
[
i
]]);
}
interpPoints_
.
push_back
(
elemInterpPoints
);
...
...
AMDiS/src/DataCollector.h
View file @
bb580238
...
...
@@ -294,6 +294,8 @@ namespace AMDiS {
* Pointer to a function which decides whether an element is considered.
*/
bool
(
*
writeElem_
)(
ElInfo
*
);
int
counter
;
};
}
...
...
AMDiS/src/Element.cc
View file @
bb580238
...
...
@@ -12,8 +12,11 @@ namespace AMDiS {
{
ElementRegion_ED
*
red_
;
if
(
!
elementData
)
return
-
1
;
red_
=
dynamic_cast
<
ElementRegion_ED
*>
(
elementData
->
getElementData
(
ELEMENT_REGION
));
if
(
!
elementData
)
return
-
1
;
red_
=
dynamic_cast
<
ElementRegion_ED
*>
(
elementData
->
getElementData
(
ELEMENT_REGION
));
if
(
red_
)
return
red_
->
getRegion
();
...
...
@@ -22,8 +25,9 @@ namespace AMDiS {
void
Element
::
setDOFPtrs
()
{
FUNCNAME
(
"Element::setDOFPtrs"
);
FUNCNAME
(
"Element::setDOFPtrs
()
"
);
TEST_EXIT
(
mesh
)(
"no mesh!
\n
"
);
dof
=
mesh
->
createDOFPtrs
();
}
...
...
@@ -36,22 +40,25 @@ namespace AMDiS {
child
[
0
]
=
NULL
;
child
[
1
]
=
NULL
;
dof
=
mesh
?
mesh
->
createDOFPtrs
()
:
NULL
;
newCoord
=
NULL
;
elementData
=
NULL
;
if
(
mesh
)
{
setDOFPtrs
();
}
else
{
mesh
=
NULL
;
}
}
// call destructor through Mesh::freeElement !!!
Element
::~
Element
()
{
if
(
child
[
0
])
DELETE
child
[
0
];
if
(
child
[
1
])
DELETE
child
[
1
];
if
(
child
[
0
])
DELETE
child
[
0
];
if
(
child
[
1
])
DELETE
child
[
1
];
//if(elementData) DELETE elementData;
if
(
newCoord
)
{
if
(
newCoord
)
{
DELETE
newCoord
;
}
}
...
...
@@ -65,7 +72,7 @@ namespace AMDiS {
/* CHANGE_DOFS_1 changes old dofs to NEGATIVE new dofs */
#define CHANGE_DOFS_1(el) \
ldof = el->dof[n0
+
i] + nd0; \
ldof = el->dof[n0
+
i] + nd0; \
for (j = 0; j < nd; j++) { \
if ((k = ldof[j]) >= 0) { \
/* do it only once! (dofs are visited more than once) */
\
...
...
@@ -99,7 +106,7 @@ namespace AMDiS {
}
}
if
(
mesh
->
getDim
()
>
1
)
{
if
(
mesh
->
getDim
()
>
1
)
{
if
((
nd
=
admin
->
getNumberOfDOFs
(
EDGE
)))
{
nd0
=
admin
->
getNumberOfPreDOFs
(
EDGE
);
n0
=
admin
->
getMesh
()
->
getNode
(
EDGE
);
...
...
@@ -109,7 +116,7 @@ namespace AMDiS {
}
}
if
(
3
==
mesh
->
getDim
())
{
if
(
mesh
->
getDim
()
==
3
)
{
if
((
nd
=
admin
->
getNumberOfDOFs
(
FACE
)))
{
nd0
=
admin
->
getNumberOfPreDOFs
(
FACE
);
n0
=
admin
->
getMesh
()
->
getNode
(
FACE
);
...
...
@@ -145,7 +152,7 @@ namespace AMDiS {
}
}
if
(
mesh
->
getDim
()
>
1
)
{
if
(
mesh
->
getDim
()
>
1
)
{
if
((
nd
=
admin
->
getNumberOfDOFs
(
EDGE
)))
{
nd0
=
admin
->
getNumberOfPreDOFs
(
EDGE
);
n0
=
admin
->
getMesh
()
->
getNode
(
EDGE
);
...
...
@@ -155,7 +162,7 @@ namespace AMDiS {
}
}
if
(
3
==
mesh
->
getDim
())
{
if
(
mesh
->
getDim
()
==
3
)
{
if
((
nd
=
admin
->
getNumberOfDOFs
(
FACE
)))
{
nd0
=
admin
->
getNumberOfPreDOFs
(
FACE
);
n0
=
admin
->
getMesh
()
->
getNode
(
FACE
);
...
...
@@ -183,19 +190,17 @@ namespace AMDiS {
int
Element
::
oppVertex
(
FixVec
<
DegreeOfFreedom
*
,
DIMEN
>
pdof
)
const
{
int
i
,
j
,
nv
=
0
,
ov
=
0
;
int
nv
=
0
,
ov
=
0
;
int
vertices
=
mesh
->
getGeo
(
VERTEX
);
int
dim
=
mesh
->
getDim
();
for
(
i
=
0
;
i
<
vertices
;
i
++
)
{
if
(
nv
<
i
-
1
)
return
(
-
1
);
for
(
int
i
=
0
;
i
<
vertices
;
i
++
)
{
if
(
nv
<
i
-
1
)
return
(
-
1
);
for
(
j
=
0
;
j
<
dim
;
j
++
)
{
if
(
dof
[
i
]
==
pdof
[
j
])
{
for
(
int
j
=
0
;
j
<
dim
;
j
++
)
{
if
(
dof
[
i
]
==
pdof
[
j
])
{
/****************************************************************************/
/* i is a common vertex */
/****************************************************************************/
...
...
@@ -206,7 +211,9 @@ namespace AMDiS {
}
}
if
(
nv
!=
mesh
->
getDim
())
return
(
-
1
);
if
(
nv
!=
mesh
->
getDim
())
return
(
-
1
);
/****************************************************************************/
/* the opposite vertex is 3(6) - (sum of indices of common vertices) in */
/* 2d(3d) */
...
...
AMDiS/src/Element.h
View file @
bb580238
...
...
@@ -305,9 +305,9 @@ namespace AMDiS {
/** \brief
* Sets the pointer to the DOFs of the i-th node of Element
*/
DegreeOfFreedom
*
setDOF
(
int
i
,
DegreeOfFreedom
*
p
)
{
dof
[
i
]
=
p
;
return
dof
[
i
];
DegreeOfFreedom
*
setDOF
(
int
pos
,
DegreeOfFreedom
*
p
)
{
dof
[
pos
]
=
p
;
return
dof
[
pos
];
};
/** \brief
...
...
AMDiS/src/Lagrange.cc
View file @
bb580238
...
...
@@ -360,7 +360,9 @@ namespace AMDiS {
}
}
Lagrange
::
Phi
::~
Phi
()
{
DELETE
[]
vertices
;
}
Lagrange
::
Phi
::~
Phi
()
{
DELETE
[]
vertices
;
}
Lagrange
::
GrdPhi
::
GrdPhi
(
Lagrange
*
owner_
,
...
...
@@ -1003,16 +1005,17 @@ namespace AMDiS {
DegreeOfFreedom
*
result
;
if
(
indices
)
{
if
(
indices
)
{
result
=
indices
;
}
else
{
if
(
localVec
)
FREE_MEMORY
(
localVec
,
DegreeOfFreedom
,
localVecSize
);
if
(
localVec
)
FREE_MEMORY
(
localVec
,
DegreeOfFreedom
,
localVecSize
);
localVec
=
GET_MEMORY
(
DegreeOfFreedom
,
nBasFcts
);
localVecSize
=
nBasFcts
;
result
=
localVec
;
}
for
(
pos
=
0
,
j
=
0
;
pos
<=
dim
;
pos
++
)
{
for
(
pos
=
0
,
j
=
0
;
pos
<=
dim
;
pos
++
)
{
posIndex
=
INDEX_OF_DIM
(
pos
,
dim
);
n0
=
admin
->
getNumberOfPreDOFs
(
posIndex
);
node0
=
admin
->
getMesh
()
->
getNode
(
posIndex
);
...
...
@@ -1032,33 +1035,6 @@ namespace AMDiS {
return
result
;
}
// const double* Lagrange::getVec(const Element* el, const DOFVector<double> * dv,
// double * d) const
// {
// static double* localVec = NULL;
// const DOFAdmin* admin = dv->getFESpace()->getAdmin();
// int i;
// double* result;
// if(d) {
// result = d;
// } else {
// if(localVec) FREE_MEMORY(localVec, double, nBasFcts);
// localVec = GET_MEMORY(double, nBasFcts);
// result = localVec;
// }
// const DegreeOfFreedom *localIndices = getLocalIndices(el, admin, NULL);
// for(i = 0; i < nBasFcts; i++) {
// result[i] = (*dv)[localIndices[i]];
// }
// return result;
// }
void
Lagrange
::
l2ScpFctBas
(
Quadrature
*
q
,
AbstractFunction
<
WorldVector
<
double
>
,
WorldVector
<
double
>
>*
f
,
DOFVector
<
WorldVector
<
double
>
>*
fh
)
...
...
@@ -1234,9 +1210,10 @@ namespace AMDiS {
RCNeighbourList
*
list
,
int
n
,
BasisFunction
*
basFct
)
{
FUNCNAME
(
"Lagrange::refineInter2_2d"
);
FUNCNAME
(
"Lagrange::refineInter2_2d
()
"
);
if
(
n
<
1
)
return
;
if
(
n
<
1
)
return
;
Element
*
el
;
int
node
,
n0
;
...
...
@@ -1267,7 +1244,7 @@ namespace AMDiS {
cdof
=
el
->
getChild
(
0
)
->
getDOF
(
node
,
n0
);
(
*
drv
)[
cdof
]
=
0.375
*
(
*
drv
)[
pdof
[
0
]]
-
0.125
*
(
*
drv
)[
pdof
[
1
]]
+
0.75
*
(
*
drv
)[
pdof
[
5
]];
0.375
*
(
*
drv
)[
pdof
[
0
]]
-
0.125
*
(
*
drv
)[
pdof
[
1
]]
+
0.75
*
(
*
drv
)[
pdof
[
5
]];
/****************************************************************************/
/* node in the common edge of child[0] and child[1] */
...
...
@@ -1275,8 +1252,8 @@ namespace AMDiS {
cdof
=
el
->
getChild
(
0
)
->
getDOF
(
node
+
1
,
n0
);
(
*
drv
)[
cdof
]
=
-
0.125
*
((
*
drv
)[
pdof
[
0
]]
+
(
*
drv
)[
pdof
[
1
]])
+
0.25
*
(
*
drv
)[
pdof
[
5
]]
+
0.5
*
((
*
drv
)[
pdof
[
3
]]
+
(
*
drv
)[
pdof
[
4
]]);
-
0.125
*
((
*
drv
)[
pdof
[
0
]]
+
(
*
drv
)[
pdof
[
1
]])
+
0.25
*
(
*
drv
)[
pdof
[
5
]]
+
0.5
*
((
*
drv
)[
pdof
[
3
]]
+
(
*
drv
)[
pdof
[
4
]]);
/****************************************************************************/
/* midpoint of edge on child[1] at the refinement edge */
...
...
@@ -1284,10 +1261,9 @@ namespace AMDiS {
cdof
=
el
->
getChild
(
1
)
->
getDOF
(
node
+
1
,
n0
);
(
*
drv
)[
cdof
]
=
-
0.125
*
(
*
drv
)[
pdof
[
0
]]
+
0.375
*
(
*
drv
)[
pdof
[
1
]]
+
0.75
*
(
*
drv
)[
pdof
[
5
]];
-
0.125
*
(
*
drv
)[
pdof
[
0
]]
+
0.375
*
(
*
drv
)[
pdof
[
1
]]
+
0.75
*
(
*
drv
)[
pdof
[
5
]];
if
(
n
>
1
)
{
if
(
n
>
1
)
{
/****************************************************************************/
/* adjust the value at the midpoint of the common edge of neigh's children */
/****************************************************************************/
...
...
@@ -1296,10 +1272,9 @@ namespace AMDiS {
cdof
=
el
->
getChild
(
0
)
->
getDOF
(
node
+
1
,
n0
);
(
*
drv
)[
cdof
]
=
-
0.125
*
((
*
drv
)[
pdof
[
0
]]
+
(
*
drv
)[
pdof
[
1
]])
+
0.25
*
(
*
drv
)[
pdof
[
5
]]
+
0.5
*
((
*
drv
)[
pdof
[
3
]]
+
(
*
drv
)[
pdof
[
4
]]);
-
0.125
*
((
*
drv
)[
pdof
[
0
]]
+
(
*
drv
)[
pdof
[
1
]])
+
0.25
*
(
*
drv
)[
pdof
[
5
]]
+
0.5
*
((
*
drv
)[
pdof
[
3
]]
+
(
*
drv
)[
pdof
[
4
]]);
}
return
;
}
void
Lagrange
::
refineInter2_3d
(
DOFIndexed
<
double
>
*
drv
,
...
...
AMDiS/src/Lagrange.h
View file @
bb580238
...
...
@@ -152,20 +152,6 @@ namespace AMDiS {
const
DOFAdmin
*
,
DegreeOfFreedom
*
)
const
;
/** \brief
* Implements BasisFunction::getVec().
*/
// const double *getVec(const Element* el,
// const DOFVector<double> * dv,
// double * d) const;
/** \brief
* Implements BasisFunction::getVec
*/
// const WorldVector<double> *getVec(const Element* el,
// const DOFVector<WorldVector<double> > * dv,
// WorldVector<double> *d) const;
/** \brief
* Implements BasisFunction::l2ScpFctBas
*/
...
...
AMDiS/src/MacroReader.cc
View file @
bb580238
...
...
@@ -133,16 +133,6 @@ namespace AMDiS {
element2
->
setElementData
(
ldp2
);
}
// DimVec<DegreeOfFreedom> periodicDOFsEl1(dim-1, NO_INIT);
// DimVec<DegreeOfFreedom> periodicDOFsEl2(dim-1, NO_INIT);
// for(j = 0; j < dim; j++) {
// periodicDOFsEl1[element1->getPositionOfVertex(sideEl1, verticesEl1[j])] =
// melVertex[el2][vertexMapEl1[verticesEl1[j]]];
// periodicDOFsEl2[element2->getPositionOfVertex(sideEl2, verticesEl2[j])] =
// melVertex[el1][vertexMapEl2[verticesEl2[j]]];
// }
ldp1
->
addPeriodicInfo
(
mode
,
boundaryType
,
sideEl1
,
...
...
@@ -228,8 +218,9 @@ namespace AMDiS {
for
(
int
i
=
0
;
i
<
mesh
->
getNumberOfMacros
();
i
++
)
{
for
(
int
k
=
0
;
k
<
mesh
->
getGeo
(
VERTEX
);
k
++
)
{
(
*
(
mel
+
i
))
->
setCoord
(
k
,
coords
[
melVertex
[
i
][
k
]]);
const_cast
<
Element
*>
((
*
(
mel
+
i
))
->
getElement
())
->
setDOF
(
k
,
dof
[
melVertex
[
i
][
k
]]);
setDOF
(
k
,
dof
[
melVertex
[
i
][
k
]]);
}
}
...
...
@@ -963,13 +954,8 @@ namespace AMDiS {
getElement
()
->
getDOF
((
k
+
l
+
1
)
%
(
dim
+
1
)));
for
(
j
=
i
+
1
;
j
<
mesh
->
getNumberOfLeaves
();
j
++
)
{
//MacroElement *mel0 = mesh->getMacroElement(i);
//Element *el = const_cast<Element*>(mel0->getElement());
//m = el->oppVertex(dof);
if
((
m
=
mesh
->
getMacroElement
(
j
)
->
getElement
()
->
oppVertex
(
dof
))
!=
-
1
)
{
for
(
j
=
i
+
1
;
j
<
mesh
->
getNumberOfLeaves
();
j
++
)
{
if
((
m
=
mesh
->
getMacroElement
(
j
)
->
getElement
()
->
oppVertex
(
dof
))
!=
-
1
)
{
mesh
->
getMacroElement
(
i
)
->
setNeighbour
(
k
,
mesh
->
getMacroElement
(
j
));
mesh
->
getMacroElement
(
j
)
->
setNeighbour
(
m
,
mesh
->
getMacroElement
(
i
));
mesh
->
getMacroElement
(
i
)
->
setOppVertex
(
k
,
m
);
...
...
@@ -977,14 +963,9 @@ namespace AMDiS {
break
;
}
}
TEST_EXIT
(
j
<
mesh
->
getNumberOfLeaves
())
(
"could not find neighbour %d of element %d
\n
"
,
k
,
i
);
// if(j == mesh->getNumberOfLeaves()) {
// ::std::cout << "neighbour " << k << " not found" << ::std::endl;
// mesh->getMacroElement(i)->setBoundary(k, 1111);
// mesh->getMacroElement(i)->setNeighbour(k, NULL);
// mesh->getMacroElement(i)->setOppVertex(k, -1);
// }
}
}
}
...
...
@@ -1002,8 +983,9 @@ namespace AMDiS {
void
MacroReader
::
boundaryDOFs
(
Mesh
*
mesh
)
{
FUNCNAME
(
"Mesh::boundaryDOFs"
);
int
i
,
lnode
=
mesh
->
getNode
(
EDGE
);
FUNCNAME
(
"Mesh::boundaryDOFs()"
);
int
lnode
=
mesh
->
getNode
(
EDGE
);
int
k
,
lne
=
mesh
->
getNumberOfLeaves
();
int
max_n_neigh
=
0
,
n_neigh
,
ov
;
::
std
::
deque
<
MacroElement
*>::
iterator
mel
;
...
...
@@ -1017,41 +999,41 @@ namespace AMDiS {
switch
(
dim
)
{
case
2
:
for
(
mel
=
mesh
->
firstMacroElement
();
mel
!=
mesh
->
endOfMacroElements
();
mel
++
)
{
for
(
mel
=
mesh
->
firstMacroElement
();
mel
!=
mesh
->
endOfMacroElements
();
mel
++
)
{
// check for periodic boundary
Element
*
el
=
const_cast
<
Element
*>
((
*
mel
)
->
getElement
());
ElementData
*
ed
=
el
->
getElementData
(
PERIODIC
);
DimVec
<
bool
>
periodic
(
dim
,
DEFAULT_VALUE
,
false
);
if
(
ed
)
{
if
(
ed
)
{
::
std
::
list
<
LeafDataPeriodic
::
PeriodicInfo
>
&
periodicInfos
=
dynamic_cast
<
LeafDataPeriodic
*>
(
ed
)
->
getInfoList
();
::
std
::
list
<
LeafDataPeriodic
::
PeriodicInfo
>::
iterator
it
;
::
std
::
list
<
LeafDataPeriodic
::
PeriodicInfo
>::
iterator
end
=
periodicInfos
.
end
();
for
(
it
=
periodicInfos
.
begin
();
it
!=
end
;
++
it
)
{
if
(
it
->
type
!=
0
)
{
for
(
it
=
periodicInfos
.
begin
();
it
!=
end
;
++
it
)
{
if
(
it
->
type
!=
0
)
{
periodic
[
it
->
elementSide
]
=
true
;
}
}
}
for
(
i
=
0
;
i
<
mesh
->
getGeo
(
NEIGH
);
i
++
)
{
for
(
int
i
=
0
;
i
<
mesh
->
getGeo
(
NEIGH
);
i
++
)
{
if
(
!
(
*
mel
)
->
getNeighbour
(
i
)
||
((
*
mel
)
->
getNeighbour
(
i
)
->
getIndex
()
<
(
*
mel
)
->
getIndex
()))
{
mesh
->
incrementNumberOfEdges
(
1
);;
((
*
mel
)
->
getNeighbour
(
i
)
->
getIndex
()
<
(
*
mel
)
->
getIndex
()))
{
mesh
->
incrementNumberOfEdges
(
1
);
if
(
mesh
->
getNumberOfDOFs
(
EDGE
))
{
dof
=
el
->
setDOF
(
lnode
+
i
,
mesh
->
getDOF
(
EDGE
));
dof
=
el
->
setDOF
(
lnode
+
i
,
mesh
->
getDOF
(
EDGE
));
if
((
*
mel
)
->
getNeighbour
(
i
))
{
Element
*
neigh
=
const_cast
<
Element
*>
((
*
mel
)
->
getNeighbour
(
i
)
->
getElement
());
Element
*
neigh
=
const_cast
<
Element
*>
((
*
mel
)
->
getNeighbour
(
i
)
->
getElement
());
if
(
periodic
[
i
])
{
neigh
->
setDOF
(
lnode
+
(
*
mel
)
->
getOppVertex
(
i
),
mesh
->
getDOF
(
EDGE
));
neigh
->
setDOF
(
lnode
+
(
*
mel
)
->
getOppVertex
(
i
),
mesh
->
getDOF
(
EDGE
));
}
else
{
neigh
->
setDOF
(
lnode
+
(
*
mel
)
->
getOppVertex
(
i
),
dof
);
neigh
->
setDOF
(
lnode
+
(
*
mel
)
->
getOppVertex
(
i
),
dof
);
}
}
}
...
...
@@ -1062,7 +1044,7 @@ namespace AMDiS {
case
3
:
lnode
=
mesh
->
getNode
(
FACE
);
mel
=
mesh
->
firstMacroElement
();
for
(
i
=
0
;
i
<
lne
;
i
++
)
{
for
(
int
i
=
0
;
i
<
lne
;
i
++
)
{
// check for periodic boundary
Element
*
el
=
const_cast
<
Element
*>
((
*
(
mel
+
i
))
->
getElement
());
...
...
@@ -1152,9 +1134,9 @@ namespace AMDiS {
default:
ERROR_EXIT
(
"invalid dim
\n
"
);
}
if
(
3
==
dim
)
if
(
3
==
dim
)
{
mesh
->
setMaxEdgeNeigh
(
::
std
::
max
(
8
,
2
*
max_n_neigh
));
else
{
}
else
{
mesh
->
setMaxEdgeNeigh
(
dim
-
1
);
}
...
...
AMDiS/src/Mesh.cc
View file @
bb580238
...
...
@@ -363,26 +363,20 @@ namespace AMDiS {
void
Mesh
::
dofCompress
()
{
FUNCNAME
(
"Mesh::dofCompress"
);
FUNCNAME
(
"Mesh::dofCompress
()
"
);
int
size
;
Flag
fill_flag
;
// int i;
// for(i = 0; i < periodicAssociations[-2]->getSize(); i++) {
// MSG("asso %d : dof %d -> dof %d\n",
// periodicAssociations[-2],
// i,
// (*periodicAssociations[-2])[i]);
// }
for
(
iadmin
=
0
;
iadmin
<
static_cast
<
int
>
(
admin
.
size
());
iadmin
++
)