Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F65956148
integral_operator.hh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Jun 7, 08:19
Size
2 KB
Mime Type
text/x-c++
Expires
Sun, Jun 9, 08:19 (2 d)
Engine
blob
Format
Raw Data
Handle
18150745
Attached To
rTAMAAS tamaas
integral_operator.hh
View Options
/**
* @file
* @section LICENSE
*
* Copyright (©) 2016-2020 EPFL (École Polytechnique Fédérale de Lausanne),
* Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
/* -------------------------------------------------------------------------- */
#ifndef INTEGRAL_OPERATOR_HH
#define INTEGRAL_OPERATOR_HH
/* -------------------------------------------------------------------------- */
#include "grid_base.hh"
#include "model_type.hh"
/* -------------------------------------------------------------------------- */
namespace
tamaas
{
/* -------------------------------------------------------------------------- */
class
Model
;
/**
* @brief Generic class for integral operators
*/
class
IntegralOperator
{
public
:
/// Kind of operator
enum
kind
{
neumann
,
dirichlet
,
dirac
};
public
:
/// Constructor
IntegralOperator
(
Model
*
model
)
:
model
(
model
)
{}
/// Virtual destructor for subclasses
virtual
~
IntegralOperator
()
=
default
;
/// Apply operator on input
virtual
void
apply
(
GridBase
<
Real
>&
input
,
GridBase
<
Real
>&
output
)
const
=
0
;
/// Apply operator on filtered input
virtual
void
applyIf
(
GridBase
<
Real
>&
input
,
GridBase
<
Real
>&
output
,
std
::
function
<
bool
(
UInt
)
>
)
const
{
apply
(
input
,
output
);
}
/// Update any data dependent on model parameters
virtual
void
updateFromModel
()
=
0
;
/// Get model
const
Model
&
getModel
()
const
{
return
*
model
;
}
/// Kind
virtual
kind
getKind
()
const
=
0
;
/// Type
virtual
model_type
getType
()
const
=
0
;
/// Norm
virtual
Real
getOperatorNorm
()
{
TAMAAS_EXCEPTION
(
"operator does not implement norm"
);
}
protected
:
Model
*
model
=
nullptr
;
};
/* -------------------------------------------------------------------------- */
/* Printing IntegralOperator::kind to string */
/* -------------------------------------------------------------------------- */
std
::
ostream
&
operator
<<
(
std
::
ostream
&
o
,
const
IntegralOperator
::
kind
&
val
);
}
// namespace tamaas
#endif
// INTEGRAL_OPERATOR_HH
Event Timeline
Log In to Comment