Commit ada6c3d7 authored by Chris Cantwell's avatar Chris Cantwell
Browse files

Added nodal tet support for CardiacEPSolver cell models.


git-svn-id: https://gforge.sci.utah.edu/svn/nektar/trunk@3992 305cdda6-5ce1-45b3-a98d-dfc68c8b3305
parent 70aef5b5
...@@ -83,7 +83,7 @@ namespace Nektar ...@@ -83,7 +83,7 @@ namespace Nektar
} }
// Use nodal projection if only triangles // Use nodal projection if only triangles
if (s.size() == 1 && (s.count(StdRegions::eTriangle) == 1)) if (s.size() == 1 && (s.count(StdRegions::eTriangle) == 1 || s.count(StdRegions::eTetrahedron) == 1))
{ {
m_useNodal = true; m_useNodal = true;
} }
...@@ -103,9 +103,14 @@ namespace Nektar ...@@ -103,9 +103,14 @@ namespace Nektar
LibUtilities::BasisKey B1( LibUtilities::BasisKey B1(
LibUtilities::eModified_B, order, LibUtilities::eModified_B, order,
LibUtilities::PointsKey(order, LibUtilities::eGaussRadauMAlpha1Beta0)); LibUtilities::PointsKey(order, LibUtilities::eGaussRadauMAlpha1Beta0));
LibUtilities::BasisKey B2(
LibUtilities::eModified_C, order,
LibUtilities::PointsKey(order, LibUtilities::eGaussRadauMAlpha2Beta0));
m_nodalTri = MemoryManager<StdRegions::StdNodalTriExp>::AllocateSharedPtr( m_nodalTri = MemoryManager<StdRegions::StdNodalTriExp>::AllocateSharedPtr(
B0, B1, LibUtilities::eNodalTriEvenlySpaced); B0, B1, LibUtilities::eNodalTriEvenlySpaced);
m_nodalTet = MemoryManager<StdRegions::StdNodalTetExp>::AllocateSharedPtr(
B0, B1, B2, LibUtilities::eNodalTetEvenlySpaced);
} }
else else
{ {
...@@ -175,9 +180,17 @@ namespace Nektar ...@@ -175,9 +180,17 @@ namespace Nektar
{ {
phys_offset = m_field->GetPhys_Offset(i); phys_offset = m_field->GetPhys_Offset(i);
coef_offset = m_field->GetCoeff_Offset(i); coef_offset = m_field->GetCoeff_Offset(i);
if (m_field->GetExp(0)->DetExpansionType() == StdRegions::eTriangle)
{
m_field->GetExp(0)->FwdTrans(inarray[k] + phys_offset, m_nodalTri->UpdateCoeffs()); m_field->GetExp(0)->FwdTrans(inarray[k] + phys_offset, m_nodalTri->UpdateCoeffs());
m_nodalTri->ModalToNodal(m_nodalTri->GetCoeffs(), tmp=m_nodalTmp[k]+coef_offset); m_nodalTri->ModalToNodal(m_nodalTri->GetCoeffs(), tmp=m_nodalTmp[k]+coef_offset);
} }
else
{
m_field->GetExp(0)->FwdTrans(inarray[k] + phys_offset, m_nodalTet->UpdateCoeffs());
m_nodalTet->ModalToNodal(m_nodalTet->GetCoeffs(), tmp=m_nodalTmp[k]+coef_offset);
}
}
} }
// Copy new transmembrane potential into cell model // Copy new transmembrane potential into cell model
Vmath::Vcopy(m_nq, m_nodalTmp[0], 1, m_cellSol[0], 1); Vmath::Vcopy(m_nq, m_nodalTmp[0], 1, m_cellSol[0], 1);
...@@ -226,9 +239,17 @@ namespace Nektar ...@@ -226,9 +239,17 @@ namespace Nektar
{ {
int phys_offset = m_field->GetPhys_Offset(i); int phys_offset = m_field->GetPhys_Offset(i);
int coef_offset = m_field->GetCoeff_Offset(i); int coef_offset = m_field->GetCoeff_Offset(i);
if (m_field->GetExp(0)->DetExpansionType() == StdRegions::eTriangle)
{
m_nodalTri->NodalToModal(m_wsp[k]+coef_offset, m_nodalTri->UpdateCoeffs()); m_nodalTri->NodalToModal(m_wsp[k]+coef_offset, m_nodalTri->UpdateCoeffs());
m_field->GetExp(0)->BwdTrans(m_nodalTri->GetCoeffs(), tmp=outarray[k] + phys_offset); m_field->GetExp(0)->BwdTrans(m_nodalTri->GetCoeffs(), tmp=outarray[k] + phys_offset);
} }
else
{
m_nodalTet->NodalToModal(m_wsp[k]+coef_offset, m_nodalTet->UpdateCoeffs());
m_field->GetExp(0)->BwdTrans(m_nodalTet->GetCoeffs(), tmp=outarray[k] + phys_offset);
}
}
} }
} }
else else
......
...@@ -114,6 +114,7 @@ namespace Nektar ...@@ -114,6 +114,7 @@ namespace Nektar
bool m_useNodal; bool m_useNodal;
/// StdNodalTri for cell model calculations /// StdNodalTri for cell model calculations
StdRegions::StdNodalTriExpSharedPtr m_nodalTri; StdRegions::StdNodalTriExpSharedPtr m_nodalTri;
StdRegions::StdNodalTetExpSharedPtr m_nodalTet;
/// Temporary array for nodal projection /// Temporary array for nodal projection
Array<OneD, Array<OneD, NekDouble> > m_nodalTmp; Array<OneD, Array<OneD, NekDouble> > m_nodalTmp;
......
Markdown is supported
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