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
amdis
amdis-core
Commits
0faff253
Commit
0faff253
authored
Mar 13, 2019
by
Praetorius, Simon
Browse files
renamed template parameters, to shorten error messages and symbols
parent
68c1eb6d
Changes
47
Hide whitespace changes
Inline
Side-by-side
src/amdis/Assembler.hpp
View file @
0faff253
...
...
@@ -15,11 +15,14 @@
namespace
AMDiS
{
/// Implementation of interface \ref AssemblerBase
template
<
class
LocalContext
,
class
Operator
,
class
...
Nodes
>
/**
* \tparam LC LocalContext
**/
template
<
class
LC
,
class
Operator
,
class
...
Nodes
>
class
Assembler
:
public
AssemblerInterface
<
L
ocalContext
,
Nodes
...
>
:
public
AssemblerInterface
<
L
C
,
Nodes
...
>
{
using
Super
=
AssemblerInterface
<
L
ocalContext
,
Nodes
...
>
;
using
Super
=
AssemblerInterface
<
L
C
,
Nodes
...
>
;
private:
...
...
@@ -74,12 +77,11 @@ namespace AMDiS
* \ref calculateElementVector or \ref calculateElementMatrix on the
* vector or matrix operator, respectively.
**/
void
assemble
(
LocalContext
const
&
localContext
,
Nodes
const
&
...
nodes
,
void
assemble
(
LC
const
&
localContext
,
Nodes
const
&
...
nodes
,
ElementMatrixVector
&
elementMatrixVector
)
final
{
ContextGeometry
<
L
ocalContext
>
context
{
localContext
,
element
(),
geometry
()};
assembleImpl
(
context
,
nodes
...,
elementMatrixVector
);
ContextGeometry
<
L
C
>
context
Geo
{
localContext
,
element
(),
geometry
()};
assembleImpl
(
context
Geo
,
nodes
...,
elementMatrixVector
);
}
...
...
@@ -88,21 +90,17 @@ namespace AMDiS
protected:
// implementation detail
// matrix assembling
template
<
class
Context
,
class
RowNode
,
class
ColNode
,
class
ElementMatrix
>
void
assembleImpl
(
Context
const
&
context
,
RowNode
const
&
rowNode
,
ColNode
const
&
colNode
,
ElementMatrix
&
elementMatrix
)
template
<
class
CG
,
class
RN
,
class
CN
,
class
Mat
>
void
assembleImpl
(
CG
const
&
contextGeo
,
RN
const
&
rowNode
,
CN
const
&
colNode
,
Mat
&
elementMatrix
)
{
op_
->
calculateElementMatrix
(
context
,
rowNode
,
colNode
,
elementMatrix
);
op_
->
calculateElementMatrix
(
context
Geo
,
rowNode
,
colNode
,
elementMatrix
);
}
// vector assembling
template
<
class
Context
,
class
Node
,
class
ElementVector
>
void
assembleImpl
(
Context
const
&
context
,
Node
const
&
node
,
ElementVector
&
elementVector
)
template
<
class
CG
,
class
Node
,
class
Vec
>
void
assembleImpl
(
CG
const
&
contextGeo
,
Node
const
&
node
,
Vec
&
elementVector
)
{
op_
->
calculateElementVector
(
context
,
node
,
elementVector
);
op_
->
calculateElementVector
(
context
Geo
,
node
,
elementVector
);
}
#endif // DOXYGEN
...
...
@@ -134,11 +132,11 @@ namespace AMDiS
};
/// Generate a \ref Assembler on a given
`
LocalContext` (element or intersection)
template
<
class
L
ocalContext
,
class
Operator
,
class
...
Nodes
>
/// Generate a \ref Assembler on a given LocalContext
`LC
` (element or intersection)
template
<
class
L
C
,
class
Operator
,
class
...
Nodes
>
auto
makeAssembler
(
Operator
&&
op
,
Nodes
const
&
...)
{
return
Assembler
<
L
ocalContext
,
Underlying_t
<
Operator
>
,
Nodes
...
>
{
FWD
(
op
)};
return
Assembler
<
L
C
,
Underlying_t
<
Operator
>
,
Nodes
...
>
{
FWD
(
op
)};
}
}
// end namespace AMDiS
src/amdis/DataTransfer.inc.hpp
View file @
0faff253
...
...
@@ -128,8 +128,8 @@ namespace AMDiS
NodeDataTransferContainer
nodeDataTransfer_
;
};
template
<
class
C
ontainer
,
class
B
asis
>
void
DataTransfer
<
C
ontainer
,
Basis
>::
preAdapt
(
C
ontainer
const
&
coeff
,
bool
mightCoarsen
)
template
<
class
C
,
class
B
>
void
DataTransfer
<
C
,
B
>::
preAdapt
(
C
const
&
coeff
,
bool
mightCoarsen
)
{
auto
gv
=
basis_
->
gridView
();
auto
lv
=
basis_
->
localView
();
...
...
@@ -217,8 +217,8 @@ namespace AMDiS
}
}
template
<
class
C
ontainer
,
class
B
asis
>
void
DataTransfer
<
C
ontainer
,
Basis
>::
postAdapt
(
C
ontainer
&
coeff
,
bool
refined
)
template
<
class
C
,
class
B
>
void
DataTransfer
<
C
,
B
>::
postAdapt
(
C
&
coeff
,
bool
refined
)
{
coeff
.
resize
(
*
basis_
);
auto
gv
=
basis_
->
gridView
();
...
...
@@ -370,9 +370,9 @@ namespace AMDiS
NodeElementData
fatherDOFsTemp_
;
};
template
<
class
Node
,
class
C
ontainer
,
class
B
asis
>
template
<
class
Node
,
class
C
,
class
B
>
template
<
class
Trafo
>
bool
NodeDataTransfer
<
Node
,
Container
,
Basis
>::
bool
NodeDataTransfer
<
Node
,
C
,
B
>::
restrictLocal
(
Element
const
&
father
,
NodeElementData
&
fatherDOFs
,
Trafo
const
&
trafo
,
NodeElementData
const
&
childDOFs
,
bool
init
)
{
...
...
@@ -426,9 +426,9 @@ namespace AMDiS
std
::
logical_and
<
bool
>
());
}
template
<
class
Node
,
class
C
ontainer
,
class
B
asis
>
template
<
class
Node
,
class
C
,
class
B
>
template
<
class
Trafo
>
void
NodeDataTransfer
<
Node
,
Container
,
Basis
>::
void
NodeDataTransfer
<
Node
,
C
,
B
>::
prolongLocal
(
Element
const
&
father
,
NodeElementData
const
&
fatherDOFs
,
Trafo
const
&
trafo
,
bool
init
)
{
...
...
src/amdis/DirichletBC.hpp
View file @
0faff253
...
...
@@ -53,22 +53,28 @@ namespace AMDiS
,
values_
(
FWD
(
values
))
{}
template
<
class
I
ntersection
>
bool
onBoundary
(
I
ntersection
const
&
intersection
)
const
template
<
class
I
S
>
bool
onBoundary
(
I
S
const
&
intersection
)
const
{
return
predicate_
?
(
*
predicate_
)(
intersection
.
geometry
().
center
())
:
Super
::
onBoundary
(
intersection
);
}
// fill \ref dirichletNodes_ with 1 or 0 whether DOF corresponds to the boundary or not.
template
<
class
R
owBasis
,
class
C
olBasis
>
void
init
(
R
owBasis
const
&
rowBasis
,
C
olBasis
const
&
colBasis
);
template
<
class
R
B
,
class
C
B
>
void
init
(
R
B
const
&
rowBasis
,
C
B
const
&
colBasis
);
/// \brief Apply dirichlet BC to matrix and vector, i.e., add a unit-row
/// to the matrix and optionally delete the corresponding matrix-column.
template
<
class
Matrix
,
class
VectorX
,
class
VectorB
,
class
RowNode
,
class
ColNode
>
void
fillBoundaryCondition
(
Matrix
&
matrix
,
VectorX
&
solution
,
VectorB
&
rhs
,
RowNode
const
&
rowNode
,
ColNode
const
&
colNode
);
/**
* \tparam Mat Matrix
* \tparam Sol Vector of solution
* \tparam Rhs Vector of rhs
* \tparam RN RowNode
* \tparam CN ColNode
**/
template
<
class
Mat
,
class
Sol
,
class
Rhs
,
class
RN
,
class
CN
>
void
fillBoundaryCondition
(
Mat
&
matrix
,
Sol
&
solution
,
Rhs
&
rhs
,
RN
const
&
rowNode
,
CN
const
&
colNode
);
private:
Dune
::
Std
::
optional
<
std
::
function
<
bool
(
Domain
)
>>
predicate_
;
...
...
@@ -82,8 +88,8 @@ namespace AMDiS
{
using
WorldVector
=
typename
Basis
::
GridView
::
template
Codim
<
0
>
::
Geometry
::
GlobalCoordinate
;
template
<
class
R
owNode
,
class
C
olNode
>
using
type
=
std
::
list
<
std
::
shared_ptr
<
DirichletBC
<
WorldVector
,
RangeType_t
<
R
owNode
>>>
>
;
template
<
class
R
N
,
class
C
N
>
using
type
=
std
::
list
<
std
::
shared_ptr
<
DirichletBC
<
WorldVector
,
RangeType_t
<
R
N
>>>
>
;
};
template
<
class
RowBasis
,
class
ColBasis
>
...
...
src/amdis/DirichletBC.inc.hpp
View file @
0faff253
...
...
@@ -13,29 +13,28 @@
namespace
AMDiS
{
template
<
class
D
,
class
R
>
template
<
class
R
owBasis
,
class
C
olBasis
>
template
<
class
R
B
,
class
C
B
>
void
DirichletBC
<
D
,
R
>::
init
(
R
owBasis
const
&
rowBasis
,
C
olBasis
const
&
colBasis
)
init
(
R
B
const
&
rowBasis
,
C
B
const
&
colBasis
)
{
using
Dune
::
Functions
::
forEachBoundaryDOF
;
using
LV
=
typename
C
olBasis
::
LocalView
;
using
I
=
typename
C
olBasis
::
GridView
::
Intersection
;
using
LV
=
typename
C
B
::
LocalView
;
using
I
S
=
typename
C
B
::
GridView
::
Intersection
;
dirichletNodes_
.
resize
(
colBasis
.
dimension
());
forEachBoundaryDOF
(
colBasis
,
[
&
](
int
localIndex
,
LV
const
&
localView
,
I
const
&
intersection
)
{
forEachBoundaryDOF
(
colBasis
,
[
&
](
int
localIndex
,
LV
const
&
localView
,
I
S
const
&
intersection
)
{
dirichletNodes_
[
localView
.
index
(
localIndex
)]
=
onBoundary
(
intersection
);
});
}
template
<
class
D
,
class
R
>
template
<
class
Mat
rix
,
class
VectorX
,
class
VectorB
,
class
R
owNode
,
class
C
olNode
>
template
<
class
Mat
,
class
Sol
,
class
Rhs
,
class
R
N
,
class
C
N
>
void
DirichletBC
<
D
,
R
>::
fillBoundaryCondition
(
Matrix
&
matrix
,
VectorX
&
solution
,
VectorB
&
rhs
,
RowNode
const
&
rowNode
,
ColNode
const
&
colNode
)
fillBoundaryCondition
(
Mat
&
matrix
,
Sol
&
solution
,
Rhs
&
rhs
,
RN
const
&
rowNode
,
CN
const
&
colNode
)
{
auto
columns
=
Constraints
<
Mat
rix
>::
dirichletBC
(
matrix
,
dirichletNodes_
);
auto
columns
=
Constraints
<
Mat
>::
dirichletBC
(
matrix
,
dirichletNodes_
);
Dune
::
Hybrid
::
ifElse
(
std
::
is_same
<
RangeType_t
<
R
owNode
>
,
R
>
{},
Dune
::
Hybrid
::
ifElse
(
std
::
is_same
<
RangeType_t
<
R
N
>
,
R
>
{},
[
&
](
auto
id
)
{
auto
subBasis
=
Dune
::
Functions
::
subspaceBasis
(
rhs
.
basis
(),
rowNode
.
treePath
());
Dune
::
Functions
::
interpolate
(
subBasis
,
rhs
,
values_
,
dirichletNodes_
);
...
...
@@ -45,7 +44,7 @@ fillBoundaryCondition(Matrix& matrix, VectorX& solution, VectorB& rhs,
for
(
auto
const
&
triplet
:
columns
)
rhs
[
triplet
.
row
]
-=
triplet
.
value
*
solution
[
triplet
.
col
];
Dune
::
Hybrid
::
ifElse
(
std
::
is_same
<
RangeType_t
<
C
olNode
>
,
R
>
{},
Dune
::
Hybrid
::
ifElse
(
std
::
is_same
<
RangeType_t
<
C
N
>
,
R
>
{},
[
&
](
auto
id
)
{
auto
subBasis
=
Dune
::
Functions
::
subspaceBasis
(
solution
.
basis
(),
colNode
.
treePath
());
Dune
::
Functions
::
interpolate
(
subBasis
,
solution
,
values_
,
dirichletNodes_
);
...
...
src/amdis/GridFunctionOperator.hpp
View file @
0faff253
...
...
@@ -26,28 +26,30 @@ namespace AMDiS
*
* The class is specialized, by deriving from it, in \ref GridFunctionOperator.
*
* \tparam Derived
The class derived from GridFunctionOperatorBase
* \tparam L
ocalContext
The Element or Intersection type
* \tparam G
ridFunction
The GridFunction, a LocalFunction is created from, and
*
that is evaluated at quadrature points.
* \tparam Derived The class derived from GridFunctionOperatorBase
* \tparam L
C
The Element or Intersection type
* \tparam G
F
The GridFunction, a LocalFunction is created from, and
* that is evaluated at quadrature points.
*
* **Requirements:**
* - `L
ocalContext
` models either Entity (of codim 0) or Intersection
* - `G
ridFunction
` models the \ref Concepts::GridFunction
* - `L
C
` models either Entity (of codim 0) or Intersection
* - `G
F
` models the \ref Concepts::GridFunction
**/
template
<
class
Derived
,
class
L
ocalContext
,
class
GridFunction
>
template
<
class
Derived
,
class
L
C
,
class
GF
>
class
GridFunctionOperatorBase
:
public
LocalOperator
<
Derived
,
L
ocalContext
>
:
public
LocalOperator
<
Derived
,
L
C
>
{
template
<
class
D
,
class
LC
>
template
<
class
,
class
>
friend
class
LocalOperator
;
using
ContextType
=
Impl
::
ContextTypes
<
L
ocalContext
>
;
using
Super
=
LocalOperator
<
Derived
,
L
ocalContext
>
;
using
ContextType
=
Impl
::
ContextTypes
<
L
C
>
;
using
Super
=
LocalOperator
<
Derived
,
L
C
>
;
private:
using
GridFunction
=
GF
;
/// The type of the localFunction associated with the GridFunction
using
LocalFunction
=
decltype
(
localFunction
(
std
::
declval
<
G
ridFunction
>
()));
using
LocalFunction
=
decltype
(
localFunction
(
std
::
declval
<
G
F
>
()));
/// The Codim=0 entity of the grid, the localFunction can be bound to
using
Element
=
typename
ContextType
::
Entity
;
...
...
@@ -56,10 +58,10 @@ namespace AMDiS
using
Geometry
=
typename
Element
::
Geometry
;
/// The type of the local coordinates in the \ref Element
using
LocalCoordinate
=
typename
G
ridFunction
::
EntitySet
::
LocalCoordinate
;
using
LocalCoordinate
=
typename
G
F
::
EntitySet
::
LocalCoordinate
;
/// A factory for QuadratureRules that incooperate the order of the LocalFunction
using
QuadFactory
=
QuadratureFactory
<
typename
Geometry
::
ctype
,
L
ocalContext
::
mydimension
,
LocalFunction
>
;
using
QuadFactory
=
QuadratureFactory
<
typename
Geometry
::
ctype
,
L
C
::
mydimension
,
LocalFunction
>
;
public:
/// \brief Constructor. Stores a copy of `gridFct`.
...
...
@@ -68,19 +70,20 @@ namespace AMDiS
* differentiation order of the operator, to calculate the
* quadrature degree in \ref getDegree.
**/
template
<
class
G
F
>
GridFunctionOperatorBase
(
G
F
&&
gridFct
,
int
termOrder
)
template
<
class
G
ridFct
>
GridFunctionOperatorBase
(
G
ridFct
&&
gridFct
,
int
termOrder
)
:
gridFct_
(
FWD
(
gridFct
))
,
termOrder_
(
termOrder
)
{}
/// Create a quadrature factory from a PreQuadratureFactory, e.g. class derived from \ref QuadratureFactory
template
<
class
PreQuadFactory
>
void
setQuadFactory
(
PreQuadFactory
&&
pre
)
/// \tparam PQF A PreQuadratureFactory
template
<
class
PQF
>
void
setQuadFactory
(
PQF
&&
pre
)
{
using
ctype
=
typename
Geometry
::
ctype
;
quadFactory_
.
emplace
(
makeQuadratureFactory
<
ctype
,
L
ocalContext
::
mydimension
,
LocalFunction
>
(
FWD
(
pre
)));
makeQuadratureFactory
<
ctype
,
L
C
::
mydimension
,
LocalFunction
>
(
FWD
(
pre
)));
}
protected:
...
...
@@ -147,7 +150,7 @@ namespace AMDiS
class
GridFunctionOperatorTransposed
:
public
LocalOperator
<
Derived
,
typename
Transposed
::
LocalContext
>
{
template
<
class
D
,
class
LC
>
template
<
class
,
class
>
friend
class
LocalOperator
;
template
<
class
T
,
class
...
Args
>
...
...
@@ -161,8 +164,9 @@ namespace AMDiS
{}
/// Redirects the setQuadFactory call top the transposed operator
template
<
class
PreQuadFactory
>
void
setQuadFactory
(
PreQuadFactory
&&
pre
)
/// \tparam PQF A PreQuadratureFactory
template
<
class
PQF
>
void
setQuadFactory
(
PQF
&&
pre
)
{
transposedOp_
.
setQuadFactory
(
FWD
(
pre
));
}
...
...
@@ -182,15 +186,18 @@ namespace AMDiS
}
/// Apply the assembling to the transposed elementMatrix with interchanged row-/colNode
template
<
class
Context
,
class
RowNode
,
class
ColNode
,
class
ElementMatrix
>
void
getElementMatrix
(
Context
const
&
context
,
RowNode
const
&
rowNode
,
ColNode
const
&
colNode
,
ElementMatrix
&
elementMatrix
)
/**
* \tparam CG ContextGeometry
* \tparam RN RowNode
* \tparam CN ColNode
* \tparam Mat ElementMatrix
**/
template
<
class
CG
,
class
RN
,
class
CN
,
class
Mat
>
void
getElementMatrix
(
CG
const
&
contextGeometry
,
RN
const
&
rowNode
,
CN
const
&
colNode
,
Mat
&
elementMatrix
)
{
auto
elementMatrixTransposed
=
transposed
(
elementMatrix
);
transposedOp_
.
getElementMatrix
(
context
,
colNode
,
rowNode
,
elementMatrixTransposed
);
context
Geometry
,
colNode
,
rowNode
,
elementMatrixTransposed
);
}
private:
...
...
@@ -199,12 +206,12 @@ namespace AMDiS
#ifndef DOXYGEN
template
<
class
Tag
,
class
PreGridFct
,
class
P
reQuadFactory
>
template
<
class
Tag
,
class
PreGridFct
,
class
P
QF
>
struct
PreGridFunctionOperator
{
Tag
tag
;
PreGridFct
expr
;
P
reQuadFactory
quadFactory
;
P
QF
quadFactory
;
};
#endif
...
...
@@ -228,12 +235,12 @@ namespace AMDiS
* other effect.
*
* \tparam Tag An Identifier for this GridFunctionOperator
* \tparam L
ocalContext
An Element or Intersection the operator is evaluated on
* \tparam L
C
An Element or Intersection the operator is evaluated on
* \tparam GridFct A GridFunction evaluated in local coordinates on the bound element
**/
template
<
class
Tag
,
class
L
ocalContext
,
class
GridFct
>
template
<
class
Tag
,
class
L
C
,
class
GridFct
>
class
GridFunctionOperator
:
public
GridFunctionOperatorBase
<
GridFunctionOperator
<
Tag
,
L
ocalContext
,
GridFct
>
,
L
ocalContext
,
GridFct
>
:
public
GridFunctionOperatorBase
<
GridFunctionOperator
<
Tag
,
L
C
,
GridFct
>
,
L
C
,
GridFct
>
{};
template
<
class
Context
,
class
Tag
,
class
GF
,
class
QF
>
...
...
src/amdis/GridTransferManager.hpp
View file @
0faff253
...
...
@@ -17,7 +17,7 @@ namespace AMDiS
/// Static administration class for automatic handling of DOFVectors during grid adaption
class
GridTransferManager
{
template
<
class
T1
,
class
T2
>
template
<
class
,
class
>
friend
class
DOFVectorBase
;
using
Self
=
GridTransferManager
;
...
...
src/amdis/Integrate.hpp
View file @
0faff253
...
...
@@ -8,8 +8,8 @@ namespace AMDiS
{
namespace
Impl
{
template
<
class
GF
,
class
G
ridView
,
class
Q
uadProvider
>
auto
integrateImpl
(
GF
&&
gf
,
G
ridView
const
&
gridView
,
Q
uadProvider
makeQuad
)
template
<
class
GF
,
class
G
V
,
class
Q
P
>
auto
integrateImpl
(
GF
&&
gf
,
G
V
const
&
gridView
,
Q
P
makeQuad
)
{
auto
localFct
=
localFunction
(
FWD
(
gf
));
...
...
@@ -31,8 +31,8 @@ namespace AMDiS
return
result
;
}
template
<
class
GF
,
class
G
ridView
,
class
Q
uadProvider
>
auto
integrateImpl
(
GF
&&
gf
,
G
ridView
const
&
gv
,
Q
uadProvider
makeQuad
,
std
::
true_type
)
template
<
class
GF
,
class
G
V
,
class
Q
P
>
auto
integrateImpl
(
GF
&&
gf
,
G
V
const
&
gv
,
Q
P
makeQuad
,
std
::
true_type
)
{
return
integrateImpl
(
FWD
(
gf
),
gv
,
makeQuad
);
}
...
...
src/amdis/LocalOperator.hpp
View file @
0faff253
...
...
@@ -73,34 +73,29 @@ namespace AMDiS
/// \brief Assemble a local element matrix on the element that is bound.
/**
* \param context Container for geometry related data, \ref ContextGeometry
* \param context
Geo
Container for geometry related data, \ref ContextGeometry
* \param rowNode The node of the test-basis
* \param colNode The node of the trial-basis
* \param elementMatrix The output element matrix
**/
template
<
class
Context
,
class
RowNode
,
class
ColNode
,
class
ElementMatrix
>
void
calculateElementMatrix
(
Context
const
&
context
,
RowNode
const
&
rowNode
,
ColNode
const
&
colNode
,
ElementMatrix
&
elementMatrix
)
template
<
class
CG
,
class
RN
,
class
CN
,
class
Mat
>
void
calculateElementMatrix
(
CG
const
&
contextGeo
,
RN
const
&
rowNode
,
CN
const
&
colNode
,
Mat
&
elementMatrix
)
{
assert
(
bound_
);
derived
().
getElementMatrix
(
context
,
rowNode
,
colNode
,
elementMatrix
);
derived
().
getElementMatrix
(
context
Geo
,
rowNode
,
colNode
,
elementMatrix
);
}
/// \brief Assemble a local element vector on the element that is bound.
/**
* \param context Container for geometry related data \ref ContextGeometry
* \param context
Geo
Container for geometry related data \ref ContextGeometry
* \param node The node of the test-basis
* \param elementVector The output element vector
**/
template
<
class
Context
,
class
Node
,
class
ElementVector
>
void
calculateElementVector
(
Context
const
&
context
,
Node
const
&
node
,
ElementVector
&
elementVector
)
template
<
class
CG
,
class
Node
,
class
Vec
>
void
calculateElementVector
(
CG
const
&
contextGeo
,
Node
const
&
node
,
Vec
&
elementVector
)
{
assert
(
bound_
);
derived
().
getElementVector
(
context
,
node
,
elementVector
);
derived
().
getElementVector
(
context
Geo
,
node
,
elementVector
);
}
...
...
@@ -121,33 +116,17 @@ namespace AMDiS
// default implementation. Can be overridden in the derived classes
void
unbind_impl
()
{}
// default implementation called by \ref calculateElementMatrix
template
<
class
Context
,
class
RowNode
,
class
ColNode
,
class
ElementMatrix
>
void
getElementMatrix
(
Context
const
&
/*context*/
,
RowNode
const
&
/*rowNode*/
,
ColNode
const
&
/*colNode*/
,
ElementMatrix
&
/*elementMatrix*/
)
{
error_exit
(
"Needs to be implemented by derived class!"
);
}
// default implementation called by \ref calculateElementVector
template
<
class
Context
,
class
Node
,
class
ElementVector
>
void
getElementVector
(
Context
const
&
/*context*/
,
Node
const
&
/*node*/
,
ElementVector
&
/*elementVector*/
)
{
error_exit
(
"Needs to be implemented by derived class!"
);
}
/// \brief Return the quadrature degree for a matrix operator.
/**
* The quadrature degree that is necessary, to integrate the expression
* multiplied with (possibly derivatives of) shape functions. Thus it needs
* the order of derivatives, this operator implements.
*
* \tparam RN RowNode
* \tparam CN ColNode
**/
template
<
class
R
owNode
,
class
C
olNode
>
int
getDegree
(
int
order
,
int
coeffDegree
,
R
owNode
const
&
rowNode
,
C
olNode
const
&
colNode
)
const
template
<
class
R
N
,
class
C
N
>
int
getDegree
(
int
order
,
int
coeffDegree
,
R
N
const
&
rowNode
,
C
N
const
&
colNode
)
const
{
assert
(
bound_
);
test_warning
(
coeffDegree
>=
0
,
...
...
@@ -198,8 +177,13 @@ namespace AMDiS
/// Generate a \ref LocalOperator from a PreOperator.
template
<
class
Derived
,
class
Context
,
class
GridView
>
auto
makeLocalOperator
(
LocalOperator
<
Derived
,
Context
>
const
&
localOp
,
GridView
const
&
/*gridView*/
)
/**
* \tparam Derived Implementation of LocalOperator
* \tparam LC LocalContext
* \tparam GV GridView
**/
template
<
class
Derived
,
class
LC
,
class
GV
>
auto
makeLocalOperator
(
LocalOperator
<
Derived
,
LC
>
const
&
localOp
,
GV
const
&
/*gridView*/
)
{
return
localOp
.
derived
();
}
...
...
src/amdis/OperatorList.hpp
View file @
0faff253
...
...
@@ -26,10 +26,10 @@ namespace AMDiS
using
Element
=
typename
GridView
::
template
Codim
<
0
>
::
Entity
;
using
Intersection
=
typename
GridView
::
Intersection
;
template
<
class
Op
eratorType
>
template
<
class
Op
>
struct
DataElement
{
std
::
shared_ptr
<
Op
eratorType
>
op
;
std
::
shared_ptr
<
Op
>
op
;
BoundaryCondition
bc
;
};
...
...
src/amdis/PeriodicBC.hpp
View file @
0faff253
...
...
@@ -40,6 +40,10 @@ namespace AMDiS
/// Implements a periodic boundary condition
/**
* \tparam D Domain
* \tparam MI Type of the MultiIndex
**/
template
<
class
D
,
class
MI
>
class
PeriodicBC
:
public
BoundaryCondition
...
...
@@ -58,11 +62,11 @@ namespace AMDiS
,
faceTrafo_
(
std
::
move
(
faceTrafo
))
{}
template
<
class
R
owBasis
,
class
C
olBasis
>
void
init
(
R
owBasis
const
&
rowBasis
,
C
olBasis
const
&
colBasis
);
template
<
class
R
B
,
class
C
B
>
void
init
(
R
B
const
&
rowBasis
,
C
B
const
&
colBasis
);
template
<
class
Mat
rix
,
class
X
,
class
B
,
class
RN
,
class
CN
>
void
fillBoundaryCondition
(
Mat
rix
&
A
,
X
&
x
,
B
&
b
,
RN
const
&
rowNode
,
CN
const
&
colNode
);
template
<
class
Mat
,
class
Sol
,
class
Rhs
,
class
RN
,
class
CN
>
void
fillBoundaryCondition
(
Mat
&
A
,
Sol
&
x
,
Rhs
&
b
,
RN
const
&
rowNode
,
CN
const
&
colNode
);
auto
const
&
associations
()
const
{
...
...
src/amdis/PeriodicBC.inc.hpp
View file @
0faff253
...
...
@@ -11,9 +11,9 @@
namespace
AMDiS
{
template
<
class
D
,
class
MI
>
template
<
class
B
asis
,
class
C
olBasis
>
template
<
class
R
B
,
class
C
B
>
void
PeriodicBC
<
D
,
MI
>::
init
(
B
asis
const
&
basis
,
C
olBasis
const
&
/*colBasis*/
)
init
(
R
B
const
&
basis
,
C
B
const
&
/*colBasis*/
)
{
if
(
!
bool
(
hasConnectedIntersections_
))
{
hasConnectedIntersections_
=
true
;
...
...
@@ -231,12 +231,11 @@ coords(Node const& tree, std::vector<std::size_t> const& localIndices) const
template
<
class
D
,
class
MI
>
template
<
class
Mat
rix
,
class
VectorX
,
class
VectorB
,
class
R
owNode
,
class
C
olNode
>
template
<
class
Mat
,
class
Sol
,
class
Rhs
,
class
R
N
,
class
C
N
>
void
PeriodicBC
<
D
,
MI
>::
fillBoundaryCondition
(
Matrix
&
matrix
,
VectorX
&
solution
,
VectorB
&
rhs
,
RowNode
const
&
rowNode
,
ColNode
const
&
colNode
)
fillBoundaryCondition
(
Mat
&
matrix
,
Sol
&
solution
,
Rhs
&
rhs
,
RN
const
&
rowNode
,
CN
const
&
colNode
)
{
Constraints
<
Mat
rix
>::
periodicBC
(
matrix
,
periodicNodes_
,
associations_
);
Constraints
<
Mat
>::
periodicBC
(
matrix
,
periodicNodes_
,
associations_
);
for
(
auto
const
&
a
:
associations_
)
{
rhs
[
a
.
second
]
+=
rhs
[
a
.
first
];
...
...
src/amdis/gridfunctions/AnalyticGridFunction.hpp
View file @
0faff253
...
...
@@ -16,8 +16,8 @@ namespace AMDiS
class
AnalyticLocalFunction
;
#endif
template
<
class
R
,
class
D
,
class
L
ocalContext
,
class
Function
>
class
AnalyticLocalFunction
<
R
(
D
),
L
ocalContext
,
Function
>
template
<
class
R
,
class
D
,
class
L
C
,
class
Function
>
class
AnalyticLocalFunction
<
R
(
D
),
L
C
,
Function
>
{
public:
/// The LocalDomain this LocalFunction can be evaluated in
...
...
@@ -30,7 +30,7 @@ namespace AMDiS
enum
{
hasDerivative
=
true
};
private:
using
Geometry
=
typename
L
ocalContext
::
Geometry
;
using
Geometry
=
typename
L
C
::
Geometry
;
public:
/// \brief Constructor. stores the function `fct`.
...
...
@@ -39,7 +39,7 @@ namespace AMDiS
{}
/// \brief Create a geometry object from the element
void
bind
(
L
ocalContext
const
&
element
)
void
bind
(
L
C
const
&
element
)
{