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
e22abd25
Commit
e22abd25
authored
May 07, 2008
by
Thomas Witkowski
Browse files
* This and that
parent
1500f6ae
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
AMDiS/src/Assembler.cc
View file @
e22abd25
This diff is collapsed.
Click to expand it.
AMDiS/src/Assembler.h
View file @
e22abd25
...
...
@@ -70,7 +70,7 @@ namespace AMDiS {
* \brief
* Base class for SecondOrderAssembler, FirstOrderAssembler,
* ZeroOrderAssembler. The task of a SubAssembler is to assemble a list of
* terms of a spe
z
ial order and add their contributions to a DOFMatrix or a
* terms of a spe
c
ial order and add their contributions to a DOFMatrix or a
* DOFVector. An Assembler can consist of up to four SubAssemblers: one
* SecondOrderAssembler for second order terms, one ZeroOrderAssembler for
* terms of order zero, and two FirstOrderAssemblers. One for terms with
...
...
AMDiS/src/MemoryManager.h
View file @
e22abd25
...
...
@@ -251,13 +251,16 @@ namespace AMDiS {
*/
static
T
*
getMemory
(
size_t
s
,
const
char
*
filename
,
int
line
)
{
FUNCNAME
(
"MemoryManager<T>::getMemory()"
);
if
(
!
singleton
)
init
();
if
(
!
singleton
)
init
();
byteCount
+=
s
;
singleton
->
instanceCount
+=
s
/
sizeof
(
T
);
singleton
->
typedByteCount
+=
s
;
if
(
printInfo
)
{
if
(
filename
&&
line
)
if
(
printInfo
)
{
if
(
filename
&&
line
)
{
MSG
(
"FILE: %s, LINE: %d - "
,
filename
,
line
);
}
Msg
::
print
(
"%s::getMemory : %d instances, total : %d instances
\n
"
,
singleton
->
getName
().
c_str
(),
s
/
sizeof
(
T
),
static_cast
<
int
>
(
singleton
->
instanceCount
));
...
...
AMDiS/src/Operator.cc
View file @
e22abd25
...
...
@@ -239,8 +239,8 @@ namespace AMDiS {
Quadrature
*
quad1GrdPhi
,
Quadrature
*
quad0
)
{
if
(
!
assembler
)
if
(
optimized
)
{
if
(
!
assembler
)
if
(
optimized
)
{
assembler
=
NEW
OptimizedAssembler
(
this
,
quad2
,
quad1GrdPsi
,
quad1GrdPhi
,
quad0
,
...
...
@@ -597,13 +597,12 @@ namespace AMDiS {
}
void
VecAtQP_ZOT
::
getC
(
const
ElInfo
*
,
int
numPoints
,
double
*
C
)
const
{
int
iq
;
if
(
f
)
{
for
(
iq
=
0
;
iq
<
numPoints
;
iq
++
)
{
if
(
f
)
{
for
(
int
iq
=
0
;
iq
<
numPoints
;
iq
++
)
{
C
[
iq
]
+=
(
*
f
)(
vecAtQPs
[
iq
]);
}
}
else
{
for
(
iq
=
0
;
iq
<
numPoints
;
iq
++
)
{
for
(
int
iq
=
0
;
iq
<
numPoints
;
iq
++
)
{
C
[
iq
]
+=
vecAtQPs
[
iq
];
}
}
...
...
@@ -625,8 +624,7 @@ namespace AMDiS {
// Andreas ergaenzt
void
MultVecAtQP_ZOT
::
getC
(
const
ElInfo
*
,
int
numPoints
,
double
*
C
)
const
{
int
iq
;
for
(
iq
=
0
;
iq
<
numPoints
;
iq
++
)
{
for
(
int
iq
=
0
;
iq
<
numPoints
;
iq
++
)
{
C
[
iq
]
+=
(
*
f1
)(
vecAtQPs1
[
iq
])
*
(
*
f2
)(
vecAtQPs2
[
iq
]);
}
}
...
...
@@ -649,8 +647,7 @@ namespace AMDiS {
}
void
Vec2AtQP_ZOT
::
getC
(
const
ElInfo
*
,
int
numPoints
,
double
*
C
)
const
{
int
iq
;
for
(
iq
=
0
;
iq
<
numPoints
;
iq
++
)
{
for
(
int
iq
=
0
;
iq
<
numPoints
;
iq
++
)
{
C
[
iq
]
+=
(
*
f
)(
vecAtQPs1
[
iq
],
vecAtQPs2
[
iq
]);
}
}
...
...
@@ -672,8 +669,7 @@ namespace AMDiS {
}
void
VecAndCoordsAtQP_ZOT
::
getC
(
const
ElInfo
*
,
int
numPoints
,
double
*
C
)
const
{
int
iq
;
for
(
iq
=
0
;
iq
<
numPoints
;
iq
++
)
{
for
(
int
iq
=
0
;
iq
<
numPoints
;
iq
++
)
{
C
[
iq
]
+=
(
*
f
)(
vecAtQPs
[
iq
],
coordsAtQPs
[
iq
]);
}
}
...
...
@@ -696,8 +692,7 @@ namespace AMDiS {
void
FctGradientCoords_ZOT
::
getC
(
const
ElInfo
*
,
int
numPoints
,
double
*
C
)
const
{
int
iq
;
for
(
iq
=
0
;
iq
<
numPoints
;
iq
++
)
{
for
(
int
iq
=
0
;
iq
<
numPoints
;
iq
++
)
{
C
[
iq
]
+=
(
*
f
)(
gradAtQPs
[
iq
],
coordsAtQPs
[
iq
]);
}
}
...
...
@@ -719,8 +714,7 @@ namespace AMDiS {
}
void
VecGradCoordsAtQP_ZOT
::
getC
(
const
ElInfo
*
,
int
numPoints
,
double
*
C
)
const
{
int
iq
;
for
(
iq
=
0
;
iq
<
numPoints
;
iq
++
)
{
for
(
int
iq
=
0
;
iq
<
numPoints
;
iq
++
)
{
C
[
iq
]
+=
(
*
f
)(
vecAtQPs
[
iq
],
gradAtQPs
[
iq
],
coordsAtQPs
[
iq
]);
}
}
...
...
@@ -744,8 +738,7 @@ namespace AMDiS {
// bis hierhin
void
VecAndGradAtQP_ZOT
::
getC
(
const
ElInfo
*
,
int
numPoints
,
double
*
C
)
const
{
int
iq
;
for
(
iq
=
0
;
iq
<
numPoints
;
iq
++
)
{
for
(
int
iq
=
0
;
iq
<
numPoints
;
iq
++
)
{
C
[
iq
]
+=
(
*
f
)(
vecAtQPs
[
iq
],
gradAtQPs
[
iq
]);
}
}
...
...
@@ -768,8 +761,7 @@ namespace AMDiS {
void
VecAndGradVecAtQP_ZOT
::
getC
(
const
ElInfo
*
,
int
numPoints
,
double
*
C
)
const
{
int
iq
;
for
(
iq
=
0
;
iq
<
numPoints
;
iq
++
)
{
for
(
int
iq
=
0
;
iq
<
numPoints
;
iq
++
)
{
C
[
iq
]
+=
(
*
f
)(
vecAtQPs
[
iq
],
gradAtQPs
[
iq
]);
}
}
...
...
@@ -791,8 +783,7 @@ namespace AMDiS {
}
void
VecAndGradVec2AtQP_ZOT
::
getC
(
const
ElInfo
*
,
int
numPoints
,
double
*
C
)
const
{
int
iq
;
for
(
iq
=
0
;
iq
<
numPoints
;
iq
++
)
{
for
(
int
iq
=
0
;
iq
<
numPoints
;
iq
++
)
{
C
[
iq
]
+=
(
*
f
)(
vecAtQPs
[
iq
],
grad1AtQPs
[
iq
],
grad2AtQPs
[
iq
]);
}
}
...
...
@@ -814,8 +805,7 @@ namespace AMDiS {
}
void
FctGradient_ZOT
::
getC
(
const
ElInfo
*
,
int
numPoints
,
double
*
C
)
const
{
int
iq
;
for
(
iq
=
0
;
iq
<
numPoints
;
iq
++
)
{
for
(
int
iq
=
0
;
iq
<
numPoints
;
iq
++
)
{
C
[
iq
]
+=
(
*
f
)(
gradAtQPs
[
iq
]);
}
}
...
...
@@ -1387,90 +1377,6 @@ namespace AMDiS {
return
assembler
;
}
// Matrix<double> **OperatorVec::createElementMatrix()
// {
// int i;
// Matrix<double> **newElementMatrix = GET_MEMORY(Matrix<double>*, nRow);
// for(i=0; i < nRow; i++) {
// newElementMatrix[i] = NEW Matrix<double>[nCol](vecSize, vecSize);
// }
// return newElementMatrix;
// }
// void OperatorVec::freeElementMatrix(Matrix<double> **elMat) {
// int i;
// for(i = 0; i < nRow; i++) {
// DELETE [] elMat[i];
// }
// FREE_MEMORY(elMat, Matrix<double>*, nRow);
// }
// Vector<double> *OperatorVec::createElementVector()
// {
// return NEW Vector<double>[nRow](vecSize);
// }
// void OperatorVec::freeElementVector(Vector<double> *elVec)
// {
// DELETE [] elVec;
// }
// void OperatorVec::getElementMatrix(ElInfo *elInfo,
// Matrix<double> **userMat,
// double factor = 1.0)
// {
// int i, j, k, l;
// Operator *op = NULL;
// double **elMat = NULL;
// for(i = 0; i < operators.getNumRows(); i++) {
// for(j = 0; j < operators.getNumCols(); j++) {
// op = operators[i][j];
// if(op) {
// if(!elMat) elMat = op->createElementMatrix();
// op->resetElementMatrix(elMat);
// op->getElementMatrix(elInfo, elMat, factor);
// for(k = 0; k < nRow; k++) {
// for(l = 0; l < nCol; l++) {
// userMat[i][j][k][l] += elMat[k][l];
// }
// }
// }
// }
// }
// if(elMat) op->freeElementMatrix(elMat);
// }
// void OperatorVec::getElementVector(const ElInfo *elInfo,
// Vector<double> *userVec,
// double factor = 1.0)
// {
// int i, j, k;
// Operator *op = NULL;
// double *elVec = NULL;
// for(i = 0; i < operators.getNumRows(); i++) {
// for(j = 0; j < operators.getNumCols(); j++) {
// op = operators[i][j];
// if(op) {
// if(!elVec) elVec = op->createElementVector();
// op->resetElementVector(elVec);
// op->getElementVector(elInfo, elVec, factor);
// for(k = 0; k < nRow; k++) {
// userVec[i][k] += elVec[k];
// }
// }
// }
// }
// if(elVec) op->freeElementVector(elVec);
// }
void
CoordsAtQP_IJ_SOT
::
initElement
(
const
ElInfo
*
elInfo
,
SubAssembler
*
subAssembler
,
Quadrature
*
quad
)
...
...
AMDiS/src/Quadrature.h
View file @
e22abd25
...
...
@@ -114,32 +114,44 @@ namespace AMDiS {
/** \brief
* Returns \ref name
*/
inline
const
::
std
::
string
&
getName
()
{
return
name
;
};
inline
const
::
std
::
string
&
getName
()
{
return
name
;
};
/** \brief
* Returns \ref n_points
*/
inline
int
getNumPoints
()
const
{
return
n_points
;};
inline
int
getNumPoints
()
const
{
return
n_points
;
};
/** \brief
* Returns \ref w[p]
*/
inline
double
getWeight
(
int
p
)
const
{
return
w
[
p
];};
inline
double
getWeight
(
int
p
)
const
{
return
w
[
p
];
};
/** \brief
* Returns \ref w.
*/
inline
double
*
getWeight
()
const
{
return
w
;
};
inline
double
*
getWeight
()
const
{
return
w
;
};
/** \brief
* Returns \ref dim
*/
inline
int
getDim
()
const
{
return
dim
;
};
inline
int
getDim
()
const
{
return
dim
;
};
/** \brief
* Returns \ref degree
*/
inline
int
getDegree
()
const
{
return
degree
;
};
inline
int
getDegree
()
const
{
return
degree
;
};
/** \brief
* Returns a pointer to a vector storing the values of a doubled valued
...
...
@@ -170,7 +182,7 @@ namespace AMDiS {
* Returns \ref lambda[a][b] which is the b-th coordinate entry of the a-th
* quadrature point
*/
inline
double
getLambda
(
int
a
,
int
b
)
const
{
inline
double
getLambda
(
int
a
,
int
b
)
const
{
return
(
lambda
?
(
*
lambda
)[
a
][
b
]
:
0.0
);
};
...
...
@@ -185,45 +197,10 @@ namespace AMDiS {
/** \brief
* Returns \ref lambda which is a VectorOfFixvecs<DimVec<double> >.
*/
VectorOfFixVecs
<
DimVec
<
double
>
>
*
getLambda
()
const
{
return
lambda
;
};
/** \brief
* The function returns a pointer ptr to a vector of length
* \ref n_points storing the values of \f$ u_h \f$ at all
* quadrature points, i.e.
* \f[ ptr[l] = u_h(lambda[l]) \f] where
* l = 0, . . . , n_points - 1. vec is an optional memory pointer
*/
// const double *uhAtQp(const BasisFunction *basFcts,
// const double *uh_loc, double *vec) const;
/** \brief
* The function returns a pointer ptr to a vector of length
* \ref n_points WorldVectors storing \f$ \nabla u_h \f$ at all
* quadrature points, i.e.
* \f[ ptr[l][i] = u_{h,xi}(lambda[l]) \f]
* where l = 0, ... , n_points - 1, and i = 0, ... ,
* DIM_OF_WORLD - 1; vec is an optional memory pointer
*/
// const WorldVector<double> *grdUhAtQp(const BasisFunction *basFcts,
// const DimVec<WorldVector<double> >& Lambda,
// const double *uh_loc,
// WorldVector<double> *vec) const;
VectorOfFixVecs
<
DimVec
<
double
>
>
*
getLambda
()
const
{
return
lambda
;
};
/** \brief
* The function returns a pointer ptr to a vector of length
* \ref n_points of WorldMatrices storing D2uh at all quadrature
* points, i.e.
* \f[ ptr[l][i][j] = u_{h,x_ix_j}(lambda[l]) \f]
* where l = 0, ... , n_points - 1, and i, j = 0, ... ,
* DIM_OF_WORLD - 1; vec is an optional memory pointer
*/
// const WorldMatrix<double> *D2UhAtQp(const BasisFunction *basFcts,
// const DimVec<WorldVector<double> >& Lambda,
// const double *uh_loc,
// WorldMatrix<double> *vec) const;
public:
/** \brief
...
...
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