Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F61533393
elastic_functional.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
Tue, May 7, 06:35
Size
2 KB
Mime Type
text/x-c++
Expires
Thu, May 9, 06:35 (2 d)
Engine
blob
Format
Raw Data
Handle
17524687
Attached To
rTAMAAS tamaas
elastic_functional.hh
View Options
/**
* @file
* LICENSE
*
* Copyright (©) 2016-2021 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 ELASTIC_FUNCTIONAL_HH
#define ELASTIC_FUNCTIONAL_HH
/* -------------------------------------------------------------------------- */
#include "functional.hh"
#include "model.hh"
#include "tamaas.hh"
/* -------------------------------------------------------------------------- */
namespace
tamaas
{
namespace
functional
{
/// Generic functional for elastic energy
class
ElasticFunctional
:
public
Functional
{
public
:
ElasticFunctional
(
const
IntegralOperator
&
op
,
const
GridBase
<
Real
>&
surface
)
:
Functional
(),
op
(
op
),
surface
(
surface
)
{
const
Model
&
model
=
op
.
getModel
();
buffer
=
allocateGrid
<
true
,
Real
>
(
op
.
getType
(),
model
.
getBoundaryDiscretization
());
}
protected
:
const
IntegralOperator
&
op
;
const
GridBase
<
Real
>&
surface
;
std
::
unique_ptr
<
GridBase
<
Real
>>
mutable
buffer
;
};
/* -------------------------------------------------------------------------- */
/// Functional with pressure as primal field
class
ElasticFunctionalPressure
:
public
ElasticFunctional
{
public
:
using
ElasticFunctional
::
ElasticFunctional
;
/// Compute functional with input pressure
Real
computeF
(
GridBase
<
Real
>&
pressure
,
GridBase
<
Real
>&
dual
)
const
override
;
/// Compute functional gradient with input pressure
void
computeGradF
(
GridBase
<
Real
>&
pressure
,
GridBase
<
Real
>&
gradient
)
const
override
;
};
/* -------------------------------------------------------------------------- */
/// Functional with gap as primal field
class
ElasticFunctionalGap
:
public
ElasticFunctional
{
public
:
using
ElasticFunctional
::
ElasticFunctional
;
/// Compute functional with input gap
Real
computeF
(
GridBase
<
Real
>&
gap
,
GridBase
<
Real
>&
dual
)
const
override
;
/// Compute functional gradient with input gap
void
computeGradF
(
GridBase
<
Real
>&
gap
,
GridBase
<
Real
>&
gradient
)
const
override
;
};
}
// namespace functional
}
// namespace tamaas
/* -------------------------------------------------------------------------- */
#endif
// ELASTIC_FUNCTIONAL_HH
Event Timeline
Log In to Comment