Skip to content
Snippets Groups Projects
Commit 20e77595 authored by podlesny's avatar podlesny
Browse files

print regularity truncation info

parent 2c83d1c7
No related branches found
No related tags found
No related merge requests found
...@@ -14,6 +14,34 @@ ...@@ -14,6 +14,34 @@
//using namespace std; //using namespace std;
template <class Friction, typename VectorType>
void printRegularityTruncation(const Friction& friction, const VectorType& x, double truncationTolerance = 1e8) {
using BitVector = Dune::BitSetVector<MY_DIM>;
BitVector truncationFlags(x.size());
truncationFlags.unsetAll();
size_t count = 0;
size_t vsmall = 0;
for (size_t i = 0; i < x.size(); ++i) {
//std::cout << f_.phi().regularity(i, x[i]) << " xnorm: " << x[i].two_norm() << std::endl;
auto tangential_x = x[i];
tangential_x[0] = 0.0;
if (tangential_x.two_norm()<1e-14) {
vsmall++;
}
if (friction.regularity(i, x[i]) > truncationTolerance) {
count++;
}
}
std::cout << "V<1e-14: " << vsmall << " regularityTruncation: " << count << std::endl;
}
template <typename VectorType> template <typename VectorType>
auto average(const VectorType& vec) { auto average(const VectorType& vec) {
using BlockType = typename VectorType::block_type; using BlockType = typename VectorType::block_type;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment