@@ -21,14 +21,27 @@ namespace Rodin::Assembly
2121 : public AssemblyBase<LinearSystem, Variational::Problem<LinearSystem, TrialFunction, TestFunction>>
2222 {
2323 public:
24- using LinearSystemType = LinearSystem;
24+ using LinearSystemType =
25+ LinearSystem;
2526
2627 using TrialFESType =
2728 typename FormLanguage::Traits<TrialFunction>::FESType;
2829
2930 using TestFESType =
3031 typename FormLanguage::Traits<TestFunction>::FESType;
3132
33+ using TrialFESMeshType =
34+ typename FormLanguage::Traits<TrialFESType>::MeshType;
35+
36+ using TestFESMeshType =
37+ typename FormLanguage::Traits<TestFESType>::MeshType;
38+
39+ using TrialFESMeshContextType =
40+ typename FormLanguage::Traits<TrialFESMeshType>::ContextType;
41+
42+ using TestFESMeshContextType =
43+ typename FormLanguage::Traits<TestFESMeshType>::ContextType;
44+
3245 using OperatorType =
3346 typename FormLanguage::Traits<LinearSystemType>::OperatorType;
3447
@@ -41,17 +54,19 @@ namespace Rodin::Assembly
4154 using SolutionType =
4255 typename FormLanguage::Traits<TrialFunction>::SolutionType;
4356
44- using LinearFormType =
45- Variational::LinearForm<TestFESType, VectorType>;
46-
47- using DirichletBCType =
48- Variational::DirichletBC<TrialFunction, VectorType>;
49-
5057 using BilinearFormType =
5158 Variational::BilinearForm<SolutionType, TrialFESType, TestFESType, OperatorType>;
5259
53- using LinearFormIntegratorBaseListType =
54- FormLanguage::List<Variational::LinearFormIntegratorBase<ScalarType>>;
60+ using BilinearFormAssemblyType =
61+ typename Assembly::Default<TrialFESMeshContextType, TestFESMeshContextType>
62+ ::template Type<OperatorType, BilinearFormType>;
63+
64+ using LinearFormType =
65+ Variational::LinearForm<TestFESType, VectorType>;
66+
67+ using LinearFormAssemblyType =
68+ typename Assembly::Default<TestFESMeshContextType>
69+ ::template Type<VectorType, LinearFormType>;
5570
5671 using Parent =
5772 AssemblyBase<LinearSystem, Variational::Problem<LinearSystem, TrialFunction, TestFunction>>;
@@ -71,65 +86,57 @@ namespace Rodin::Assembly
7186
7287 void execute (LinearSystem& out, const InputType& input) const override
7388 {
74- // const auto& u = input.getTrialFunction();
75- // const auto& v = input.getTestFunction();
76- // const auto& trialFES = u.getFiniteElementSpace();
77- // const auto& testFES = v.getFiniteElementSpace();
78- // auto& pb = input.getProblemBody();
79- // auto& [stiffness, solution, mass] = out;
80-
81- // m_bfa.execute(stiffness, { u.getFiniteElementSpace(), v.getFiniteElementSpace(), pb.getLocalBFIs(), pb.getGlobalBFIs() });
82- // for (auto& bf : pb.getBFs())
83- // stiffness += bf.getOperator();
84-
85- // m_lfa.execute(mass, { v.getFiniteElementSpace(), pb.getLFIs() });
86- // mass *= -1;
87-
88- // for (auto& dbc : pb.getDBCs())
89- // {
90- // dbc.assemble();
91- // const auto& dofs = dbc.getDOFs();
92- // if (dbc.isComponent())
93- // {
94- // assert(false);
95- // }
96- // else
97- // {
98- // out.eliminate(dofs);
99- // }
100- // }
101-
102- // if (trialFES == testFES)
103- // {
104- // for (auto& pbc : pb.getPBCs())
105- // {
106- // pbc.assemble();
107- // const auto& dofs = pbc.getDOFs();
108-
109- // if (pbc.isComponent())
110- // {
111- // assert(false);
112- // }
113- // else
114- // {
115- // out.merge(dofs);
116- // }
117- // }
118- // }
119- // else
120- // {
121- // assert(false); // Not handled yet
122- // }
89+ const auto & u = input.getTrialFunction ();
90+ const auto & v = input.getTestFunction ();
91+ const auto & trialFES = u.getFiniteElementSpace ();
92+ const auto & testFES = v.getFiniteElementSpace ();
93+ auto & pb = input.getProblemBody ();
94+ auto & [stiffness, solution, mass] = out;
95+
96+ const BilinearFormAssemblyType bfa;
97+ bfa.execute (
98+ stiffness,
99+ {
100+ u.getFiniteElementSpace (),
101+ v.getFiniteElementSpace (),
102+ pb.getLocalBFIs (),
103+ pb.getGlobalBFIs ()
104+ });
105+
106+ for (auto & bf : pb.getBFs ())
107+ stiffness += bf.getOperator ();
108+
109+ const LinearFormAssemblyType lfa;
110+ lfa.execute (
111+ mass,
112+ {
113+ v.getFiniteElementSpace (),
114+ pb.getLFIs ()
115+ });
116+
117+ for (const auto & lf : pb.getLFs ())
118+ mass += lf.getVector ();
119+
120+ mass *= -1 ;
121+
122+ for (auto & dbc : pb.getDBCs ())
123+ {
124+ dbc.assemble ();
125+ out.eliminate (dbc.getDOFs ());
126+ }
127+
128+ for (auto & pbc : pb.getPBCs ())
129+ {
130+ assert (trialFES == testFES);
131+ pbc.assemble ();
132+ out.merge (pbc.getDOFs ());
133+ }
123134 }
124135
125136 Generic* copy () const noexcept override
126137 {
127138 return new Generic (*this );
128139 }
129-
130- private:
131- // Default<Context::Local>::Type<VectorType, LinearFormType> m_lfa;
132- // Default<Context::Local>::Type<OperatorType, BilinearFormType> m_bfa;
133140 };
134141}
135142
0 commit comments