Skip to content

Commit 3d9e1c9

Browse files
committed
CI
1 parent 618965c commit 3d9e1c9

File tree

6 files changed

+39
-23
lines changed

6 files changed

+39
-23
lines changed

src/Rodin/Variational/P1/Div.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ namespace Rodin::Variational
148148
{
149149
for (size_t j = 0; j < d; j++)
150150
{
151-
const auto basis = fe.getBasis(local);
151+
const auto& basis = fe.getBasis(local);
152152
for (size_t k = 0; k < d; k++)
153153
jacobian(j, k) = basis.template getDerivative<1>(j, k)(rc);
154154
}
@@ -249,7 +249,7 @@ namespace Rodin::Variational
249249
for (size_t local = 0; local < count; local++)
250250
{
251251
m_jacobian[local].resize(vdim, d);
252-
const auto basis = fe.getBasis(local);
252+
const auto& basis = fe.getBasis(local);
253253
for (size_t i = 0; i < vdim; i++)
254254
{
255255
for (size_t j = 0; j < d; j++)

src/Rodin/Variational/P1/Jacobian.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ namespace Rodin::Variational
139139
res.setZero();
140140
for (size_t local = 0; local < fe.getCount(); local++)
141141
{
142-
const auto basis = fe.getBasis(local);
142+
const auto& basis = fe.getBasis(local);
143143
for (size_t j = 0; j < d; j++)
144144
{
145145
for (size_t k = 0; k < d; k++)
@@ -245,7 +245,7 @@ namespace Rodin::Variational
245245
m_jacobian[local].resize(vdim, d);
246246
for (size_t i = 0; i < vdim; i++)
247247
{
248-
const auto basis = fe.getBasis(local);
248+
const auto& basis = fe.getBasis(local);
249249
for (size_t j = 0; j < d; j++)
250250
m_jacobian[local](i, j) = basis.template getDerivative<1>(i, j)(rc);
251251
}

src/Rodin/Variational/P1/LinearElasticity/LinearElasticityIntegral.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ namespace Rodin::Variational
9292
for (size_t i = 0; i < fe.getCount(); i++)
9393
{
9494
m_jac1[i].resize(d, d);
95-
const auto basis = fe.getBasis(i);
95+
const auto& basis = fe.getBasis(i);
9696
for (size_t j = 0; j < d; j++)
9797
{
9898
for (size_t k = 0; k < d; k++)

src/Rodin/Variational/P1/P1.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ namespace Rodin::Variational
467467
{
468468
case Geometry::Polytope::Type::Point:
469469
{
470-
static thread_local constexpr std::array<ElementType, RODIN_MAXIMAL_SPACE_DIMENSION + 1> s_elements =
470+
static thread_local std::array<ElementType, RODIN_MAXIMAL_SPACE_DIMENSION + 1> s_elements =
471471
{
472472
ElementType(0, Geometry::Polytope::Type::Point),
473473
ElementType(1, Geometry::Polytope::Type::Point),
@@ -478,7 +478,7 @@ namespace Rodin::Variational
478478
}
479479
case Geometry::Polytope::Type::Segment:
480480
{
481-
static thread_local constexpr std::array<ElementType, RODIN_MAXIMAL_SPACE_DIMENSION + 1> s_elements =
481+
static thread_local std::array<ElementType, RODIN_MAXIMAL_SPACE_DIMENSION + 1> s_elements =
482482
{
483483
ElementType(0, Geometry::Polytope::Type::Segment),
484484
ElementType(1, Geometry::Polytope::Type::Segment),
@@ -489,7 +489,7 @@ namespace Rodin::Variational
489489
}
490490
case Geometry::Polytope::Type::Triangle:
491491
{
492-
static thread_local constexpr std::array<ElementType, RODIN_MAXIMAL_SPACE_DIMENSION + 1> s_elements =
492+
static thread_local std::array<ElementType, RODIN_MAXIMAL_SPACE_DIMENSION + 1> s_elements =
493493
{
494494
ElementType(0, Geometry::Polytope::Type::Triangle),
495495
ElementType(1, Geometry::Polytope::Type::Triangle),
@@ -500,7 +500,7 @@ namespace Rodin::Variational
500500
}
501501
case Geometry::Polytope::Type::Quadrilateral:
502502
{
503-
static thread_local constexpr std::array<ElementType, RODIN_MAXIMAL_SPACE_DIMENSION + 1> s_elements =
503+
static thread_local std::array<ElementType, RODIN_MAXIMAL_SPACE_DIMENSION + 1> s_elements =
504504
{
505505
ElementType(0, Geometry::Polytope::Type::Quadrilateral),
506506
ElementType(1, Geometry::Polytope::Type::Quadrilateral),
@@ -511,7 +511,7 @@ namespace Rodin::Variational
511511
}
512512
case Geometry::Polytope::Type::Tetrahedron:
513513
{
514-
static thread_local constexpr std::array<ElementType, RODIN_MAXIMAL_SPACE_DIMENSION + 1> s_elements =
514+
static thread_local std::array<ElementType, RODIN_MAXIMAL_SPACE_DIMENSION + 1> s_elements =
515515
{
516516
ElementType(0, Geometry::Polytope::Type::Tetrahedron),
517517
ElementType(1, Geometry::Polytope::Type::Tetrahedron),
@@ -522,7 +522,7 @@ namespace Rodin::Variational
522522
}
523523
case Geometry::Polytope::Type::Wedge:
524524
{
525-
static thread_local constexpr std::array<ElementType, RODIN_MAXIMAL_SPACE_DIMENSION + 1> s_elements =
525+
static thread_local std::array<ElementType, RODIN_MAXIMAL_SPACE_DIMENSION + 1> s_elements =
526526
{
527527
ElementType(0, Geometry::Polytope::Type::Wedge),
528528
ElementType(1, Geometry::Polytope::Type::Wedge),
@@ -533,7 +533,7 @@ namespace Rodin::Variational
533533
}
534534
}
535535
assert(false);
536-
static thread_local constexpr ElementType s_null(0, Geometry::Polytope::Type::Point);
536+
static thread_local ElementType s_null(0, Geometry::Polytope::Type::Point);
537537
return s_null;
538538
}
539539

src/Rodin/Variational/P1/P1Element.h

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ namespace Rodin::Variational
7575
{}
7676

7777
constexpr
78-
LinearForm(const LinearForm&) = default;
78+
LinearForm(const LinearForm&) = delete;
7979

8080
template <class T>
8181
ScalarType operator()(const T& v) const
@@ -625,7 +625,7 @@ namespace Rodin::Variational
625625
{}
626626

627627
constexpr
628-
LinearForm(const LinearForm&) = default;
628+
LinearForm(const LinearForm&) = delete;
629629

630630
constexpr
631631
LinearForm(LinearForm&&) = default;
@@ -799,7 +799,16 @@ namespace Rodin::Variational
799799
constexpr
800800
P1Element(size_t vdim, Geometry::Polytope::Type geometry)
801801
: Parent(geometry), m_vdim(vdim)
802-
{}
802+
{
803+
const size_t count = this->getCount();
804+
m_lfs.reserve(count);
805+
m_bs.reserve(count);
806+
for (size_t i = 0; i < count; ++i)
807+
{
808+
m_lfs.emplace_back(vdim, i, geometry);
809+
m_bs.emplace_back(vdim, i, geometry);
810+
}
811+
}
803812

804813
constexpr
805814
P1Element(const P1Element& other)
@@ -816,6 +825,8 @@ namespace Rodin::Variational
816825
{
817826
Parent::operator=(other);
818827
m_vdim = other.m_vdim;
828+
m_lfs = other.m_lfs;
829+
m_bs = other.m_bs;
819830
return *this;
820831
}
821832

@@ -824,6 +835,8 @@ namespace Rodin::Variational
824835
{
825836
Parent::operator=(std::move(other));
826837
m_vdim = std::exchange(other.m_vdim, 0);
838+
m_lfs = std::move(other.m_lfs);
839+
m_bs = std::move(other.m_bs);
827840
return *this;
828841
}
829842

@@ -834,15 +847,15 @@ namespace Rodin::Variational
834847
}
835848

836849
constexpr
837-
LinearForm getLinearForm(size_t local) const
850+
const LinearForm& getLinearForm(size_t local) const
838851
{
839-
return LinearForm(m_vdim, local, this->getGeometry());
852+
return m_lfs[local];
840853
}
841854

842855
constexpr
843-
BasisFunction getBasis(size_t local) const
856+
const BasisFunction& getBasis(size_t local) const
844857
{
845-
return BasisFunction(m_vdim, local, this->getGeometry());
858+
return m_bs[local];
846859
}
847860

848861
constexpr
@@ -879,6 +892,9 @@ namespace Rodin::Variational
879892

880893
private:
881894
size_t m_vdim;
895+
896+
std::vector<LinearForm> m_lfs;
897+
std::vector<BasisFunction> m_bs;
882898
};
883899
}
884900

src/Rodin/Variational/P1/QuadratureRule.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,7 +1167,7 @@ namespace Rodin::Variational
11671167
m_jac1.resize(fe.getCount());
11681168
for (size_t i = 0; i < fe.getCount(); i++)
11691169
{
1170-
const auto basis = fe.getBasis(i);
1170+
const auto& basis = fe.getBasis(i);
11711171
for (size_t j = 0; j < d; j++)
11721172
{
11731173
for (size_t k = 0; k < d; k++)
@@ -1194,7 +1194,7 @@ namespace Rodin::Variational
11941194
m_jac1.resize(trialfe.getCount());
11951195
for (size_t i = 0; i < trialfe.getCount(); i++)
11961196
{
1197-
const auto basis = trialfe.getBasis(i);
1197+
const auto& basis = trialfe.getBasis(i);
11981198
for (size_t j = 0; j < d; j++)
11991199
{
12001200
for (size_t k = 0; k < d; k++)
@@ -1207,7 +1207,7 @@ namespace Rodin::Variational
12071207
m_jac2.resize(testfe.getCount());
12081208
for (size_t i = 0; i < testfe.getCount(); i++)
12091209
{
1210-
const auto basis = testfe.getBasis(i);
1210+
const auto& basis = testfe.getBasis(i);
12111211
for (size_t j = 0; j < d; j++)
12121212
{
12131213
for (size_t k = 0; k < d; k++)
@@ -1421,7 +1421,7 @@ namespace Rodin::Variational
14211421
m_jac1.resize(fe.getCount());
14221422
for (size_t i = 0; i < fe.getCount(); i++)
14231423
{
1424-
const auto basis = fe.getBasis(i);
1424+
const auto& basis = fe.getBasis(i);
14251425
for (size_t j = 0; j < d; j++)
14261426
{
14271427
for (size_t k = 0; k < d; k++)

0 commit comments

Comments
 (0)