www.cemf.ir
vibratingMotion.cpp
Go to the documentation of this file.
1 #include "vibratingMotion.hpp"
2 
4 (
5  uint32 iter,
6  real t,
7  real dt
8 )const
9 {
10  auto motion = motionComponents_.deviceViewAll();
11  Kokkos::parallel_for(
12  "vibratingMotion::impl_setTime",
13  deviceRPolicyStatic(0, numComponents_),
14  LAMBDA_HD(uint32 i){
15  motion[i].setTime(t);
16  });
17  Kokkos::fence();
18 }
19 
21 (
22  const objectFile &objf,
23  repository *owner
24 )
25 :
26  fileDictionary(objf, owner)
27 {
28  if(! getModel().impl_readDictionary(*this) )
29  {
31  fatalExit;
32  }
33 }
34 
36 (
37  const objectFile &objf,
38  const dictionary &dict,
39  repository *owner
40 )
41 :
42  fileDictionary(objf,dict,owner)
43 {
44  if(! getModel().impl_readDictionary(*this) )
45  {
47  fatalExit;
48  }
49 }
50 
52 {
53  // a global dictionary
54  dictionary newDict(fileDictionary::dictionary::name(), true);
55  if( iop.thisProcWriteData() )
56  {
57  if( !getModel().impl_writeDictionary(newDict) ||
58  !newDict.write(os))
59  {
61  " error in writing to dictionary "<< newDict.globalName()<<endl;
62  return false;
63  }
64  }
65  return true;
66 }
pFlow::vibratingMotion::impl_setTime
void impl_setTime(uint32 iter, real t, real dt) const
Definition: vibratingMotion.cpp:4
pFlow::real
float real
Definition: builtinTypes.hpp:45
fatalExit
#define fatalExit
Fatal exit.
Definition: error.hpp:98
pFlow::MotionModel< vibratingMotion, vibrating >::impl_writeDictionary
bool impl_writeDictionary(dictionary &dict) const
Write to dictionary.
Definition: MotionModel.cpp:113
pFlow::uint32
unsigned int uint32
Definition: builtinTypes.hpp:56
pFlow::dictionary::globalName
virtual word globalName() const
global name of entry, separated with dots
Definition: dictionary.cpp:356
pFlow::endl
iOstream & endl(iOstream &os)
Add newline and flush stream.
Definition: iOstream.hpp:341
fatalErrorInFunction
#define fatalErrorInFunction
Report a fatal error and function name and exit the application.
Definition: error.hpp:77
pFlow::IOPattern
Definition: IOPattern.hpp:32
vibratingMotion.hpp
pFlow::dictionary::write
bool write(iOstream &os) const override
write to stream
Definition: dictionary.cpp:793
pFlow::IOPattern::thisProcWriteData
bool thisProcWriteData() const
Definition: IOPattern.hpp:146
pFlow::MotionModel< vibratingMotion, vibrating >::getModel
auto & getModel()
obtain a reference to the actual motion model
Definition: MotionModel.hpp:130
pFlow::vibratingMotion::vibratingMotion
vibratingMotion(const objectFile &objf, repository *owner)
Definition: vibratingMotion.cpp:21
pFlow::objectFile
Definition: objectFile.hpp:30
pFlow::fileDictionary
Definition: fileDictionary.hpp:29
LAMBDA_HD
#define LAMBDA_HD
Definition: pFlowMacros.hpp:58
pFlow::deviceRPolicyStatic
Kokkos::RangePolicy< Kokkos::DefaultExecutionSpace, Kokkos::Schedule< Kokkos::Static >, Kokkos::IndexType< pFlow::uint32 > > deviceRPolicyStatic
Definition: KokkosTypes.hpp:66
pFlow::repository
Definition: repository.hpp:34
pFlow::iOstream
Interface class for any output stream.
Definition: iOstream.hpp:59
pFlow::dictionary
Dictionary holds a set of data entries or sub-dictionaries that are enclosed in a curely braces or ar...
Definition: dictionary.hpp:67
pFlow::vibratingMotion::write
bool write(iOstream &os, const IOPattern &iop) const override
Definition: vibratingMotion.cpp:51