Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F88618296
polonsky_keer_rey.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
Sat, Oct 19, 19:06
Size
4 KB
Mime Type
text/x-c++
Expires
Mon, Oct 21, 19:06 (2 d)
Engine
blob
Format
Raw Data
Handle
21787208
Attached To
rTAMAAS tamaas
polonsky_keer_rey.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 __POLONSKY_KEER_REY_HH__
#define __POLONSKY_KEER_REY_HH__
/* -------------------------------------------------------------------------- */
#include "contact_solver.hh"
#include "grid_view.hh"
#include "meta_functional.hh"
#include "westergaard.hh"
/* -------------------------------------------------------------------------- */
namespace
tamaas
{
class
PolonskyKeerRey
:
public
ContactSolver
{
public
:
/// Types of algorithm (primal/dual) or constraint
enum
type
{
gap
,
pressure
};
public
:
/// Constructor
PolonskyKeerRey
(
Model
&
model
,
const
GridBase
<
Real
>&
surface
,
Real
tolerance
,
type
variable_type
,
type
constraint_type
);
~
PolonskyKeerRey
()
override
=
default
;
public
:
using
ContactSolver
::
solve
;
/// Solve
Real
solve
(
std
::
vector
<
Real
>
target
)
override
;
/// Mean on unsaturated constraint zone
virtual
Real
meanOnUnsaturated
(
const
GridBase
<
Real
>&
field
)
const
;
/// Compute squared norm
virtual
Real
computeSquaredNorm
(
const
GridBase
<
Real
>&
field
)
const
;
/// Update search direction
virtual
void
updateSearchDirection
(
Real
factor
);
/// Compute critical step
virtual
Real
computeCriticalStep
(
Real
target
=
0
);
/// Update primal and check non-admissible state
virtual
bool
updatePrimal
(
Real
step
);
/// Compute error/stopping criterion
virtual
Real
computeError
();
/// Enforce contact constraints on final state
virtual
void
enforceAdmissibleState
();
/// Enfore mean value constraint
virtual
void
enforceMeanValue
(
Real
mean
);
private
:
/// Set correct views on normal traction and gap
template
<
model_type
type
>
void
setViews
();
protected
:
type
variable_type
,
constraint_type
;
model_type
operation_type
;
GridBase
<
Real
>*
primal
=
nullptr
;
///< non-owning pointer for primal varaible
GridBase
<
Real
>*
dual
=
nullptr
;
///< non-owning pointer for dual variable
/// CG search direction
std
::
unique_ptr
<
GridBase
<
Real
>>
search_direction
=
nullptr
;
/// Projected CG search direction
std
::
unique_ptr
<
GridBase
<
Real
>>
projected_search_direction
=
nullptr
;
/// View on normal pressure, gap, displacement
std
::
unique_ptr
<
GridBase
<
Real
>>
pressure_view
,
gap_view
,
displacement_view
=
nullptr
;
/// Integral operator for gradient computation
IntegralOperator
*
integral_op
=
nullptr
;
};
/* -------------------------------------------------------------------------- */
template
<
model_type
mtype
>
void
PolonskyKeerRey
::
setViews
()
{
constexpr
UInt
dim
=
model_type_traits
<
mtype
>::
dimension
;
constexpr
UInt
bdim
=
model_type_traits
<
mtype
>::
boundary_dimension
;
constexpr
UInt
comp
=
model_type_traits
<
mtype
>::
components
;
pressure_view
=
std
::
unique_ptr
<
GridBase
<
Real
>>
{
new
GridView
<
Grid
,
Real
,
bdim
,
bdim
>
(
model
.
getTraction
(),
{},
comp
-
1
)};
gap_view
=
std
::
unique_ptr
<
GridBase
<
Real
>>
{
new
GridView
<
Grid
,
Real
,
bdim
,
bdim
>
(
*
this
->
_gap
,
{},
comp
-
1
)};
displacement_view
=
std
::
unique_ptr
<
GridBase
<
Real
>>
{
new
GridView
<
Grid
,
Real
,
dim
,
bdim
>
(
model
.
getDisplacement
(),
model_type_traits
<
mtype
>::
indices
,
comp
-
1
)};
#define WESTERGAARD(type, kind, desc) \
this->model.registerIntegralOperator< \
Westergaard<model_type::type, IntegralOperator::kind>>(desc)
// I noz is fugly - TODO factory?
if
(
bdim
==
1
)
{
operation_type
=
model_type
::
basic_1d
;
if
(
variable_type
==
gap
)
integral_op
=
WESTERGAARD
(
basic_1d
,
dirichlet
,
"westergaard_dirichlet"
);
else
integral_op
=
WESTERGAARD
(
basic_1d
,
neumann
,
"westergaard_neumann"
);
}
else
if
(
bdim
==
2
)
{
operation_type
=
model_type
::
basic_2d
;
if
(
variable_type
==
gap
)
integral_op
=
WESTERGAARD
(
basic_2d
,
dirichlet
,
"westergaard_dirichlet"
);
else
integral_op
=
WESTERGAARD
(
basic_2d
,
neumann
,
"westergaard_neumann"
);
}
#undef WESTERGAARD
}
}
// namespace tamaas
#endif
// __POLONSKY_KEER_REY_HH__
Event Timeline
Log In to Comment