www.cemf.ir
rotatingAxisMotion.cpp
Go to the documentation of this file.
1 /*------------------------------- phasicFlow ---------------------------------
2  O C enter of
3  O O E ngineering and
4  O O M ultiscale modeling of
5  OOOOOOO F luid flow
6 ------------------------------------------------------------------------------
7  Copyright (C): www.cemf.ir
8  email: hamid.r.norouzi AT gmail.com
9 ------------------------------------------------------------------------------
10 Licence:
11  This file is part of phasicFlow code. It is a free software for simulating
12  granular and multiphase flows. You can redistribute it and/or modify it under
13  the terms of GNU General Public License v3 or any other later versions.
14 
15  phasicFlow is distributed to help others in their research in the field of
16  granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
17  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 
19 -----------------------------------------------------------------------------*/
20 
21 #include "rotatingAxisMotion.hpp"
22 
24 (
25  uint32 iter,
26  real t,
27  real dt
28 )const
29 {
30  auto motion = motionComponents_.deviceViewAll();
31  Kokkos::parallel_for(
32  "rotatingAxisMotion::impl_setTime",
33  deviceRPolicyStatic(0, numComponents_),
34  LAMBDA_HD(uint32 i){
35  motion[i].setTime(t);
36  });
37  Kokkos::fence();
38 }
39 
41  const objectFile &objf,
42  repository *owner)
43  : fileDictionary(objf, owner)
44 {
45 
46  if(! impl_readDictionary(*this) )
47  {
49  fatalExit;
50  }
51 }
52 
54 (
55  const objectFile &objf,
56  const dictionary &dict,
57  repository *owner
58 )
59 :
60  fileDictionary(objf, dict, owner)
61 {
62  if(!impl_readDictionary(*this) )
63  {
65  fatalExit;
66  }
67 }
68 
70 (
71  iOstream &os,
72  const IOPattern &iop
73 ) const
74 {
75  // a global dictionary
76  dictionary newDict(fileDictionary::dictionary::name(), true);
77  if( iop.thisProcWriteData() )
78  {
79  if( !this->impl_writeDictionary(newDict) ||
80  !newDict.write(os))
81  {
83  " error in writing to dictionary "<< newDict.globalName()<<endl;
84  return false;
85  }
86  }
87  return true;
88 }
pFlow::real
float real
Definition: builtinTypes.hpp:45
fatalExit
#define fatalExit
Fatal exit.
Definition: error.hpp:98
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::rotatingAxisMotion::rotatingAxisMotion
rotatingAxisMotion(const objectFile &objf, repository *owner)
Definition: rotatingAxisMotion.cpp:40
pFlow::endl
iOstream & endl(iOstream &os)
Add newline and flush stream.
Definition: iOstream.hpp:341
pFlow::MotionModel< rotatingAxisMotion, rotatingAxis >::impl_readDictionary
bool impl_readDictionary(const dictionary &dict)
Read from dictionary.
Definition: MotionModel.cpp:56
pFlow::rotatingAxisMotion::impl_setTime
void impl_setTime(uint32 iter, real t, real dt) const
Definition: rotatingAxisMotion.cpp:24
fatalErrorInFunction
#define fatalErrorInFunction
Report a fatal error and function name and exit the application.
Definition: error.hpp:77
pFlow::IOPattern
Definition: IOPattern.hpp:32
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
rotatingAxisMotion.hpp
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::rotatingAxisMotion::write
bool write(iOstream &os, const IOPattern &iop) const override
Definition: rotatingAxisMotion.cpp:70
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