SimiLie
Loading...
Searching...
No Matches
coboundary.hpp
1// SPDX-FileCopyrightText: 2024 Baptiste Legouix
2// SPDX-License-Identifier: AGPL-3.0-or-later
3
4#pragma once
5
6#include <array>
7#include <utility>
8
9#include <ddc/ddc.hpp>
10
11#include <similie/exterior/boundary/boundary.hpp>
12#include <similie/exterior/cochain.hpp>
13#include <similie/exterior/concepts.hpp>
14#include <similie/exterior/cosimplex.hpp>
15#include <similie/misc/are_all_same.hpp>
16#include <similie/misc/filled_struct.hpp>
17#include <similie/misc/macros.hpp>
18#include <similie/misc/portable_stl.hpp>
19#include <similie/misc/select_from_type_seq.hpp>
20#include <similie/misc/specialization.hpp>
21#include <similie/misc/type_seq_conversion.hpp>
22#include <similie/misc/type_seq_ext.hpp>
23#include <similie/tensor/extrapolation_rules.hpp>
24#include <similie/tensor/owning_tensor.hpp>
25#include <similie/tensor/scalar_extrapolation_rules.hpp>
26#include <similie/tensor/tensor_impl.hpp>
27#include <similie/tensor/tensor_indices/antisymmetric_tensor.hpp>
28#include <similie/tensor/tensor_indices/dummy_index.hpp>
29
30#include <Kokkos_StdAlgorithms.hpp>
31
32
33namespace sil {
34
35namespace exterior {
36
37namespace detail {
38
39template <class T>
40struct CoboundaryType;
41
42template <
43 std::size_t K,
44 class... Tag,
45 class ElementType,
46 class LayoutStridedPolicy1,
47 class LayoutStridedPolicy2,
48 class ExecSpace>
49struct CoboundaryType<
50 Cochain<Chain<Simplex<K, Tag...>, LayoutStridedPolicy1, ExecSpace>,
51 ElementType,
52 LayoutStridedPolicy2>>
53{
54 using type = Cosimplex<Simplex<K + 1, Tag...>, ElementType>;
55};
56
57} // namespace detail
58
59template <misc::Specialization<Cochain> CochainType>
60using coboundary_t = typename detail::CoboundaryType<CochainType>::type;
61
62namespace detail {
63
64template <class TagToAddToCochain, class CochainTag>
65struct CoboundaryIndex;
66
67template <tensor::TensorNatIndex TagToAddToCochain, tensor::TensorNatIndex CochainTag>
68 requires(CochainTag::rank() == 0)
69struct CoboundaryIndex<TagToAddToCochain, CochainTag>
70{
71 using type = TagToAddToCochain;
72};
73
74template <tensor::TensorNatIndex TagToAddToCochain, tensor::TensorNatIndex CochainTag>
75 requires(CochainTag::rank() == 1)
76struct CoboundaryIndex<TagToAddToCochain, CochainTag>
77{
79};
80
81template <tensor::TensorNatIndex TagToAddToCochain, tensor::TensorNatIndex... Tag>
82struct CoboundaryIndex<TagToAddToCochain, tensor::TensorAntisymmetricIndex<Tag...>>
83{
84 using type = tensor::TensorAntisymmetricIndex<TagToAddToCochain, Tag...>;
85};
86
87} // namespace detail
88
89template <class TagToAddToCochain, class CochainTag>
90using coboundary_index_t = typename detail::CoboundaryIndex<TagToAddToCochain, CochainTag>::type;
91
92namespace detail {
93
94template <
95 tensor::TensorNatIndex TagToAddToCochain,
96 tensor::TensorIndex CochainIndex,
97 CochainType TensorType>
98struct CoboundaryTensorType
99{
101 typename TensorType::element_type,
102 ddc::replace_dim_of_t<
103 typename TensorType::discrete_domain_type,
104 CochainIndex,
106 typename TensorType::layout_type,
107 typename TensorType::memory_space>>;
108};
109
110} // namespace detail
111
112template <
113 tensor::TensorNatIndex TagToAddToCochain,
114 tensor::TensorIndex CochainTag,
115 CochainType TensorType>
118
119namespace detail {
120
121template <misc::Specialization<Chain> ChainType>
122struct ComputeSimplex;
123
124template <std::size_t K, class... Tag, class LayoutStridedPolicy, class ExecSpace>
125struct ComputeSimplex<Chain<Simplex<K, Tag...>, LayoutStridedPolicy, ExecSpace>>
126{
127 KOKKOS_FUNCTION static Simplex<K + 1, Tag...> operator()(
128 Chain<Simplex<K, Tag...>, LayoutStridedPolicy, ExecSpace> const& chain)
129 {
130 ddc::DiscreteVector<Tag...> vect {0 * ddc::type_seq_rank_v<Tag, ddc::TypeSeq<Tag...>>...};
131 for (auto i = chain.begin(); i < chain.end(); ++i) {
132 vect = ddc::DiscreteVector<Tag...> {
133 (static_cast<bool>(vect.template get<Tag>())
134 || static_cast<bool>((*i).discrete_vector().template get<Tag>()))...};
135 }
136 // This assumes that the chain has been produced using boundary().
137 return Simplex(
138 std::integral_constant<std::size_t, K + 1> {},
139 (*chain.begin())
140 .discrete_element(), // This is an assumption on the structure of the chain, which is satisfied if it has been produced using boundary()
141 vect);
142 }
143};
144
145} // namespace detail
146
147template <class... Args>
149
150template <class... Args>
152
153template <misc::Specialization<Cochain> CochainType>
155{
156 KOKKOS_FUNCTION static coboundary_t<CochainType> operator()(
157 CochainType const&
158 cochain) // Warning: only cochain.chain() produced using boundary() are supported
159 {
160 assert(cochain.size() == 2 * (cochain.dimension() + 1)
161 && "only cochain over the boundary of a single simplex is supported");
162
163 /* Commented because would require an additional buffer
164 assert(boundary(cochain.chain()) == boundary_t<typename CochainType::chain_type> {}
165 && "only cochain over the boundary of a single simplex is supported");
166 */
167
169 detail::ComputeSimplex<typename CochainType::chain_type>::operator()(
170 cochain.chain()),
171 cochain.integrate());
172 }
173};
174
175namespace detail {
176
177template <tensor::TensorNatIndex Index, class Dom>
178struct NonSpectatorDimension;
179
180template <tensor::TensorNatIndex Index, class... DDim>
181struct NonSpectatorDimension<Index, ddc::DiscreteDomain<DDim...>>
182{
183 using type = sil::misc::cartesian_prod_t<std::conditional_t<
184 ddc::type_seq_contains_v<
185 ddc::TypeSeq<typename DDim::continuous_dimension_type>,
186 typename Index::type_seq_dimensions>,
187 ddc::DiscreteDomain<DDim>,
188 ddc::DiscreteDomain<>>...>;
189};
190
191struct CoboundaryDummyIndex
192{
193};
194
195template <
196 class MemorySpace = Kokkos::HostSpace,
197 class TensorIndex,
198 std::size_t Width = 2,
199 class... DDims>
200KOKKOS_FUNCTION auto make_stencil(ddc::DiscreteElement<DDims...> front)
201{
202 constexpr std::size_t size = [] {
203 std::size_t nodes = 1;
204 for (std::size_t axis = 0; axis < sizeof...(DDims); ++axis)
205 nodes *= Width;
206 return nodes * TensorIndex::mem_size();
207 }();
208 std::array<double, size> storage {};
209 ddc::DiscreteDomain<DDims..., TensorIndex> const
210 domain(ddc::DiscreteDomain<DDims...>(
211 front,
212 typename ddc::DiscreteDomain<DDims...>::discrete_vector_type(
213 ddc::DiscreteVector<DDims>(Width)...)),
214 ddc::DiscreteDomain<TensorIndex>(
215 ddc::DiscreteElement<TensorIndex>(0),
216 ddc::DiscreteVector<TensorIndex>(TensorIndex::mem_size())));
218 double,
219 ddc::DiscreteDomain<DDims..., TensorIndex>,
220 Kokkos::layout_right,
221 MemorySpace>
222 result(ddc::ChunkSpan<
223 double,
224 ddc::DiscreteDomain<DDims..., TensorIndex>,
225 Kokkos::layout_right,
226 MemorySpace>(storage.data(), domain));
227 return tensor::OwningTensor(result, std::move(storage));
228}
229
230template <class Elem, class Domain>
231KOKKOS_FUNCTION Elem forward_stencil_front(Elem elem, Domain const& domain)
232{
233 // Anchor local operators at elem and use the following point whenever it exists.
234 // At the upper boundary, shift the two-point stencil back into the domain.
235 Elem front = elem;
236 Elem const domain_front(domain.front());
237 Elem const domain_back(domain.back());
238 for (std::size_t dim_id = 0; dim_id < ddc::type_seq_size_v<ddc::to_type_seq_t<Elem>>;
239 ++dim_id) {
240 if (ddc::detail::array(front)[dim_id] == ddc::detail::array(domain_back)[dim_id]
241 && ddc::detail::array(front)[dim_id] > ddc::detail::array(domain_front)[dim_id]) {
242 --ddc::detail::array(front)[dim_id];
243 }
244 }
245 return front;
246}
247
248template <class Elem, class Domain>
249KOKKOS_FUNCTION Elem backward_stencil_front(Elem elem, Domain const& domain)
250{
251 Elem const domain_front(domain.front());
252 for (std::size_t dim_id = 0; dim_id < ddc::type_seq_size_v<ddc::to_type_seq_t<Elem>>;
253 ++dim_id) {
254 if (ddc::detail::array(elem)[dim_id] > ddc::detail::array(domain_front)[dim_id]) {
255 --ddc::detail::array(elem)[dim_id];
256 }
257 }
258 return elem;
259}
260
261template <class LowerChainType, class VectorType>
262KOKKOS_FUNCTION auto find_discrete_vector(
263 LowerChainType const& lower_chain,
264 VectorType const& vector)
265{
266 for (auto i = lower_chain.begin(); i < lower_chain.end(); ++i) {
267 if (i->discrete_vector() == vector) {
268 return i;
269 }
270 }
271 return lower_chain.end();
272}
273
274template <
275 bool Transposed,
276 class Direction,
277 class CochainTag,
278 class Output,
279 class Evaluator,
280 class Chain,
281 class LowerChain,
282 class Element>
283KOKKOS_FUNCTION void apply_incidence(
284 Output const& output,
285 Evaluator const& evaluator,
286 Chain const& chain,
287 LowerChain const& lower_chain,
288 Element element)
289{
290 typename Chain::simplex_type::discrete_element_type const origin = misc::select_from_type_seq<
291 ddc::to_type_seq_t<typename Chain::simplex_type::discrete_element_type>>(element);
292 for (std::size_t component = 0; component < chain.size(); ++component) {
293 double sum = 0.0;
294 // Visit lower faces, then upper faces, in boundary() integration order.
295 // Their canonical incidence signs are (-1)^(axis+1) and (-1)^axis.
296 for (std::size_t half = 0; half < 2; ++half) {
297 std::size_t face = 0;
298 for (std::size_t axis = 0;
299 axis < ddc::type_seq_size_v<
300 ddc::to_type_seq_t<typename Chain::simplex_type::discrete_element_type>>;
301 ++axis) {
302 if (ddc::detail::array(chain[component].discrete_vector())[axis] == 0)
303 continue;
304 typename Chain::simplex_type::discrete_vector_type vector
305 = chain[component].discrete_vector();
306 ddc::detail::array(vector)[axis] = 0;
307 typename Chain::simplex_type::discrete_element_type sample = origin;
308 if (half != 0) {
309 if constexpr (Transposed)
310 --ddc::detail::array(sample)[axis];
311 else
312 ++ddc::detail::array(sample)[axis];
313 }
314 ddc::DiscreteElement<CochainTag> const source(
315 Kokkos::Experimental::distance(
316 lower_chain.begin(),
317 find_discrete_vector(lower_chain, vector)));
318 double const value = [&] {
319 if constexpr (
320 ddc::type_seq_size_v<ddc::type_seq_remove_t<
321 ddc::to_type_seq_t<Element>,
322 ddc::to_type_seq_t<typename LowerChain::simplex_type::
323 discrete_element_type>>>
324 == 0)
325 return evaluator(Element(sample), source);
326 else
327 return evaluator(
328 Element(sample,
329 misc::select_from_type_seq<ddc::type_seq_remove_t<
330 ddc::to_type_seq_t<Element>,
331 ddc::to_type_seq_t<
332 typename LowerChain::simplex_type::
333 discrete_element_type>>>(element)),
334 source);
335 }();
336 sum += ((face + half) % 2 == 0 ? -1.0 : 1.0) * value;
337 ++face;
338 }
339 }
340 output.mem(ddc::DiscreteElement<coboundary_index_t<Direction, CochainTag>>(component))
341 = Transposed ? -sum : sum;
342 }
343}
344
345template <
346 bool Transposed,
347 class Direction,
348 class CochainTag,
349 class Chain,
350 class Lower,
351 class Element,
352 class Component>
353KOKKOS_FUNCTION auto incidence_stencil(
354 Chain const& chain,
355 Lower const& lower,
356 Element element,
357 Component component)
358{
360 std::size_t const access = component.template uid<OutputIndex>();
361 std::size_t const index
362 = OutputIndex::rank() > 1 && access == 0 ? 0 : OutputIndex::access_id_to_mem_id(access);
363 double const orientation = [&] {
364 if constexpr (OutputIndex::rank() > 1)
365 return access == 0 ? 0.0 : access <= OutputIndex::mem_size() ? 1.0 : -1.0;
366 else
367 return 1.0;
368 }();
369 typename Chain::simplex_type
370 simplex(std::integral_constant<std::size_t, CochainTag::rank() + 1> {},
371 typename Chain::simplex_type::discrete_element_type(element),
372 chain[index].discrete_vector());
373 auto const faces = boundary<typename Chain::memory_space>(simplex);
374 std::array<typename Lower::simplex_type::discrete_element_type, 2 * (CochainTag::rank() + 1)>
375 samples {};
376 for (std::size_t i = 0; i < faces.size(); ++i)
377 samples[i] = faces[i].discrete_element();
378 if constexpr (Transposed) {
379 for (std::size_t i = CochainTag::rank() + 1; i < faces.size(); ++i)
380 for (std::size_t axis = 0;
381 axis < ddc::type_seq_size_v<
382 ddc::to_type_seq_t<typename Lower::simplex_type::discrete_element_type>>;
383 ++axis)
384 if (ddc::detail::array(simplex.discrete_vector())[axis] != 0
385 && ddc::detail::array(faces[i].discrete_vector())[axis] == 0) {
386 ddc::detail::array(samples[i])[axis] -= 2;
387 break;
388 }
389 }
390 typename Lower::simplex_type::discrete_element_type front(samples[0]);
391 for (auto const& face : samples)
392 for (std::size_t axis = 0; axis < ddc::type_seq_size_v<ddc::to_type_seq_t<decltype(front)>>;
393 ++axis)
394 ddc::detail::array(front)[axis]
395 = std::min(ddc::detail::array(front)[axis], ddc::detail::array(face)[axis]);
396 auto stencil = make_stencil<typename Chain::memory_space, CochainTag>(front);
397 for (std::size_t i = 0; i < faces.size(); ++i) {
398 std::size_t const source = Kokkos::Experimental::
399 distance(lower.begin(), find_discrete_vector(lower, faces[i].discrete_vector()));
400 stencil.mem(samples[i], ddc::DiscreteElement<CochainTag>(source))
401 += (Transposed ? -orientation : orientation) * (faces[i].negative() ? -1.0 : 1.0);
402 }
403 return stencil;
404}
405
406} // namespace detail
407
408template <tensor::TensorNatIndex TagToAddToCochain, tensor::TensorIndex CochainTag>
409struct Coboundary<TagToAddToCochain, CochainTag>
410{
411 using cochain_tag = CochainTag;
412 template <class ChainType, class LowerChainType, class Elem, class NaturalElem>
413 KOKKOS_FUNCTION static auto value(
414 ChainType const& chain,
415 LowerChainType const& lower_chain,
416 Elem elem,
417 NaturalElem natural_elem)
418 {
419 return detail::incidence_stencil<
420 false,
421 TagToAddToCochain,
422 CochainTag>(chain, lower_chain, elem, natural_elem);
423 }
424
425 template <
426 CochainType CoboundaryTensorType,
427 class Evaluator,
428 class ChainType,
429 class LowerChainType,
430 class Elem>
431 KOKKOS_FUNCTION static void operator()(
432 CoboundaryTensorType const& coboundary_tensor,
433 Evaluator const& evaluator,
434 ChainType const& chain,
435 LowerChainType const& lower_chain,
436 Elem elem)
437 {
438 detail::apply_incidence<
439 false,
440 TagToAddToCochain,
441 CochainTag>(coboundary_tensor, evaluator, chain, lower_chain, elem);
442 }
443};
444
445static_assert(CoboundaryConcept<
446 Coboundary<detail::DirectionConcept, detail::ScalarConcept>,
448 double,
449 ddc::DiscreteDomain<detail::DirectionConcept>,
450 Kokkos::layout_right,
451 Kokkos::HostSpace>>,
452 detail::EvaluatorConcept,
455 ddc::DiscreteElement<detail::GridConcept>,
456 ddc::DiscreteElement<detail::DirectionConcept>>);
457
458template <tensor::TensorNatIndex TagToAddToCochain, tensor::TensorIndex CochainTag>
459struct TransposedCoboundary<TagToAddToCochain, CochainTag>
460{
461 template <class ChainType, class LowerChainType, class Elem, class NaturalElem>
462 KOKKOS_FUNCTION static auto value(
463 ChainType const& chain,
464 LowerChainType const& lower_chain,
465 Elem elem,
466 NaturalElem natural_elem)
467 {
468 return detail::incidence_stencil<
469 true,
470 TagToAddToCochain,
471 CochainTag>(chain, lower_chain, elem, natural_elem);
472 }
473
474 template <
475 CochainType CoboundaryTensorType,
476 class Evaluator,
477 class ChainType,
478 class LowerChainType,
479 class Elem>
480 KOKKOS_FUNCTION static void operator()(
481 CoboundaryTensorType const& coboundary_tensor,
482 Evaluator const& evaluator,
483 ChainType const& chain,
484 LowerChainType const& lower_chain,
485 Elem elem)
486 {
487 detail::apply_incidence<
488 true,
489 TagToAddToCochain,
490 CochainTag>(coboundary_tensor, evaluator, chain, lower_chain, elem);
491 }
492};
493
494static_assert(CoboundaryConcept<
495 TransposedCoboundary<detail::DirectionConcept, detail::ScalarConcept>,
497 double,
498 ddc::DiscreteDomain<detail::DirectionConcept>,
499 Kokkos::layout_right,
500 Kokkos::HostSpace>>,
501 detail::EvaluatorConcept,
504 ddc::DiscreteElement<detail::GridConcept>,
505 ddc::DiscreteElement<detail::DirectionConcept>>);
506
507template <misc::Specialization<Cochain> CochainType>
508KOKKOS_FUNCTION coboundary_t<CochainType> coboundary(CochainType const& cochain)
509{
511}
512
526template <
527 tensor::TensorNatIndex TagToAddToCochain,
528 tensor::TensorIndex CochainTag,
529 CochainType TensorType,
530 class ExecSpace,
531 class ExtrapolationRules = tensor::ClampExtrapolationRule>
533 ExecSpace const& exec_space,
535 TensorType const& tensor,
536 ExtrapolationRules const& extrapolation = {})
537{
538 auto const extrapolation_rules = [&]() {
540 return extrapolation;
541 else
542 return tensor::make_extrapolation_rules(tensor, extrapolation);
543 }();
544 ddc::DiscreteDomain batch_dom
545 = ddc::remove_dims_of<coboundary_index_t<TagToAddToCochain, CochainTag>>(
546 coboundary_tensor.domain());
547
548 auto const chain = tangent_basis<
549 CochainTag::rank() + 1,
550 typename detail::NonSpectatorDimension<
551 TagToAddToCochain,
552 typename TensorType::non_indices_domain_t>::type>(exec_space);
553 auto const lower_chain = tangent_basis<
554 CochainTag::rank(),
555 typename detail::NonSpectatorDimension<
556 TagToAddToCochain,
557 typename TensorType::non_indices_domain_t>::type>(exec_space);
558
559 SIMILIE_DEBUG_LOG("similie_compute_coboundary");
560 ddc::parallel_for_each(
561 "similie_compute_coboundary",
562 exec_space,
563 batch_dom,
564 KOKKOS_LAMBDA(typename decltype(batch_dom)::discrete_element_type elem) {
566 coboundary_tensor[elem],
567 [&](auto sampled_elem, auto component) {
568 return extrapolation_rules(tensor, sampled_elem)
569 .mem(typename TensorType::indices_domain_t::
570 discrete_element_type(sampled_elem, component));
571 },
572 chain,
573 lower_chain,
574 elem);
575 });
576
577 return coboundary_tensor;
578}
579
580template <
581 tensor::TensorNatIndex TagToAddToCochain,
582 tensor::TensorIndex CochainTag,
583 CochainType TensorType,
584 class ExecSpace,
585 class ExtrapolationRules = tensor::ZeroExtrapolationRule>
587 ExecSpace const& exec_space,
589 TensorType const& tensor,
590 ExtrapolationRules const& extrapolation = {})
591{
592 auto const extrapolation_rules = [&]() {
594 return extrapolation;
595 else
596 return tensor::make_extrapolation_rules(tensor, extrapolation);
597 }();
598 ddc::DiscreteDomain batch_dom
599 = ddc::remove_dims_of<coboundary_index_t<TagToAddToCochain, CochainTag>>(
600 coboundary_tensor.domain());
601
602 auto const chain = tangent_basis<
603 CochainTag::rank() + 1,
604 typename detail::NonSpectatorDimension<
605 TagToAddToCochain,
606 typename TensorType::non_indices_domain_t>::type>(exec_space);
607 auto const lower_chain = tangent_basis<
608 CochainTag::rank(),
609 typename detail::NonSpectatorDimension<
610 TagToAddToCochain,
611 typename TensorType::non_indices_domain_t>::type>(exec_space);
612
613 SIMILIE_DEBUG_LOG("similie_compute_transposed_coboundary");
614 ddc::parallel_for_each(
615 "similie_compute_transposed_coboundary",
616 exec_space,
617 batch_dom,
618 KOKKOS_LAMBDA(typename decltype(batch_dom)::discrete_element_type elem) {
620 coboundary_tensor[elem],
621 [&](auto sampled_elem, auto component) {
622 return extrapolation_rules(tensor, sampled_elem)
623 .mem(typename TensorType::indices_domain_t::
624 discrete_element_type(sampled_elem, component));
625 },
626 chain,
627 lower_chain,
628 elem);
629 });
630
631 return coboundary_tensor;
632}
633
634template <
635 tensor::TensorNatIndex TagToAddToCochain,
636 tensor::TensorIndex CochainTag,
637 CochainType TensorType,
638 class ExecSpace,
639 class ExtrapolationRules = tensor::ClampExtrapolationRule>
641 ExecSpace const& exec_space,
643 TensorType const& tensor,
644 ExtrapolationRules const& extrapolation = {})
645{
646 return coboundary<
647 TagToAddToCochain,
648 CochainTag>(exec_space, coboundary_tensor, tensor, extrapolation);
649}
650
651} // namespace exterior
652
653} // namespace sil
Chain class.
Definition chain.hpp:26
SimplexType simplex_type
Definition chain.hpp:30
Cochain class.
Definition cochain.hpp:32
Simplex class.
Definition simplex.hpp:75
Simplex(ddc::DiscreteElement< Tag... >, ddc::DiscreteVector< T... >) -> Simplex< sizeof...(T), Tag... >
Chain(Head, Tail...) -> Chain< typename Head::value_type, typename Head::array_layout, typename Head::memory_space >
typename detail::CoboundaryTensorType< TagToAddToCochain, CochainTag, TensorType >::type coboundary_tensor_t
Cochain(Tensor const &) -> Cochain< Tensor >
KOKKOS_FUNCTION Chain< boundary_t< SimplexType >, typename AllocationType::array_layout, typename AllocationType::memory_space > boundary(AllocationType allocation, SimplexType const &simplex)
Definition boundary.hpp:170
coboundary_tensor_t< TagToAddToCochain, CochainTag, TensorType > transposed_coboundary(ExecSpace const &exec_space, coboundary_tensor_t< TagToAddToCochain, CochainTag, TensorType > const &coboundary_tensor, TensorType const &tensor, ExtrapolationRules const &extrapolation={})
coboundary_tensor_t< TagToAddToCochain, CochainTag, TensorType > deriv(ExecSpace const &exec_space, coboundary_tensor_t< TagToAddToCochain, CochainTag, TensorType > const &coboundary_tensor, TensorType const &tensor, ExtrapolationRules const &extrapolation={})
KOKKOS_FUNCTION constexpr auto tangent_basis(Elem elem)
LocalChain(AllocationType, SimplexType, T...) -> LocalChain< std::remove_cvref_t< SimplexType >, typename AllocationType::array_layout, typename AllocationType::memory_space >
typename detail::CoboundaryIndex< TagToAddToCochain, CochainTag >::type coboundary_index_t
KOKKOS_FUNCTION coboundary_t< CochainType > coboundary(CochainType const &cochain)
typename detail::CoboundaryType< CochainType >::type coboundary_t
convert_type_seq_to_t< ddc::DiscreteDomain, typename detail::CartesianProd< Domains... >::type > cartesian_prod_t
KOKKOS_FUNCTION auto select_from_type_seq(T t)
Tensor(ddc::Chunk< ElementType, SupportType, Allocator >) -> Tensor< ElementType, SupportType, Kokkos::layout_right, typename Allocator::memory_space >
OwningTensor(TensorType, Storage &&) -> OwningTensor< TensorType, Storage >
KOKKOS_FUNCTION auto make_extrapolation_rules(ExtrapolationRule rule)
Broadcast a rule to both sides of all N non-index dimensions.
ExtrapolationRules(std::pair< LeftRule, RightRule >, OtherRulePairs...) -> ExtrapolationRules< std::pair< LeftRule, RightRule >, OtherRulePairs... >
The top-level namespace of SimiLie.
Definition csr.hpp:15
static KOKKOS_FUNCTION coboundary_t< CochainType > operator()(CochainType const &cochain)
static KOKKOS_FUNCTION void operator()(CoboundaryTensorType const &coboundary_tensor, Evaluator const &evaluator, ChainType const &chain, LowerChainType const &lower_chain, Elem elem)
static KOKKOS_FUNCTION auto value(ChainType const &chain, LowerChainType const &lower_chain, Elem elem, NaturalElem natural_elem)
static KOKKOS_FUNCTION void operator()(CoboundaryTensorType const &coboundary_tensor, Evaluator const &evaluator, ChainType const &chain, LowerChainType const &lower_chain, Elem elem)
static KOKKOS_FUNCTION auto value(ChainType const &chain, LowerChainType const &lower_chain, Elem elem, NaturalElem natural_elem)
Spatial closure evaluated independently of the stored field values.