-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e7b4aaf
commit 4299a23
Showing
10 changed files
with
102 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// SPDX-FileCopyrightText: 2021-2024 The Ikarus Developers [email protected] | ||
// SPDX-License-Identifier: LGPL-3.0-or-later | ||
|
||
#pragma once | ||
|
||
#include <dune/localfefunctions/impl/standardLocalFunction.hh> | ||
#include <dune/localfefunctions/manifolds/realTuple.hh> | ||
|
||
#include <ikarus/finiteelements/ferequirements.hh> | ||
|
||
namespace Ikarus::FEHelper { | ||
template <typename Traits, typename FERequirementType, typename DisplacementBasedElement, typename ScalarType> | ||
auto getDisplacementFunctionImpl(const DisplacementBasedElement ele, const FERequirementType& par, | ||
const std::optional<const Eigen::VectorX<ScalarType>>& dx = std::nullopt) { | ||
const auto& d = par.getGlobalSolution(Ikarus::FESolutions::displacement); | ||
Dune::BlockVector<Dune::RealTuple<ScalarType, Traits::worlddim>> disp(ele.dispAtNodes.size()); | ||
|
||
if (dx) | ||
for (auto i = 0U; i < disp.size(); ++i) | ||
for (auto j = 0U; j < Traits::worlddim; ++j) | ||
disp[i][j] = dx.value()[i * Traits::worlddim + j] | ||
+ d[ele.localView().index(ele.localView().tree().child(j).localIndex(i))[0]]; | ||
else | ||
for (auto i = 0U; i < disp.size(); ++i) | ||
for (auto j = 0U; j < Traits::worlddim; ++j) | ||
disp[i][j] = d[ele.localView().index(ele.localView().tree().child(j).localIndex(i))[0]]; | ||
|
||
auto geo | ||
= std::make_shared<const decltype(ele.localView().element().geometry())>(ele.localView().element().geometry()); | ||
|
||
Dune::StandardLocalFunction uFunction(ele.localBasis, disp, geo); | ||
return std::make_pair(uFunction, disp); | ||
} | ||
} // namespace Ikarus::FEHelper |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.