Branch data Line data Source code
1 : : // *****************************************************************************
2 : : /*!
3 : : \file src/PDE/CGPDE.hpp
4 : : \copyright 2012-2015 J. Bakosi,
5 : : 2016-2018 Los Alamos National Security, LLC.,
6 : : 2019-2021 Triad National Security, LLC.
7 : : All rights reserved. See the LICENSE file for details.
8 : : \brief Partial differential equation base for continuous Galerkin PDEs
9 : : \details This file defines a generic partial differential equation (PDE)
10 : : class for PDEs that use continuous Galerkin spatial discretization.
11 : : The class uses runtime polymorphism without client-side inheritance:
12 : : inheritance is confined to the internals of the class, invisible to
13 : : client-code. The class exclusively deals with ownership enabling client-side
14 : : value semantics. Credit goes to Sean Parent at Adobe:
15 : : https://github.com/sean-parent/sean-parent.github.com/wiki/
16 : : Papers-and-Presentations.
17 : : */
18 : : // *****************************************************************************
19 : : #ifndef CGPDE_h
20 : : #define CGPDE_h
21 : :
22 : : #include <array>
23 : : #include <string>
24 : : #include <vector>
25 : : #include <functional>
26 : : #include <memory>
27 : : #include <unordered_set>
28 : : #include <unordered_map>
29 : :
30 : : #include "Types.hpp"
31 : : #include "Fields.hpp"
32 : : #include "UnsMesh.hpp"
33 : : #include "FunctionPrototypes.hpp"
34 : : #include "Mesh/CommMap.hpp"
35 : : #include "History.hpp"
36 : : #include "Table.hpp"
37 : :
38 : : namespace inciter {
39 : :
40 : : namespace cg {
41 : :
42 : : using ncomp_t = tk::ncomp_t;
43 : :
44 : : //! \brief Evaluate the increment from t to t+dt of an analytical solution at
45 : : //! (x,y,z) for all components
46 : : std::vector< tk::real >
47 : : solinc( tk::ncomp_t ncomp, const std::vector< EOS >&, tk::real x, tk::real y,
48 : : tk::real z, tk::real t, tk::real dt, tk::InitializeFn solution );
49 : :
50 : : //! Compute boundary point normals
51 : : std::unordered_map< int,
52 : : std::unordered_map< std::size_t, std::array< tk::real, 4 > > >
53 : : bnorm( const std::map< int, std::vector< std::size_t > >& bface,
54 : : const std::vector< std::size_t >& triinpoel,
55 : : const std::array< std::vector< tk::real >, 3 >& coord,
56 : : const std::vector< std::size_t >& gid,
57 : : const std::unordered_map< int,
58 : : std::unordered_set< std::size_t > >& bcnodes );
59 : :
60 : : } // cg::
61 : :
62 : : //! \brief Partial differential equation base for continuous Galerkin PDEs
63 : : //! \details This class uses runtime polymorphism without client-side
64 : : //! inheritance: inheritance is confined to the internals of the this class,
65 : : //! invisible to client-code. The class exclusively deals with ownership
66 : : //! enabling client-side value semantics. Credit goes to Sean Parent at Adobe:
67 : : //! https://github.com/sean-parent/sean-parent.github.com/wiki/
68 : : //! Papers-and-Presentations. For example client code that models a CGPDE,
69 : : //! see inciter::CompFlow.
70 : 279 : class CGPDE {
71 : :
72 : : private:
73 : : using ncomp_t = tk::ncomp_t;
74 : : using real = tk::real;
75 : :
76 : : public:
77 : : //! Default constructor taking no arguments for Charm++
78 : : explicit CGPDE() = default;
79 : :
80 : : //! Constructor taking an object modeling Concept.
81 : : //! \details The object of class T comes pre-constructed.
82 : : //! \param[in] x Instantiated object of type T given by the template
83 : : //! argument.
84 : : template< typename T > explicit CGPDE( T x ) :
85 : : self( std::make_unique< Model<T> >( std::move(x) ) ) {}
86 : :
87 : : //! \brief Constructor taking a function pointer to a constructor of an
88 : : //! object modeling Concept.
89 : : //! \details Passing std::function allows late execution of the constructor,
90 : : //! i.e., as late as inside this class' constructor, and thus usage from
91 : : //! a factory. Note that there are at least two different ways of using
92 : : //! this constructor:
93 : : //! - Bind T's constructor arguments and place it in std::function<T()>
94 : : //! and passing no arguments as args.... This case then instantiates the
95 : : //! model via its constructor and stores it in here.
96 : : //! - Bind a single placeholder argument to T's constructor and pass it in
97 : : //! as host's args..., which then forwards it to model's constructor. This
98 : : //! allows late binding, i.e., binding the argument only here.
99 : : //! \see See also the wrapper tk::recordModel() which does the former and
100 : : //! tk::recordModelLate() which does the latter, both defined in
101 : : //! src/Base/Factory.h.
102 : : //! \param[in] x Function pointer to a constructor of an object modeling
103 : : //! Concept.
104 : : //! \param[in] args Zero or more constructor arguments
105 : : template< typename T, typename...Args >
106 [ - + ]: 275 : explicit CGPDE( std::function<T(Args...)> x, Args&&... args ) :
107 : : self( std::make_unique< Model<T> >(
108 [ + - ]: 275 : std::move( x( std::forward<Args>(args)... ) ) ) ) {}
109 : :
110 : : //! Public interface to determining which nodes are in IC box
111 : : void IcBoxNodes( const tk::UnsMesh::Coords& coord,
112 : : const std::vector< std::size_t >& inpoel,
113 : : const std::unordered_map< std::size_t, std::set< std::size_t > >& elemblkid,
114 : : std::vector< std::unordered_set< std::size_t > >& inbox,
115 : : std::unordered_map< std::size_t, std::set< std::size_t > >& nodeblkid,
116 : : std::size_t& nuserblk )
117 : 738 : { self->IcBoxNodes( coord, inpoel, elemblkid, inbox, nodeblkid, nuserblk );
118 : : }
119 : :
120 : : //! Public interface to setting the initial conditions for the diff eq
121 : : void initialize(
122 : : const std::array< std::vector< real >, 3 >& coord,
123 : : tk::Fields& unk,
124 : : real t,
125 : : real V,
126 : : const std::vector< std::unordered_set< std::size_t > >& inbox,
127 : : const std::vector< tk::real >& blkvols,
128 : : const std::unordered_map< std::size_t, std::set< std::size_t > >&
129 : : nodeblkid )
130 [ + - ][ + - ]: 920 : { self->initialize( coord, unk, t, V, inbox, blkvols, nodeblkid ); }
131 : :
132 : : //! Public interface to querying a velocity
133 : : void velocity( const tk::Fields& u, tk::UnsMesh::Coords& v ) const
134 [ + - ]: 28552 : { self->velocity(u,v); }
135 : :
136 : : //! Public interface to querying a sound speed
137 : : void soundspeed( const tk::Fields& u, std::vector< tk::real >& s ) const
138 [ + - ]: 28552 : { self->soundspeed(u,s); }
139 : :
140 : : //! Public interface to computing the nodal gradients for ALECG
141 : : void chBndGrad( const std::array< std::vector< real >, 3 >& coord,
142 : : const std::vector< std::size_t >& inpoel,
143 : : const std::vector< std::size_t >& bndel,
144 : : const std::vector< std::size_t >& gid,
145 : : const std::unordered_map< std::size_t, std::size_t >& bid,
146 : : const tk::Fields& U,
147 : : tk::Fields& G ) const
148 : 37101 : { self->chBndGrad( coord, inpoel, bndel, gid, bid, U, G ); }
149 : :
150 : : //! Public interface to computing the right-hand side vector for ALECG
151 : : void rhs(
152 : : real t,
153 : : const std::array< std::vector< real >, 3 >& coord,
154 : : const std::vector< std::size_t >& inpoel,
155 : : const std::vector< std::size_t >& triinpoel,
156 : : const std::vector< std::size_t >& gid,
157 : : const std::unordered_map< std::size_t, std::size_t >& bid,
158 : : const std::unordered_map< std::size_t, std::size_t >& lid,
159 : : const std::vector< real >& dfn,
160 : : const std::pair< std::vector< std::size_t >,
161 : : std::vector< std::size_t > >& psup,
162 : : const std::pair< std::vector< std::size_t >,
163 : : std::vector< std::size_t > >& esup,
164 : : const std::vector< int >& symbctri,
165 : : const std::vector< int >& slipwallbctri,
166 : : const std::vector< real >& vol,
167 : : const std::vector< std::size_t >& edgenode,
168 : : const std::vector< std::size_t >& edgeid,
169 : : const std::vector< std::unordered_set< std::size_t > >& boxnodes,
170 : : const tk::Fields& G,
171 : : const tk::Fields& U,
172 : : const tk::Fields& W,
173 : : const std::vector< real >& tp,
174 : : real V,
175 : : tk::Fields& R,
176 : : std::vector< int >& srcFlag ) const
177 : 37101 : { self->rhs( t, coord, inpoel, triinpoel, gid, bid, lid, dfn, psup,
178 : : esup, symbctri, slipwallbctri, vol, edgenode, edgeid,
179 : 37101 : boxnodes, G, U, W, tp, V, R, srcFlag ); }
180 : :
181 : : //! Public interface to compute boundary surface integrals of pressure
182 : : void bndPressureInt(
183 : : const std::array< std::vector< real >, 3 >& coord,
184 : : const std::vector< std::size_t >& triinpoel,
185 : : const std::vector< int >& slipwallbctri,
186 : : const tk::Fields& U,
187 : : const std::array< tk::real, 3 >& CM,
188 : : std::vector< real >& F ) const
189 [ - - ]: 0 : { self->bndPressureInt( coord, triinpoel, slipwallbctri, U, CM, F ); }
190 : :
191 : : //! Public interface for computing the minimum time step size
192 : : real dt( const std::array< std::vector< real >, 3 >& coord,
193 : : const std::vector< std::size_t >& inpoel,
194 : : tk::real t,
195 : : tk::real dtn,
196 : : const tk::Fields& U,
197 : : const std::vector< tk::real >& vol,
198 : : const std::vector< tk::real >& voln,
199 : : const std::vector< int >& srcFlag ) const
200 : 6327 : { return self->dt( coord, inpoel, t, dtn, U, vol, voln, srcFlag ); }
201 : :
202 : : //! Public interface for computing a time step size for each mesh node
203 : : void dt( uint64_t it,
204 : : const std::vector< real >& vol,
205 : : const tk::Fields& U,
206 : : std::vector< real >& dtp ) const
207 : 200 : { self->dt( it, vol, U, dtp ); }
208 : :
209 : : //! \brief Public interface for querying Dirichlet boundary condition values
210 : : //! set by the user on a given side set for all components in a PDE system
211 : : std::map< std::size_t, std::vector< std::pair<bool,real> > >
212 : : dirbc( real t,
213 : : real deltat,
214 : : const std::vector< real >& tp,
215 : : const std::vector< real >& dtp,
216 : : const std::pair< const int, std::vector< std::size_t > >& sides,
217 : : const std::array< std::vector< real >, 3 >& coord,
218 : : bool increment ) const
219 [ + - ]: 90927 : { return self->dirbc( t, deltat, tp, dtp, sides, coord, increment ); }
220 : :
221 : : //! Public interface to set symmetry boundary conditions at nodes
222 : : void
223 : : symbc( tk::Fields& U,
224 : : const std::array< std::vector< real >, 3 >& coord,
225 : : const std::unordered_map< int,
226 : : std::unordered_map< std::size_t,
227 : : std::array< real, 4 > > >& bnorm,
228 : : const std::unordered_set< std::size_t >& nodes ) const
229 [ + - ]: 49461 : { self->symbc( U, coord, bnorm, nodes ); }
230 : :
231 : : //! Public interface to set farfield boundary conditions at nodes
232 : : void
233 : : farfieldbc( tk::Fields& U,
234 : : const std::array< std::vector< real >, 3 >& coord,
235 : : const std::unordered_map< int,
236 : : std::unordered_map< std::size_t,
237 : : std::array< real, 4 > > >& bnorm,
238 : : const std::unordered_set< std::size_t >& nodes ) const
239 [ + - ]: 49452 : { self->farfieldbc( U, coord, bnorm, nodes ); }
240 : :
241 : : //! Public interface to set slip wall boundary conditions at nodes
242 : : void
243 : : slipwallbc( tk::Fields& U,
244 : : const tk::Fields& W,
245 : : const std::array< std::vector< real >, 3 >& coord,
246 : : const std::unordered_map< int,
247 : : std::unordered_map< std::size_t,
248 : : std::array< real, 4 > > >& bnorm,
249 : : const std::unordered_set< std::size_t >& nodes ) const
250 [ + - ]: 49461 : { self->slipwallbc( U, W, coord, bnorm, nodes ); }
251 : :
252 : : //! Public interface to applying time dependent boundary conditions at nodes
253 : : void
254 : : timedepbc( tk::real t,
255 : : tk::Fields& U,
256 : : const std::vector< std::unordered_set< std::size_t > >& nodes,
257 : : const std::vector< tk::Table<5> >& timedepfn ) const
258 [ + - ]: 37540 : { self->timedepbc( t, U, nodes, timedepfn ); }
259 : :
260 : : //! Public interface to returning maps of output var functions
261 : : std::map< std::string, tk::GetVarFn > OutVarFn() const
262 [ + - ]: 838 : { return self->OutVarFn(); }
263 : :
264 : : //! Public interface to returning analytic field output labels
265 : : std::vector< std::string > analyticFieldNames() const
266 : 630 : { return self->analyticFieldNames(); }
267 : :
268 : : //! Public interface to returning surface field output labels
269 [ + - ]: 838 : std::vector< std::string > surfNames() const { return self->surfNames(); }
270 : :
271 : : //! Public interface to returning time history field output labels
272 [ + - ]: 22 : std::vector< std::string > histNames() const { return self->histNames(); }
273 : :
274 : : //! Public interface to returning variable names
275 : : std::vector< std::string > names() const { return self->names(); }
276 : :
277 : : //! Public interface to returning nodal surface field output
278 : : std::vector< std::vector< real > >
279 : : surfOutput( const std::map< int, std::vector< std::size_t > >& bnd,
280 : : const tk::Fields& U ) const
281 [ + - ]: 838 : { return self->surfOutput( bnd, U ); }
282 : :
283 : : //! Public interface to returning elemental surface field output
284 : : std::vector< std::vector< real > >
285 : : elemSurfOutput( const std::map< int, std::vector< std::size_t > >& bface,
286 : : const std::vector< std::size_t >& triinpoel,
287 : : const tk::Fields& U ) const
288 [ + - ]: 838 : { return self->elemSurfOutput( bface, triinpoel, U ); }
289 : :
290 : : //! Public interface to returning time history output
291 : : std::vector< std::vector< real > >
292 : : histOutput( const std::vector< HistData >& h,
293 : : const std::vector< std::size_t >& inpoel,
294 : : const tk::Fields& U ) const
295 [ + - ]: 214 : { return self->histOutput( h, inpoel, U ); }
296 : :
297 : : //! Public interface to returning analytic solution
298 : : tk::InitializeFn::result_type
299 : : analyticSolution( real xi, real yi, real zi, real t ) const
300 : 25005 : { return self->analyticSolution( xi, yi, zi, t ); }
301 : :
302 : : //! Public interface to returning the analytic solution for conserved vars
303 : : tk::InitializeFn::result_type
304 : : solution( tk::real xi, tk::real yi, tk::real zi, tk::real t ) const
305 [ + - ]: 949040 : { return self->solution( xi, yi, zi, t ); }
306 : :
307 : : //! Copy assignment
308 : : CGPDE& operator=( const CGPDE& x )
309 : : { CGPDE tmp(x); *this = std::move(tmp); return *this; }
310 : : //! Copy constructor
311 : : CGPDE( const CGPDE& x ) : self( x.self->copy() ) {}
312 : : //! Move assignment
313 : : CGPDE& operator=( CGPDE&& ) noexcept = default;
314 : : //! Move constructor
315 [ - + ]: 4 : CGPDE( CGPDE&& ) noexcept = default;
316 : :
317 : : private:
318 : : //! \brief Concept is a pure virtual base class specifying the requirements
319 : : //! of polymorphic objects deriving from it
320 : : struct Concept {
321 : : Concept() = default;
322 : 0 : Concept( const Concept& ) = default;
323 : : virtual ~Concept() = default;
324 : : virtual Concept* copy() const = 0;
325 : : virtual void IcBoxNodes( const tk::UnsMesh::Coords&,
326 : : const std::vector< std::size_t >&,
327 : : const std::unordered_map< std::size_t, std::set< std::size_t > >&,
328 : : std::vector< std::unordered_set< std::size_t > >&,
329 : : std::unordered_map< std::size_t, std::set< std::size_t > >&,
330 : : std::size_t& ) = 0;
331 : : virtual void initialize(
332 : : const std::array< std::vector< real >, 3 >&,
333 : : tk::Fields&,
334 : : real,
335 : : real,
336 : : const std::vector< std::unordered_set< std::size_t > >&,
337 : : const std::vector< tk::real >&,
338 : : const std::unordered_map< std::size_t, std::set< std::size_t > >& ) = 0;
339 : : virtual void velocity( const tk::Fields&, tk::UnsMesh::Coords& )
340 : : const = 0;
341 : : virtual void soundspeed( const tk::Fields&, std::vector< tk::real >& )
342 : : const = 0;
343 : : virtual void chBndGrad( const std::array< std::vector< real >, 3 >&,
344 : : const std::vector< std::size_t >&,
345 : : const std::vector< std::size_t >&,
346 : : const std::vector< std::size_t >&,
347 : : const std::unordered_map< std::size_t, std::size_t >&,
348 : : const tk::Fields&,
349 : : tk::Fields& ) const = 0;
350 : : virtual void rhs(
351 : : real,
352 : : const std::array< std::vector< real >, 3 >&,
353 : : const std::vector< std::size_t >&,
354 : : const std::vector< std::size_t >&,
355 : : const std::vector< std::size_t >&,
356 : : const std::unordered_map< std::size_t, std::size_t >&,
357 : : const std::unordered_map< std::size_t, std::size_t >&,
358 : : const std::vector< real >&,
359 : : const std::pair< std::vector< std::size_t >,
360 : : std::vector< std::size_t > >&,
361 : : const std::pair< std::vector< std::size_t >,
362 : : std::vector< std::size_t > >&,
363 : : const std::vector< int >&,
364 : : const std::vector< int >&,
365 : : const std::vector< real >&,
366 : : const std::vector< std::size_t >&,
367 : : const std::vector< std::size_t >&,
368 : : const std::vector< std::unordered_set< std::size_t > >&,
369 : : const tk::Fields&,
370 : : const tk::Fields&,
371 : : const tk::Fields&,
372 : : const std::vector< real >&,
373 : : real,
374 : : tk::Fields&,
375 : : std::vector< int >& ) const = 0;
376 : : virtual void bndPressureInt(
377 : : const std::array< std::vector< real >, 3 >&,
378 : : const std::vector< std::size_t >&,
379 : : const std::vector< int >&,
380 : : const tk::Fields&,
381 : : const std::array< tk::real, 3 >&,
382 : : std::vector< real >& ) const = 0;
383 : : virtual real dt( const std::array< std::vector< real >, 3 >&,
384 : : const std::vector< std::size_t >&,
385 : : tk::real,
386 : : tk::real,
387 : : const tk::Fields&,
388 : : const std::vector< tk::real >& ,
389 : : const std::vector< tk::real >& ,
390 : : const std::vector< int >& ) const = 0;
391 : : virtual void dt( uint64_t,
392 : : const std::vector< real > &,
393 : : const tk::Fields&,
394 : : std::vector< real >& ) const = 0;
395 : : virtual std::map< std::size_t, std::vector< std::pair<bool,real> > >
396 : : dirbc( real,
397 : : real,
398 : : const std::vector< real >&,
399 : : const std::vector< real >&,
400 : : const std::pair< const int, std::vector< std::size_t > >&,
401 : : const std::array< std::vector< real >, 3 >&,
402 : : bool ) const = 0;
403 : : virtual void symbc(
404 : : tk::Fields& U,
405 : : const std::array< std::vector< real >, 3 >&,
406 : : const std::unordered_map< int,
407 : : std::unordered_map< std::size_t,
408 : : std::array< real, 4 > > >&,
409 : : const std::unordered_set< std::size_t >& ) const = 0;
410 : : virtual void farfieldbc(
411 : : tk::Fields&,
412 : : const std::array< std::vector< real >, 3 >&,
413 : : const std::unordered_map< int,
414 : : std::unordered_map< std::size_t,
415 : : std::array< real, 4 > > >&,
416 : : const std::unordered_set< std::size_t >& ) const = 0;
417 : : virtual void slipwallbc(
418 : : tk::Fields& U,
419 : : const tk::Fields& W,
420 : : const std::array< std::vector< real >, 3 >&,
421 : : const std::unordered_map< int,
422 : : std::unordered_map< std::size_t,
423 : : std::array< real, 4 > > >&,
424 : : const std::unordered_set< std::size_t >& ) const = 0;
425 : : virtual void timedepbc(
426 : : tk::real,
427 : : tk::Fields&,
428 : : const std::vector< std::unordered_set< std::size_t > >&,
429 : : const std::vector< tk::Table<5> >& ) const = 0;
430 : : virtual std::map< std::string, tk::GetVarFn > OutVarFn() const = 0;
431 : : virtual std::vector< std::string > analyticFieldNames() const = 0;
432 : : virtual std::vector< std::string > surfNames() const = 0;
433 : : virtual std::vector< std::string > histNames() const = 0;
434 : : virtual std::vector< std::string > names() const = 0;
435 : : virtual std::vector< std::vector< real > > surfOutput(
436 : : const std::map< int, std::vector< std::size_t > >&,
437 : : const tk::Fields& ) const = 0;
438 : : virtual std::vector< std::vector< real > > elemSurfOutput(
439 : : const std::map< int, std::vector< std::size_t > >&,
440 : : const std::vector< std::size_t >&,
441 : : const tk::Fields& ) const = 0;
442 : : virtual std::vector< std::vector< real > > histOutput(
443 : : const std::vector< HistData >&,
444 : : const std::vector< std::size_t >&,
445 : : const tk::Fields& ) const = 0;
446 : : virtual tk::InitializeFn::result_type analyticSolution(
447 : : real xi, real yi, real zi, real t ) const = 0;
448 : : virtual tk::InitializeFn::result_type solution(
449 : : tk::real xi, tk::real yi, tk::real zi, tk::real t ) const = 0;
450 : : };
451 : :
452 : : //! \brief Model models the Concept above by deriving from it and overriding
453 : : //! the virtual functions required by Concept
454 : : template< typename T >
455 [ - - ][ - - ]: 0 : struct Model : Concept {
[ - - ][ - - ]
[ - - ][ - - ]
[ - - ][ - - ]
[ - - ][ - - ]
[ - - ]
456 [ - - ][ - - ]: 275 : explicit Model( T x ) : data( std::move(x) ) {}
[ - - ][ - - ]
[ - - ][ - - ]
[ - - ][ - - ]
[ + - ][ - - ]
457 : 0 : Concept* copy() const override { return new Model( *this ); }
458 : 738 : void IcBoxNodes( const tk::UnsMesh::Coords& coord,
459 : : const std::vector< std::size_t >& inpoel,
460 : : const std::unordered_map< std::size_t, std::set< std::size_t > >& elemblkid,
461 : : std::vector< std::unordered_set< std::size_t > >& inbox,
462 : : std::unordered_map< std::size_t, std::set< std::size_t > >& nodeblkid,
463 : : std::size_t& nuserblk )
464 : 722 : override { data.IcBoxNodes( coord, inpoel, elemblkid, inbox, nodeblkid,
465 : 738 : nuserblk ); }
466 : 920 : void initialize(
467 : : const std::array< std::vector< real >, 3 >& coord,
468 : : tk::Fields& unk,
469 : : real t,
470 : : real V,
471 : : const std::vector< std::unordered_set< std::size_t > >& inbox,
472 : : const std::vector< tk::real >& blkvols,
473 : : const std::unordered_map< std::size_t, std::set< std::size_t > >&
474 : : nodeblkid)
475 : 920 : override { data.initialize( coord, unk, t, V, inbox, blkvols, nodeblkid ); }
476 : 28552 : void velocity( const tk::Fields& u, tk::UnsMesh::Coords& v ) const
477 : 28552 : override { data.velocity(u,v); }
478 : 28552 : void soundspeed( const tk::Fields& u, std::vector< tk::real >& s ) const
479 : 28552 : override { data.soundspeed(u,s); }
480 : 37101 : void chBndGrad( const std::array< std::vector< real >, 3 >& coord,
481 : : const std::vector< std::size_t >& inpoel,
482 : : const std::vector< std::size_t >& bndel,
483 : : const std::vector< std::size_t >& gid,
484 : : const std::unordered_map< std::size_t, std::size_t >& bid,
485 : : const tk::Fields& U,
486 : : tk::Fields& G ) const override
487 : 37101 : { data.chBndGrad( coord, inpoel, bndel, gid, bid, U, G ); }
488 : 37101 : void rhs(
489 : : real t,
490 : : const std::array< std::vector< real >, 3 >& coord,
491 : : const std::vector< std::size_t >& inpoel,
492 : : const std::vector< std::size_t >& triinpoel,
493 : : const std::vector< std::size_t >& gid,
494 : : const std::unordered_map< std::size_t, std::size_t >& bid,
495 : : const std::unordered_map< std::size_t, std::size_t >& lid,
496 : : const std::vector< real >& dfn,
497 : : const std::pair< std::vector< std::size_t >,
498 : : std::vector< std::size_t > >& psup,
499 : : const std::pair< std::vector< std::size_t >,
500 : : std::vector< std::size_t > >& esup,
501 : : const std::vector< int >& symbctri,
502 : : const std::vector< int >& slipwallbctri,
503 : : const std::vector< real >& vol,
504 : : const std::vector< std::size_t >& edgenode,
505 : : const std::vector< std::size_t >& edgeid,
506 : : const std::vector< std::unordered_set< std::size_t > >& boxnodes,
507 : : const tk::Fields& G,
508 : : const tk::Fields& U,
509 : : const tk::Fields& W,
510 : : const std::vector< real >& tp,
511 : : real V,
512 : : tk::Fields& R,
513 : : std::vector< int >& srcFlag ) const override
514 : 37101 : { data.rhs( t, coord, inpoel, triinpoel, gid, bid, lid, dfn, psup,
515 : : esup, symbctri, slipwallbctri, vol, edgenode,
516 : 37101 : edgeid, boxnodes, G, U, W, tp, V, R, srcFlag ); }
517 : 0 : void bndPressureInt(
518 : : const std::array< std::vector< real >, 3 >& coord,
519 : : const std::vector< std::size_t >& triinpoel,
520 : : const std::vector< int >& slipwallbctri,
521 : : const tk::Fields& U,
522 : : const std::array< tk::real, 3 >& CM,
523 : : std::vector< real >& F ) const override
524 : 0 : { data.bndPressureInt( coord, triinpoel, slipwallbctri, U, CM, F ); }
525 : 6327 : real dt( const std::array< std::vector< real >, 3 >& coord,
526 : : const std::vector< std::size_t >& inpoel,
527 : : tk::real t,
528 : : tk::real dtn,
529 : : const tk::Fields& U,
530 : : const std::vector< tk::real >& vol,
531 : : const std::vector< tk::real >& voln,
532 : : const std::vector< int >& srcFlag ) const override
533 : 6327 : { return data.dt( coord, inpoel, t, dtn, U, vol, voln, srcFlag ); }
534 : 200 : void dt( uint64_t it,
535 : : const std::vector< real > & vol,
536 : : const tk::Fields& U,
537 : : std::vector< real >& dtp ) const override
538 : 200 : { data.dt( it, vol, U, dtp ); }
539 : : std::map< std::size_t, std::vector< std::pair<bool,real> > >
540 : 90927 : dirbc( real t,
541 : : real deltat,
542 : : const std::vector< real >& tp,
543 : : const std::vector< real >& dtp,
544 : : const std::pair< const int, std::vector< std::size_t > >& sides,
545 : : const std::array< std::vector< real >, 3 >& coord,
546 : : bool increment ) const
547 : : override { return data.dirbc( t, deltat, tp, dtp, sides, coord,
548 : 90927 : increment ); }
549 : 49461 : void symbc(
550 : : tk::Fields& U,
551 : : const std::array< std::vector< real >, 3 >& coord,
552 : : const std::unordered_map< int,
553 : : std::unordered_map< std::size_t,
554 : : std::array< real, 4 > > >& bnorm,
555 : : const std::unordered_set< std::size_t >& nodes ) const override
556 : 49461 : { data.symbc( U, coord, bnorm, nodes ); }
557 : 49452 : void farfieldbc(
558 : : tk::Fields& U,
559 : : const std::array< std::vector< real >, 3 >& coord,
560 : : const std::unordered_map< int,
561 : : std::unordered_map< std::size_t,
562 : : std::array< real, 4 > > >& bnorm,
563 : : const std::unordered_set< std::size_t >& nodes ) const override
564 : 49452 : { data.farfieldbc( U, coord, bnorm, nodes ); }
565 : 49461 : void slipwallbc(
566 : : tk::Fields& U,
567 : : const tk::Fields& W,
568 : : const std::array< std::vector< real >, 3 >& coord,
569 : : const std::unordered_map< int,
570 : : std::unordered_map< std::size_t,
571 : : std::array< real, 4 > > >& bnorm,
572 : : const std::unordered_set< std::size_t >& nodes ) const override
573 : 49461 : { data.slipwallbc( U, W, coord, bnorm, nodes ); }
574 : : void
575 : 37540 : timedepbc(
576 : : tk::real t,
577 : : tk::Fields& U,
578 : : const std::vector< std::unordered_set< std::size_t > >& nodes,
579 : : const std::vector< tk::Table<5> >& timedepfn ) const override
580 : 37540 : { data.timedepbc( t, U, nodes, timedepfn ); }
581 : 838 : std::map< std::string, tk::GetVarFn > OutVarFn() const override
582 : 838 : { return data.OutVarFn(); }
583 : 630 : std::vector< std::string > analyticFieldNames() const override
584 : 630 : { return data.analyticFieldNames(); }
585 : 838 : std::vector< std::string > surfNames() const override
586 : 838 : { return data.surfNames(); }
587 : 22 : std::vector< std::string > histNames() const override
588 : 22 : { return data.histNames(); }
589 : 79 : std::vector< std::string > names() const override
590 : 79 : { return data.names(); }
591 : 838 : std::vector< std::vector< real > > surfOutput(
592 : : const std::map< int, std::vector< std::size_t > >& bnd,
593 : : const tk::Fields& U ) const override
594 : 838 : { return data.surfOutput( bnd, U ); }
595 : 838 : std::vector< std::vector< real > > elemSurfOutput(
596 : : const std::map< int, std::vector< std::size_t > >& bface,
597 : : const std::vector< std::size_t >& triinpoel,
598 : : const tk::Fields& U ) const override
599 : 838 : { return data.elemSurfOutput( bface, triinpoel, U ); }
600 : 214 : std::vector< std::vector< real > > histOutput(
601 : : const std::vector< HistData >& h,
602 : : const std::vector< std::size_t >& inpoel,
603 : : const tk::Fields& U ) const override
604 : 214 : { return data.histOutput( h, inpoel, U ); }
605 : : tk::InitializeFn::result_type
606 : 25005 : analyticSolution( real xi, real yi, real zi, real t )
607 : 25005 : const override { return data.analyticSolution( xi, yi, zi, t ); }
608 : : tk::InitializeFn::result_type
609 : 949040 : solution( real xi, real yi, real zi, real t )
610 : 949040 : const override { return data.solution( xi, yi, zi, t ); }
611 : : T data;
612 : : };
613 : :
614 : : std::unique_ptr< Concept > self; //!< Base pointer used polymorphically
615 : : };
616 : :
617 : : } // inciter::
618 : :
619 : : #endif // CGPDE_h
|