Commit 484282ce authored by thomaskummer's avatar thomaskummer
Browse files

cervin lifev update

parent 30808375
......@@ -41,7 +41,6 @@
// PatchBC
#include <lifev/em/examples/example_EMHeart/PatchBC.hpp>
// Track nan
// #include <fenv.h>
......@@ -55,7 +54,6 @@ int main (int argc, char** argv)
// feenableexcept(FE_INVALID | FE_OVERFLOW);
//============================================//
// Typedefs
//============================================//
......@@ -236,45 +234,6 @@ int main (int argc, char** argv)
function_Type stim = &HeartSolver<EMSolver<mesh_Type, monodomain_Type> >::Iapp;
//============================================//
// createPatch function
//============================================//
auto createPatch = [] (EMSolver<RegionMesh<LinearTetra>, EMMonodomainSolver<RegionMesh<LinearTetra> > >& solver, const Vector3D& center, const Real& radius, const int& currentFlag, const int& newFlag)
{
for (auto& mesh : solver.mesh())
{
for (int j(0); j < mesh->numBoundaryFacets(); j++)
{
auto& face = mesh->boundaryFacet(j);
auto faceFlag = face.markerID();
if (faceFlag == currentFlag || faceFlag == 470 || faceFlag == 471)
{
int numPointsInsidePatch (0);
for (int k(0); k < 3; ++k)
{
auto coord = face.point(k).coordinates();
bool pointInPatch = (coord - center).norm() < radius;
if (pointInPatch)
{
++numPointsInsidePatch;
}
}
if (numPointsInsidePatch > 2)
{
face.setMarkerID(newFlag);
}
}
}
}
};
// //============================================//
// // Create displacement patch b.c.
// //============================================//
......
......@@ -145,6 +145,41 @@ public:
M_circulationSolver.restartFromFile ( restartDir + "solution.dat" , nIter );
}
boost::shared_ptr<VectorEpetra> createPatch (EMSolver<RegionMesh<LinearTetra>, EMMonodomainSolver<RegionMesh<LinearTetra> > >& solver, const Vector3D& center, const Real& radius, const int& currentFlag, const int& newFlag)
{
for (auto& mesh : solver.mesh())
{
for (int j(0); j < mesh->numBoundaryFacets(); j++)
{
auto& face = mesh->boundaryFacet(j);
auto faceFlag = face.markerID();
if (faceFlag == currentFlag || faceFlag == 470 || faceFlag == 471)
{
int numPointsInsidePatch (0);
for (int k(0); k < 3; ++k)
{
auto coord = face.point(k).coordinates();
bool pointInPatch = (coord - center).norm() < radius;
if (pointInPatch)
{
++numPointsInsidePatch;
}
}
if (numPointsInsidePatch > 2)
{
face.setMarkerID(newFlag);
}
}
}
}
}
boost::shared_ptr<VectorEpetra> directionalVectorField (const boost::shared_ptr<FESpace<RegionMesh<LinearTetra>, MapEpetra >> dFeSpace, Vector3D& direction, const Real& disp)
{
boost::shared_ptr<VectorEpetra> vectorField (new VectorEpetra( dFeSpace->map(), Repeated ));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment