Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93921495
local_law.cc
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
Mon, Dec 2, 13:01
Size
2 KB
Mime Type
text/x-c
Expires
Wed, Dec 4, 13:01 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
22722597
Attached To
rAKA akantu
local_law.cc
View Options
/* -------------------------------------------------------------------------- */
#include "local_law.hh"
#include "poisson_model.hh"
/* -------------------------------------------------------------------------- */
namespace akantu {
/* -------------------------------------------------------------------------- */
LocalLaw::LocalLaw(PoissonModel & model,
const ID & id)
: ConstitutiveLaw(model, id), was_stiffness_assembled(false) {
AKANTU_DEBUG_IN();
this->registerParam("permitivity", epsilon, Real(0.),
_pat_parsable | _pat_modifiable, "Medium Permitivity");
AKANTU_DEBUG_OUT();
}
/* -------------------------------------------------------------------------- */
void LocalLaw::initConstitutiveLaw() {
AKANTU_DEBUG_IN();
ConstitutiveLaw::initConstitutiveLaw();
AKANTU_DEBUG_OUT();
}
/* -------------------------------------------------------------------------- */
void LocalLaw::computeFlux(ElementType el_type,
GhostType ghost_type) {
Matrix<Real> identity(spatial_dimension, spatial_dimension);
identity.eye();
auto D = identity * this->epsilon;
// concentration gradient at quadrature points
auto & potential_gradient = gradient_dof(el_type, ghost_type);
fem.gradientOnIntegrationPoints(model.getDof(), potential_gradient, 1,
el_type, ghost_type);
for (auto && values :
zip(make_view(potential_gradient, spatial_dimension),
make_view(flux_dof(el_type, ghost_type), spatial_dimension))) {
const auto & BC = std::get<0>(values);
auto & d_BC = std::get<1>(values);
d_BC.mul<false>(D, BC);
}
}
/* -------------------------------------------------------------------------- */
void LocalLaw::computeTangentModuli(ElementType el_type,
Array<Real> & tangent_matrix,
GhostType ghost_type) {
AKANTU_DEBUG_IN();
Matrix<Real> identity(spatial_dimension, spatial_dimension);
identity.eye();
for (auto && tuple :
make_view(tangent_matrix, spatial_dimension, spatial_dimension)) {
tuple = identity * this->epsilon;
}
this->was_stiffness_assembled = true;
AKANTU_DEBUG_OUT();
}
static bool constiitutive_law_is_alocated_local_law [[gnu::unused]] =
ConstitutiveLawFactory::getInstance().registerAllocator(
"local_law",
[](const ID &, PoissonModel & model,
const ID & id) -> std::unique_ptr<ConstitutiveLaw> {
return std::make_unique<LocalLaw>(model, id);
});
} // namespace akantu
Event Timeline
Log In to Comment