23 #ifndef SHEAF_DLL_SPEC_H 24 #include "SheafSystem/sheaf_dll_spec.h" 27 #ifndef ASSERT_CONTRACT_H 28 #include "SheafSystem/assert_contract.h" 32 #include "SheafSystem/sec_vd.h" 35 #ifndef SEC_SECTION_EVALUATOR_H 36 #include "SheafSystem/section_evaluator.h" 42 namespace sec_vd_algebra
46 template <
typename S0,
typename S1,
typename SR,
typename F>
48 binary_op(
const S0& x0,
const S1& x1, SR& xresult, F xfunctor,
53 require(x0.state_is_auto_read_accessible(xauto_access));
54 require(x1.state_is_auto_read_accessible(xauto_access));
55 require(xresult.state_is_auto_read_write_accessible(xauto_access));
56 require((const_cast<S0&>(x0)).discretization_ct(xauto_access) == \
57 (const_cast<S1&>(x1)).discretization_ct(xauto_access));
58 require((const_cast<S0&>(x0)).discretization_ct(xauto_access) == \
59 xresult.discretization_ct(xauto_access));
67 xresult.get_read_write_access(
true);
72 typedef typename S0::fiber_type::volatile_type volatile_type_0;
73 typedef typename S1::fiber_type::volatile_type volatile_type_1;
74 typedef typename SR::fiber_type::volatile_type volatile_type_r;
76 volatile_type_0* lx0_fiber = x0.fiber_prototype().lite_prototype().clone();
77 volatile_type_1* lx1_fiber = x1.fiber_prototype().lite_prototype().clone();
78 volatile_type_r* lxresult_fiber =
79 xresult.fiber_prototype().lite_prototype().clone();
99 S0& lx0 =
const_cast<S0&
>(x0);
100 S1& lx1 =
const_cast<S1&
>(x1);
102 size_type ldisc_ct = lx0.discretization_ct();
108 lx0.get_fiber(i, *lx0_fiber);
109 lx1.get_fiber(i, *lx1_fiber);
113 xfunctor(*lx0_fiber, *lx1_fiber, *lxresult_fiber);
117 xresult.put_fiber(i, *lxresult_fiber);
124 xresult.release_access();
129 delete lxresult_fiber;
139 template <
typename S0,
typename SR,
typename F>
146 require(x0.state_is_auto_read_accessible(xauto_access));
147 require(xresult.state_is_auto_read_write_accessible(xauto_access));
148 require((const_cast<S0&>(x0)).discretization_ct(xauto_access) == \
149 xresult.discretization_ct(xauto_access));
155 x0.get_read_access();
156 xresult.get_read_write_access(
true);
161 typedef typename S0::fiber_type::volatile_type volatile_type_0;
162 typedef typename SR::fiber_type::volatile_type volatile_type_r;
164 volatile_type_0* lx0_fiber = x0.fiber_prototype().lite_prototype().clone();
165 volatile_type_r* lxresult_fiber =
166 xresult.fiber_prototype().lite_prototype().clone();
186 S0& lx0 =
const_cast<S0&
>(x0);
188 size_type ldisc_ct = lx0.discretization_ct();
194 lx0.get_fiber(i, *lx0_fiber);
198 xfunctor(*lx0_fiber, xvalue, *lxresult_fiber);
202 xresult.put_fiber(i, *lxresult_fiber);
208 xresult.release_access();
212 delete lxresult_fiber;
222 template <
typename S0,
typename SR,
typename F>
224 unary_op(
const S0& x0, SR& xresult, F xfunctor,
bool xauto_access)
229 require(x0.state_is_auto_read_accessible(xauto_access));
230 require(xresult.state_is_auto_read_write_accessible(xauto_access));
231 require((const_cast<S0&>(x0)).discretization_ct(xauto_access) == \
232 xresult.discretization_ct(xauto_access));
238 x0.get_read_access();
239 xresult.get_read_write_access(
true);
244 typedef typename S0::fiber_type::volatile_type volatile_type_0;
245 typedef typename SR::fiber_type::volatile_type volatile_type_r;
247 volatile_type_0* lx0_fiber = x0.fiber_prototype().lite_prototype().clone();
248 volatile_type_r* lxresult_fiber =
249 xresult.fiber_prototype().lite_prototype().clone();
258 S0& lx0 =
const_cast<S0&
>(x0);
259 size_type ldisc_ct = lx0.discretization_ct();
265 lx0.get_fiber(i, *lx0_fiber);
269 xfunctor(*lx0_fiber, *lxresult_fiber);
273 xresult.put_fiber(i, *lxresult_fiber);
279 xresult.release_access();
283 delete lxresult_fiber;
293 template <
typename S0,
typename F>
300 require(x0.state_is_auto_read_write_accessible(xauto_access));
306 x0.get_read_write_access(
true);
311 typedef typename S0::fiber_type::volatile_type volatile_type_0;
313 volatile_type_0* lx0_fiber = x0.fiber_prototype().lite_prototype().clone();
322 S0& lx0 =
const_cast<S0&
>(x0);
323 size_type ldisc_ct = lx0.discretization_ct();
329 lx0.get_fiber(i, *lx0_fiber);
333 xfunctor(*lx0_fiber, x1);
337 x0.put_fiber(i, *lx0_fiber);
355 template <
typename S0,
typename SR,
typename F>
357 unary_op(
const S0& x0, SR& xresult1, SR& xresult2, F xfunctor,
362 require(x0.state_is_auto_read_accessible(xauto_access));
363 require(xresult1.state_is_auto_read_write_accessible(xauto_access));
364 require(xresult2.state_is_auto_read_write_accessible(xauto_access));
365 require((const_cast<S0&>(x0)).discretization_ct(xauto_access) == \
366 xresult1.discretization_ct(xauto_access));
372 x0.get_read_access();
373 xresult1.get_read_write_access(
true);
374 xresult2.get_read_write_access(
true);
379 typedef typename S0::fiber_type::volatile_type volatile_type_0;
380 typedef typename SR::fiber_type::volatile_type volatile_type_r;
382 volatile_type_0 lx0_fiber;
383 volatile_type_r lxresult1_fiber;
384 volatile_type_r lxresult2_fiber;
390 S0& lx0 =
const_cast<S0&
>(x0);
391 size_type ldisc_ct = lx0.discretization_ct();
400 lx0.get_fiber(i, lx0_fiber);
404 xfunctor(lx0_fiber, lxresult1_fiber, lxresult2_fiber);
408 xresult1.put_fiber(i, lxresult1_fiber);
409 xresult2.put_fiber(i, lxresult2_fiber);
415 xresult1.release_access();
416 xresult2.release_access();
430 #endif // ifndef SEC_VD_IMPL_H void unary_op(const S0 &x0, SR &xresult, F xfunctor, bool xauto_access)
Unary operator.
void binary_op(const S0 &x0, const S1 &x1, SR &xresult, F xfunctor, bool xauto_access)
Binary operator.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
sec_vd_dof_type dof_type
The type of degree of freedom.
Namespace for the fiber_bundles component of the sheaf system.
double vd_value_type
The type of component in the fiber; the scalar type in the fiber vector space.