Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Praetorius, Simon
dune-amdis
Commits
d1c40bd3
Commit
d1c40bd3
authored
Mar 08, 2019
by
Praetorius, Simon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add shortcuts zot(), fot(), and sot() for backward compatibility/similarity with old AMDiS
parent
138c15d3
Pipeline
#1785
passed with stage
in 37 minutes and 35 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
101 additions
and
0 deletions
+101
-0
src/amdis/localoperators/FirstOrderGradTestTrial.hpp
src/amdis/localoperators/FirstOrderGradTestTrial.hpp
+9
-0
src/amdis/localoperators/FirstOrderPartialTestTrial.hpp
src/amdis/localoperators/FirstOrderPartialTestTrial.hpp
+13
-0
src/amdis/localoperators/FirstOrderTestGradTrial.hpp
src/amdis/localoperators/FirstOrderTestGradTrial.hpp
+9
-0
src/amdis/localoperators/FirstOrderTestPartialTrial.hpp
src/amdis/localoperators/FirstOrderTestPartialTrial.hpp
+13
-0
src/amdis/localoperators/SecondOrderGradTestGradTrial.hpp
src/amdis/localoperators/SecondOrderGradTestGradTrial.hpp
+9
-0
src/amdis/localoperators/SecondOrderPartialTestPartialTrial.hpp
...dis/localoperators/SecondOrderPartialTestPartialTrial.hpp
+8
-0
src/amdis/localoperators/ZeroOrderTestTrial.hpp
src/amdis/localoperators/ZeroOrderTestTrial.hpp
+40
-0
No files found.
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
Markdown
is supported
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