13#ifndef PECLET_VORO_PHYSICS_INTERFACE_HPP
14#define PECLET_VORO_PHYSICS_INTERFACE_HPP
16#include <Kokkos_Core.hpp>
18#include "peclet/core/common/view.hpp"
27 const Kokkos::View<int*, peclet::core::MemSpace>& types,
28 const Kokkos::View<Real*, peclet::core::MemSpace>& tension,
int nTypes) {
29 using Exec = peclet::core::ExecSpace;
32 Kokkos::parallel_reduce(
33 "intf.energy", Kokkos::RangePolicy<Exec>(0, N),
34 KOKKOS_LAMBDA(
const int i, Real& acc) {
35 const int ti = types(i);
42 const int tj = types(j);
44 Real ax = view.
area(f, 0), ay = view.
area(f, 1), az = view.
area(f, 2);
45 acc += tension(ti * nTypes + tj) * Kokkos::sqrt(ax * ax + ay * ay + az * az);
Real interfaceEnergy(const TessellationView< Real > &view, const Kokkos::View< int *, peclet::core::MemSpace > &types, const Kokkos::View< Real *, peclet::core::MemSpace > &tension, int nTypes)
Total interfacial energy Σ γ(t_i,t_j)·area over phase-boundary facets.
Definition interface.hpp:26
Definition convex_cell.hpp:40
Definition tessellation_view.hpp:111
KOKKOS_INLINE_FUNCTION Real area(int f, int c) const
Definition tessellation_view.hpp:144
KOKKOS_INLINE_FUNCTION int facetEnd(int i) const
Definition tessellation_view.hpp:140
KOKKOS_INLINE_FUNCTION gid_t facetNbr(int f) const
Definition tessellation_view.hpp:143
KOKKOS_INLINE_FUNCTION int facetBegin(int i) const
Definition tessellation_view.hpp:139
KOKKOS_INLINE_FUNCTION int numCells() const
Definition tessellation_view.hpp:131
Published, read-only device data layer for the tessellation (migration §2.1, §3).