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
ift
NIFTy
Commits
90cd3bf1
Commit
90cd3bf1
authored
May 15, 2020
by
Philipp Arras
Browse files
Add Integration operator
parent
83cc5351
Pipeline
#74993
passed with stages
in 24 minutes and 54 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty6/__init__.py
View file @
90cd3bf1
...
...
@@ -25,7 +25,7 @@ from .operators.adder import Adder
from
.operators.diagonal_operator
import
DiagonalOperator
from
.operators.distributors
import
DOFDistributor
,
PowerDistributor
from
.operators.domain_tuple_field_inserter
import
DomainTupleFieldInserter
from
.operators.contraction_operator
import
ContractionOperator
from
.operators.contraction_operator
import
ContractionOperator
,
IntegrationOperator
from
.operators.linear_interpolation
import
LinearInterpolator
from
.operators.endomorphic_operator
import
EndomorphicOperator
from
.operators.harmonic_operators
import
(
...
...
nifty6/linearization.py
View file @
90cd3bf1
...
...
@@ -11,7 +11,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright(C) 2013-20
19
Max-Planck-Society
# Copyright(C) 2013-20
20
Max-Planck-Society
#
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik.
...
...
@@ -270,10 +270,8 @@ class Linearization(Operator):
Linearization
the (partial) integral
"""
from
.operators.contraction_operator
import
ContractionOperator
return
self
.
new
(
self
.
_val
.
integrate
(
spaces
),
ContractionOperator
(
self
.
_jac
.
target
,
spaces
,
1
)(
self
.
_jac
))
from
.operators.contraction_operator
import
IntegrationOperator
return
IntegrationOperator
(
self
.
_target
,
spaces
)(
self
)
def
ptw
(
self
,
op
,
*
args
,
**
kwargs
):
t1
,
t2
=
self
.
_val
.
ptw_with_deriv
(
op
,
*
args
,
**
kwargs
)
...
...
nifty6/operator_spectrum.py
View file @
90cd3bf1
...
...
@@ -11,7 +11,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright(C) 2013-20
19
Max-Planck-Society
# Copyright(C) 2013-20
20
Max-Planck-Society
import
numpy
as
np
import
scipy.sparse.linalg
as
ssl
...
...
nifty6/operators/contraction_operator.py
View file @
90cd3bf1
...
...
@@ -11,7 +11,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright(C) 2013-20
19
Max-Planck-Society
# Copyright(C) 2013-20
20
Max-Planck-Society
#
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik.
...
...
@@ -69,3 +69,9 @@ class ContractionOperator(LinearOperator):
x
=
x
.
weight
(
self
.
_weight
,
spaces
=
self
.
_spaces
)
res
=
x
.
sum
(
self
.
_spaces
)
return
res
if
isinstance
(
res
,
Field
)
else
Field
.
scalar
(
res
)
def
IntegrationOperator
(
domain
,
spaces
):
domain
=
DomainTuple
.
make
(
domain
)
swgt
=
domain
.
scalar_weight
(
spaces
)
return
ContractionOperator
(
domain
,
spaces
,
swgt
)
nifty6/operators/operator.py
View file @
90cd3bf1
...
...
@@ -128,6 +128,10 @@ class Operator(metaclass=NiftyMeta):
from
.contraction_operator
import
ContractionOperator
return
ContractionOperator
(
self
.
target
,
spaces
)(
self
)
def
intergate
(
self
,
spaces
=
None
):
from
.contraction_operator
import
IntegrationOperator
return
IntegrationOperator
(
self
.
target
,
spaces
)(
self
)
def
vdot
(
self
,
other
):
from
..sugar
import
makeOp
if
not
isinstance
(
other
,
Operator
):
...
...
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