Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92334234
bem_grid_teboulle.cpp
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, Nov 19, 11:40
Size
2 KB
Mime Type
text/x-c
Expires
Thu, Nov 21, 11:40 (2 d)
Engine
blob
Format
Raw Data
Handle
22425297
Attached To
rTAMAAS tamaas
bem_grid_teboulle.cpp
View Options
/**
*
* @author Lucas Frérot <lucas.frerot@epfl.ch>
*
* @section LICENSE
*
* Copyright (©) 2016 EPFL (Ecole Polytechnique Fédérale de
* Lausanne) Laboratory (LSMS - Laboratoire de Simulation en Mécanique des
* Solides)
*
* Tamaas is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* Tamaas 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 Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Tamaas. If not, see <http://www.gnu.org/licenses/>.
*
*/
/* -------------------------------------------------------------------------- */
#include "bem_grid_teboulle.hh"
#include "surface_statistics.hh"
/* -------------------------------------------------------------------------- */
namespace tamaas {
BemGridTeboulle::BemGridTeboulle(Surface<Real>& s)
: BemGridKato(s), z(s.sizes(), 3), tractions_old(s.sizes(), 3) {}
/* -------------------------------------------------------------------------- */
BemGridTeboulle::~BemGridTeboulle() {}
/* -------------------------------------------------------------------------- */
void BemGridTeboulle::computeEquilibrium(Real tol,
const Grid<Real, 1>& g_target) {
this->computeInfluence();
Real f = 0, l = 0;
Real t[2] = {1, 1};
UInt n_iter = 0;
TAMAAS_ASSERT(g_target.dataSize() == 3,
"Applied pressure must have only 3 components");
// Real surface_mean = SurfaceStatistics::computeAverage(this->surface, 0);
// this->surface -= (surface_mean + g_target(2));
do {
applyInfluenceFunctions(z, displacements);
computeGaps(displacements);
updateGradient(const_cast<Grid<Real, 1>&>(g_target));
beta = computeLambda();
gaps /= lipschitz;
z -= gaps;
BemGrid::projectOnFrictionCone(z, mu);
tractions = z;
t[1] = (1. + std::sqrt(4 * t[0] * t[0] + 1)) / 2.;
l = 1 + (t[0] - 1) / t[1];
z -= tractions_old;
z *= l;
z += tractions_old;
t[0] = t[1];
tractions_old = tractions;
lambda -= beta;
f = computeStoppingCriterion();
printFriendlyMessage(n_iter, f);
} while (f > tol && n_iter++ < this->max_iter);
gaps *= lipschitz;
// computeDisplacementsFromTractions();
// computeGaps(displacements);
}
} // namespace tamaas
Event Timeline
Log In to Comment