30template<
typename VectorType>
50 auto [vol, expSource, rhs] =
views(solution.mesh().cellVolumes(), expTmp, ls.
rhs());
54 KOKKOS_LAMBDA(
const localIdx i) { rhs[i] -= expSource[i] * vol[i]; }
57 auto solver =
la::Solver(solution.exec(), fvSolution);
58 fence(solution.exec());
59 return solver.solve(ls, solution.internalVector());
62template<
typename VectorType>
72 auto [sparsity, ls] = exp.
assemble(solution.mesh(), t, dt, ps);
78 auto [vol, expSource, rhs] =
views(solution.mesh().cellVolumes(), expTmp, ls.rhs());
82 KOKKOS_LAMBDA(
const localIdx i) { rhs[i] -= expSource[i] * vol[i]; }
85 auto solver =
la::Solver(solution.exec(), fvSolution);
86 fence(solution.exec());
87 return solver.solve(ls, solution.internalVector());
101template<
typename VectorType>
104 VectorType& solution,
118 timeIntegration::TimeIntegration<VectorType>(fvSchemes.
subDict(
"ddtSchemes"), fvSolution);
123 integrator.solve(exp, solution, t, dt);
124 return {.numIter = -1, .initResNorm = 0, .finalResNorm = 0, .solveTime = 0};
A class representing a dictionary that stores key-value pairs.
Dictionary & subDict(const std::string &key)
Retrieves a sub-dictionary associated with the given key.
const std::vector< TemporalOperator< ValueType > > & temporalOperators() const
Vector< ValueType > explicitOperation(localIdx nCells) const
const std::vector< SpatialOperator< ValueType > > & spatialOperators() const
std::tuple< la::SparsityPattern, la::LinearSystem< ValueType, localIdx > > assemble(const UnstructuredMesh &mesh, scalar t, scalar dt, std::span< const PostAssemblyBase< ValueType > > ps={}) const
void read(const Dictionary &input)
A class representing a linear system of equations.
Vector< ValueType > & rhs()
#define NF_ERROR_EXIT(message)
Macro for printing an error message and aborting the program.
la::SolverStats iterativeSolveImpl(Expression< typename VectorType::ElementType > &exp, const la::SparsityPattern &sp, la::LinearSystem< typename VectorType::ElementType, localIdx > &ls, VectorType &solution, scalar t, scalar dt, const Dictionary &fvSchemes, const Dictionary &fvSolution, std::vector< PostAssemblyBase< typename VectorType::ElementType > > ps)
la::SolverStats solve(Expression< typename VectorType::ElementType > &exp, VectorType &solution, scalar t, scalar dt, const Dictionary &fvSchemes, const Dictionary &fvSolution, std::vector< PostAssemblyBase< typename VectorType::ElementType > > p={})
void parallelFor(const Executor &exec, std::pair< localIdx, localIdx > range, Kernel kernel, std::string name="parallelFor")
void fence(const Executor &exec)
auto views(Types &... args)
Unpacks all views of the passed classes.