added: extend element matrix cache support to mixed
This commit is contained in:
parent
a3555e8942
commit
ab6d03b141
@ -589,7 +589,7 @@ bool ASMs2Dmx::integrate (Integrand& integrand,
|
||||
|
||||
// Initialize element quantities
|
||||
LocalIntegral* A = integrand.getLocalIntegral(elem_size,fe.iel,false);
|
||||
if (!integrand.initElement(MNPC[iel-1],elem_size,nb,*A))
|
||||
if (!integrand.initElement(MNPC[iel-1],fe,elem_size,nb,*A))
|
||||
{
|
||||
A->destruct();
|
||||
ok = false;
|
||||
@ -914,7 +914,7 @@ bool ASMs2Dmx::integrate (Integrand& integrand,
|
||||
|
||||
// Initialize element quantities
|
||||
LocalIntegral* A = integrand.getLocalIntegral(elem_size,fe.iel);
|
||||
bool ok = integrand.initElement(MNPC[iel],elem_size,nb,*A);
|
||||
bool ok = integrand.initElement(MNPC[iel],fe,elem_size,nb,*A);
|
||||
size_t origSize = A->vec.size();
|
||||
|
||||
// Loop over the element edges with contributions
|
||||
@ -935,7 +935,7 @@ bool ASMs2Dmx::integrate (Integrand& integrand,
|
||||
|
||||
// initialize neighbor element
|
||||
LocalIntegral* A_neigh = integrand.getLocalIntegral(elem_size,kel+1);
|
||||
ok &= integrand.initElement(MNPC[kel],elem_size,nb,*A_neigh);
|
||||
ok &= integrand.initElement(MNPC[kel],fe,elem_size,nb,*A_neigh);
|
||||
if (!A_neigh->vec.empty()) {
|
||||
A->vec.resize(origSize+A_neigh->vec.size());
|
||||
std::copy(A_neigh->vec.begin(), A_neigh->vec.end(), A->vec.begin()+origSize);
|
||||
|
@ -547,7 +547,7 @@ bool ASMs3Dmx::integrate (Integrand& integrand,
|
||||
|
||||
// Initialize element quantities
|
||||
LocalIntegral* A = integrand.getLocalIntegral(elem_size,fe.iel,false);
|
||||
if (!integrand.initElement(MNPC[iel-1],elem_size,nb,*A))
|
||||
if (!integrand.initElement(MNPC[iel-1],fe,elem_size,nb,*A))
|
||||
{
|
||||
A->destruct();
|
||||
ok = false;
|
||||
@ -922,7 +922,7 @@ bool ASMs3Dmx::integrate (Integrand& integrand,
|
||||
|
||||
// Initialize element quantities
|
||||
LocalIntegral* A = integrand.getLocalIntegral(elem_size,fe.iel);
|
||||
bool ok = integrand.initElement(MNPC[iel],elem_size,nb,*A);
|
||||
bool ok = integrand.initElement(MNPC[iel],fe,elem_size,nb,*A);
|
||||
size_t origSize = A->vec.size();
|
||||
|
||||
// Loop over the element edges with contributions
|
||||
@ -953,7 +953,7 @@ bool ASMs3Dmx::integrate (Integrand& integrand,
|
||||
|
||||
// initialize neighbor element
|
||||
LocalIntegral* A_neigh = integrand.getLocalIntegral(elem_size,kel+1);
|
||||
ok &= integrand.initElement(MNPC[kel],elem_size,nb,*A_neigh);
|
||||
ok &= integrand.initElement(MNPC[kel],fe,elem_size,nb,*A_neigh);
|
||||
if (!A_neigh->vec.empty()) {
|
||||
A->vec.resize(origSize+A_neigh->vec.size());
|
||||
std::copy(A_neigh->vec.begin(), A_neigh->vec.end(), A->vec.begin()+origSize);
|
||||
|
@ -315,7 +315,9 @@ bool GlbL2::initElement (const IntVec& MNPC, const FiniteElement& fe,
|
||||
|
||||
|
||||
bool GlbL2::initElement (const IntVec& MNPC1,
|
||||
const uIntVec& elem_sizes, const uIntVec& basis_sizes,
|
||||
const MxFiniteElement& fe,
|
||||
const uIntVec& elem_sizes,
|
||||
const uIntVec& basis_sizes,
|
||||
LocalIntegral& elmInt)
|
||||
{
|
||||
L2Mats& gl2 = static_cast<L2Mats&>(elmInt);
|
||||
|
@ -147,15 +147,22 @@ public:
|
||||
LocalIntegral& elmInt);
|
||||
//! \brief Initializes current element for numerical integration (mixed).
|
||||
//! \param[in] MNPC1 Matrix of nodal point correspondance for current element
|
||||
//! \param[in] fe Nodal and integration point data for current element
|
||||
//! \param[in] elem_sizes Size of each basis on the element
|
||||
//! \param[in] basis_sizes Size of each basis on the patch
|
||||
//! \param elmInt Local integral for element
|
||||
virtual bool initElement(const IntVec& MNPC1,
|
||||
const MxFiniteElement& fe,
|
||||
const uIntVec& elem_sizes,
|
||||
const uIntVec& basis_sizes,
|
||||
LocalIntegral& elmInt);
|
||||
|
||||
//! \brief Dummy implementation.
|
||||
virtual bool initElement(const IntVec& MNPC1,
|
||||
const uIntVec& elem_sizes,
|
||||
const uIntVec& basis_sizes,
|
||||
LocalIntegral& elmInt) { return false; }
|
||||
//! \brief Dummy implementation.
|
||||
virtual bool initElement(const IntVec&, LocalIntegral&) { return false; }
|
||||
//! \brief Dummy implementation.
|
||||
virtual bool initElementBou(const IntVec&, LocalIntegral&) { return false; }
|
||||
|
@ -121,6 +121,17 @@ public:
|
||||
const std::vector<size_t>& elem_sizes,
|
||||
const std::vector<size_t>& basis_sizes,
|
||||
LocalIntegral& elmInt) = 0;
|
||||
//! \brief Initializes current element for numerical integration (mixed).
|
||||
//! \param[in] MNPC Nodal point correspondance for the bases
|
||||
//! \param[in] fe Nodal and integration point data for current element
|
||||
//! \param[in] elem_sizes Size of each basis on the element
|
||||
//! \param[in] basis_sizes Size of each basis on the patch level
|
||||
//! \param elmInt Local integral for element
|
||||
virtual bool initElement(const std::vector<int>& MNPC,
|
||||
const MxFiniteElement& fe,
|
||||
const std::vector<size_t>& elem_sizes,
|
||||
const std::vector<size_t>& basis_sizes,
|
||||
LocalIntegral& elmInt) = 0;
|
||||
|
||||
//! \brief Initializes current element for boundary integration.
|
||||
//! \param[in] MNPC Matrix of nodal point correspondance for current element
|
||||
|
@ -159,6 +159,16 @@ bool IntegrandBase::initElement (const std::vector<int>& MNPC,
|
||||
}
|
||||
|
||||
|
||||
bool IntegrandBase::initElement (const std::vector<int>& MNPC,
|
||||
const MxFiniteElement&,
|
||||
const std::vector<size_t>& elem_sizes,
|
||||
const std::vector<size_t>& basis_sizes,
|
||||
LocalIntegral& elmInt)
|
||||
{
|
||||
return this->initElement(MNPC, elem_sizes, basis_sizes, elmInt);
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
The default implementation extracts the element-level vector only for the
|
||||
first (current) primary solution vector.
|
||||
|
@ -131,6 +131,17 @@ public:
|
||||
const std::vector<size_t>& elem_sizes,
|
||||
const std::vector<size_t>& basis_sizes,
|
||||
LocalIntegral& elmInt);
|
||||
//! \brief Initializes current element for numerical integration (mixed).
|
||||
//! \param[in] MNPC Matrix of nodal point correspondance for current element
|
||||
//! \param[in] fe Nodal and integration point data for current element
|
||||
//! \param[in] elem_sizes Size of each basis on the element
|
||||
//! \param[in] basis_sizes Size of each basis on the patch
|
||||
//! \param elmInt Local integral for element
|
||||
virtual bool initElement(const std::vector<int>& MNPC,
|
||||
const MxFiniteElement& fe,
|
||||
const std::vector<size_t>& elem_sizes,
|
||||
const std::vector<size_t>& basis_sizes,
|
||||
LocalIntegral& elmInt);
|
||||
|
||||
//! \brief Initializes current element for boundary integration.
|
||||
//! \param[in] MNPC Matrix of nodal point correspondance for current element
|
||||
@ -359,6 +370,14 @@ public:
|
||||
const std::vector<size_t>& elem_sizes,
|
||||
const std::vector<size_t>& basis_sizes,
|
||||
LocalIntegral& elmInt);
|
||||
//! \brief Initializes current element for numerical integration (mixed).
|
||||
virtual bool initElement(const std::vector<int>& MNPC,
|
||||
const MxFiniteElement&,
|
||||
const std::vector<size_t>& elem_sizes,
|
||||
const std::vector<size_t>& basis_sizes,
|
||||
LocalIntegral& elmInt)
|
||||
{ return this->initElement(MNPC,elem_sizes,basis_sizes,elmInt); }
|
||||
|
||||
|
||||
//! \brief Initializes current element for boundary integration.
|
||||
virtual bool initElementBou(const std::vector<int>& MNPC,
|
||||
@ -489,6 +508,14 @@ public:
|
||||
LocalIntegral&)
|
||||
{ return false; }
|
||||
|
||||
//! \brief Dummy implementation (only boundary integration is relevant).
|
||||
virtual bool initElement(const std::vector<int>&,
|
||||
const MxFiniteElement&,
|
||||
const std::vector<size_t>&,
|
||||
const std::vector<size_t>&,
|
||||
LocalIntegral&)
|
||||
{ return false; }
|
||||
|
||||
//! \brief Initializes current element for boundary integration.
|
||||
virtual bool initElementBou(const std::vector<int>& MNPC,
|
||||
LocalIntegral& elmInt);
|
||||
|
@ -363,7 +363,7 @@ bool ASMu2Dmx::integrate (Integrand& integrand,
|
||||
|
||||
// Initialize element quantities
|
||||
LocalIntegral* A = integrand.getLocalIntegral(elem_sizes,fe.iel,false);
|
||||
if (!integrand.initElement(MNPC[geoEl-1], elem_sizes, nb, *A))
|
||||
if (!integrand.initElement(MNPC[geoEl-1], fe, elem_sizes, nb, *A))
|
||||
{
|
||||
A->destruct();
|
||||
ok = false;
|
||||
|
@ -472,7 +472,7 @@ bool ASMu3Dmx::integrate (Integrand& integrand,
|
||||
|
||||
// Initialize element quantities
|
||||
LocalIntegral* A = integrand.getLocalIntegral(elem_sizes,fe.iel);
|
||||
if (!integrand.initElement(MNPC[iEl],elem_sizes,nb,*A))
|
||||
if (!integrand.initElement(MNPC[iEl],fe,elem_sizes,nb,*A))
|
||||
{
|
||||
A->destruct();
|
||||
ok = false;
|
||||
|
Loading…
Reference in New Issue
Block a user