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
d1c40bd3
Commit
d1c40bd3
authored
Mar 08, 2019
by
Praetorius, Simon
Browse files
add shortcuts zot(), fot(), and sot() for backward compatibility/similarity with old AMDiS
parent
138c15d3
Changes
7
Hide whitespace changes
Inline
Side-by-side
src/amdis/localoperators/FirstOrderGradTestTrial.hpp
View file @
d1c40bd3
...
...
@@ -14,6 +14,7 @@ namespace AMDiS
namespace
tag
{
struct
gradtest_trial
{};
struct
grad_test
{};
}
...
...
@@ -33,6 +34,14 @@ namespace AMDiS
{}
};
/// Create a first-order term with derivative on trial-function
template
<
class
Expr
,
class
...
QuadratureArgs
>
auto
fot
(
Expr
&&
expr
,
tag
::
grad_test
,
QuadratureArgs
&&
...
args
)
{
return
makeOperator
(
tag
::
gradtest_trial
{},
FWD
(
expr
),
FWD
(
args
)...);
}
/** @} **/
}
// end namespace AMDiS
src/amdis/localoperators/FirstOrderPartialTestTrial.hpp
View file @
d1c40bd3
...
...
@@ -17,6 +17,11 @@ namespace AMDiS
{
std
::
size_t
comp
;
};
struct
partial_test
{
std
::
size_t
comp
;
};
}
...
...
@@ -36,6 +41,14 @@ namespace AMDiS
{}
};
/// Create a first-order term with derivative on trial-function
template
<
class
Expr
,
class
...
QuadratureArgs
>
auto
fot
(
Expr
&&
expr
,
tag
::
partial_test
t
,
QuadratureArgs
&&
...
args
)
{
return
makeOperator
(
tag
::
partialtest_trial
{
t
.
comp
},
FWD
(
expr
),
FWD
(
args
)...);
}
/** @} **/
}
// end namespace AMDiS
src/amdis/localoperators/FirstOrderTestGradTrial.hpp
View file @
d1c40bd3
...
...
@@ -17,6 +17,7 @@ namespace AMDiS
namespace
tag
{
struct
test_gradtrial
{};
struct
grad_trial
{};
}
...
...
@@ -97,6 +98,14 @@ namespace AMDiS
}
};
/// Create a first-order term with derivative on test-function
template
<
class
Expr
,
class
...
QuadratureArgs
>
auto
fot
(
Expr
&&
expr
,
tag
::
grad_trial
,
QuadratureArgs
&&
...
args
)
{
return
makeOperator
(
tag
::
test_gradtrial
{},
FWD
(
expr
),
FWD
(
args
)...);
}
/** @} **/
}
// end namespace AMDiS
src/amdis/localoperators/FirstOrderTestPartialTrial.hpp
View file @
d1c40bd3
...
...
@@ -20,6 +20,11 @@ namespace AMDiS
{
std
::
size_t
comp
;
};
struct
partial_trial
{
std
::
size_t
comp
;
};
}
...
...
@@ -104,6 +109,14 @@ namespace AMDiS
std
::
size_t
comp_
;
};
/// Create a first-order term with derivative on trial-function
template
<
class
Expr
,
class
...
QuadratureArgs
>
auto
fot
(
Expr
&&
expr
,
tag
::
partial_trial
t
,
QuadratureArgs
&&
...
args
)
{
return
makeOperator
(
tag
::
test_partialtrial
{
t
.
comp
},
FWD
(
expr
),
FWD
(
args
)...);
}
/** @} **/
}
// end namespace AMDiS
src/amdis/localoperators/SecondOrderGradTestGradTrial.hpp
View file @
d1c40bd3
...
...
@@ -230,6 +230,15 @@ namespace AMDiS
}
};
/// Create a second-order term
template
<
class
Expr
,
class
...
QuadratureArgs
>
auto
sot
(
Expr
&&
expr
,
QuadratureArgs
&&
...
args
)
{
auto
pqf
=
makePreQuadratureFactory
(
FWD
(
args
)...);
using
PreOp
=
PreGridFunctionOperator
<
tag
::
gradtest_gradtrial
,
TYPEOF
(
expr
),
TYPEOF
(
pqf
)
>
;
return
PreOp
{
tag
::
gradtest_gradtrial
{},
FWD
(
expr
),
std
::
move
(
pqf
)};
}
/** @} **/
}
// end namespace AMDiS
src/amdis/localoperators/SecondOrderPartialTestPartialTrial.hpp
View file @
d1c40bd3
...
...
@@ -114,6 +114,14 @@ namespace AMDiS
std
::
size_t
compTrial_
;
};
/// Create a second-order term of partial derivatives
template
<
class
Expr
,
class
...
QuadratureArgs
>
auto
sot_ij
(
Expr
&&
expr
,
std
::
size_t
comp_test
,
std
::
size_t
comp_trial
,
QuadratureArgs
&&
...
args
)
{
return
makeOperator
(
tag
::
partialtest_partialtrial
{
comp_test
,
comp_trial
},
FWD
(
expr
),
FWD
(
args
)...);
}
/** @} **/
}
// end namespace AMDiS
src/amdis/localoperators/ZeroOrderTestTrial.hpp
View file @
d1c40bd3
...
...
@@ -51,7 +51,39 @@ namespace AMDiS
getElementMatrixStandard
(
context
,
quad
,
rowNode
,
colNode
,
elementMatrix
);
}
template
<
class
Context
,
class
Node
,
class
ElementVector
>
void
getElementVector
(
Context
const
&
context
,
Node
const
&
node
,
ElementVector
&
elementVector
)
{
static_assert
(
Node
::
isLeaf
,
"Operator can be applied to Leaf-Nodes only"
);
auto
const
&
quad
=
this
->
getQuadratureRule
(
context
.
type
(),
node
);
auto
const
&
localFE
=
node
.
finiteElement
();
std
::
size_t
size
=
localFE
.
size
();
NodeQuadCache
<
Node
>
cache
(
localFE
.
localBasis
());
auto
const
&
shapeValuesCache
=
cache
.
evaluateFunctionAtQP
(
context
,
quad
);
for
(
std
::
size_t
iq
=
0
;
iq
<
quad
.
size
();
++
iq
)
{
// Position of the current quadrature point in the reference element
decltype
(
auto
)
local
=
context
.
local
(
quad
[
iq
].
position
());
// The multiplicative factor in the integral transformation formula
const
auto
factor
=
Super
::
coefficient
(
local
)
*
context
.
integrationElement
(
quad
[
iq
].
position
())
*
quad
[
iq
].
weight
();
auto
const
&
shapeValues
=
shapeValuesCache
[
iq
];
for
(
std
::
size_t
i
=
0
;
i
<
size
;
++
i
)
{
const
auto
local_i
=
node
.
localIndex
(
i
);
elementVector
[
local_i
]
+=
factor
*
shapeValues
[
i
];
}
}
}
protected:
template
<
class
Context
,
class
QuadratureRule
,
class
RowNode
,
class
ColNode
,
class
ElementMatrix
>
void
getElementMatrixStandard
(
Context
const
&
context
,
QuadratureRule
const
&
quad
,
...
...
@@ -138,6 +170,14 @@ namespace AMDiS
}
};
/// Create a zero-order term
template
<
class
Expr
,
class
...
QuadratureArgs
>
auto
zot
(
Expr
&&
expr
,
QuadratureArgs
&&
...
args
)
{
return
makeOperator
(
tag
::
test_trial
{},
FWD
(
expr
),
FWD
(
args
)...);
}
/** @} **/
}
// end namespace AMDiS
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