Some changes to be compatible with phasicFlowPlus-v1.0

This commit is contained in:
HRN 2024-12-27 19:26:09 +03:30
parent 16f8ab4572
commit 1f242d8911
9 changed files with 7 additions and 401 deletions

View File

@ -23,7 +23,7 @@ else()
set(Kokkos_Source_DIR $ENV{HOME}/Kokkos/kokkos)
endif()
message(STATUS "Kokkos source directory is ${Kokkos_Source_DIR}")
add_subdirectory(${Kokkos_Source_DIR} ${phasicFlow_BINARY_DIR}/kokkos)
add_subdirectory(${Kokkos_Source_DIR} ./kokkos)
Kokkos_cmake_settings()
@ -68,14 +68,13 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
#add a global include directory
include_directories(src/setHelpers src/demComponent "${PROJECT_BINARY_DIR}")
add_subdirectory(src)
add_subdirectory(solvers)
add_subdirectory(utilities)
#add_subdirectory(DEMSystems)
add_subdirectory(DEMSystems)
install(FILES "${PROJECT_BINARY_DIR}/phasicFlowConfig.H"
DESTINATION include)

View File

@ -31,8 +31,8 @@ target_include_directories(${target_name}
message(STATUS "\nCreating make file for executable ${target_name}")
message(STATUS " ${target_name} link libraries are: ${${target_link_libs}}")
message(STATUS " ${target_name} source files are: ${${source_files}}")
message(STATUS " ${target_name} include dirs are: ${includeDirs}\n")
#message(STATUS " ${target_name} source files are: ${${source_files}}")
#message(STATUS " ${target_name} include dirs are: ${includeDirs}\n")
install(TARGETS ${target_name} DESTINATION bin)

View File

@ -41,8 +41,8 @@ target_include_directories(${target_name}
message(STATUS "\nCreating make file for library ${target_name}")
message(STATUS " ${target_name} link libraries are: ${${target_link_libs}}")
message(STATUS " ${target_name} source files are: ${source_files}")
message(STATUS " ${target_name} include dirs are: ${includeDirs}\n \n")
#message(STATUS " ${target_name} source files are: ${source_files}")
#message(STATUS " ${target_name} include dirs are: ${includeDirs}\n \n")
install(TARGETS ${target_name} DESTINATION lib)
install(FILES ${includeFiles} DESTINATION include/${target_name})

View File

@ -1,116 +0,0 @@
/*------------------------------- phasicFlow ---------------------------------
O C enter of
O O E ngineering and
O O M ultiscale modeling of
OOOOOOO F luid flow
------------------------------------------------------------------------------
Copyright (C): www.cemf.ir
email: hamid.r.norouzi AT gmail.com
------------------------------------------------------------------------------
Licence:
This file is part of phasicFlow code. It is a free software for simulating
granular and multiphase flows. You can redistribute it and/or modify it under
the terms of GNU General Public License v3 or any other later versions.
phasicFlow is distributed to help others in their research in the field of
granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-----------------------------------------------------------------------------*/
#ifndef __eventMessage_hpp__
#define __eventMessage_hpp__
namespace pFlow
{
class eventMessage
{
public:
enum event : unsigned int
{
DELETE = 1,
INSERT = 2,
REARRANGE = 4,
SIZE_CHANGED = 8,
CAP_CHANGED = 16,
RANGE_CHANGED = 32
};
protected:
unsigned int message_;
public:
eventMessage()
:
message_(0)
{}
eventMessage(unsigned int msg)
:
message_(msg)
{}
inline unsigned int get()const
{
return message_;
}
inline void set(unsigned int msg)
{
message_= msg;
}
inline void add(unsigned int msg)
{
message_ = message_+ msg;
}
inline bool equivalentTo( const event& evt )const
{
return (message_ & evt) == evt;
}
inline bool isNull()const
{
return message_ == 0u;
}
inline bool isDeleted()const
{
return equivalentTo(event::DELETE);
}
inline bool isInsert()const
{
return equivalentTo(event::INSERT);
}
inline bool isRearranged()const
{
return equivalentTo(event::REARRANGE);
}
inline bool isSizeChanged()const
{
return equivalentTo(event::SIZE_CHANGED);
}
inline bool isCapacityChanged()const
{
return equivalentTo(event::CAP_CHANGED);
}
inline bool isRangeChanged()const
{
return equivalentTo(event::RANGE_CHANGED);
}
};
}
#endif // __eventMessage_hpp__

View File

@ -1,56 +0,0 @@
/*------------------------------- phasicFlow ---------------------------------
O C enter of
O O E ngineering and
O O M ultiscale modeling of
OOOOOOO F luid flow
------------------------------------------------------------------------------
Copyright (C): www.cemf.ir
email: hamid.r.norouzi AT gmail.com
------------------------------------------------------------------------------
Licence:
This file is part of phasicFlow code. It is a free software for simulating
granular and multiphase flows. You can redistribute it and/or modify it under
the terms of GNU General Public License v3 or any other later versions.
phasicFlow is distributed to help others in their research in the field of
granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-----------------------------------------------------------------------------*/
#include "eventObserver.hpp"
#include "eventSubscriber.hpp"
pFlow::eventObserver::eventObserver():
subscriber_(nullptr),
subscribed_(false)
{}
pFlow::eventObserver::eventObserver
(
const eventSubscriber& subscriber,
bool subscribe
)
:
subscriber_(&subscriber),
subscribed_(false)
{
if(subscribe && subscriber_)
{
subscribed_ = subscriber_->subscribe(this);
}
}
pFlow::eventObserver::~eventObserver()
{
if(subscribed_ && subscriber_)
subscriber_->unsubscribe(this);
}
bool pFlow::eventObserver::subscribe(const eventSubscriber& subscriber)
{
subscriber_ = &subscriber;
subscribed_ = subscriber_->subscribe(this);
return subscribed_;
}

View File

@ -1,65 +0,0 @@
/*------------------------------- phasicFlow ---------------------------------
O C enter of
O O E ngineering and
O O M ultiscale modeling of
OOOOOOO F luid flow
------------------------------------------------------------------------------
Copyright (C): www.cemf.ir
email: hamid.r.norouzi AT gmail.com
------------------------------------------------------------------------------
Licence:
This file is part of phasicFlow code. It is a free software for simulating
granular and multiphase flows. You can redistribute it and/or modify it under
the terms of GNU General Public License v3 or any other later versions.
phasicFlow is distributed to help others in their research in the field of
granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-----------------------------------------------------------------------------*/
#ifndef __eventObserver_hpp__
#define __eventObserver_hpp__
#include "eventMessage.hpp"
namespace pFlow
{
class eventSubscriber;
class eventObserver
{
protected:
const eventSubscriber* subscriber_ = nullptr;
// if this object is linked to subscriber
bool subscribed_ = false;
public:
eventObserver();
eventObserver(const eventSubscriber& subscriber, bool subscribe = true );
virtual ~eventObserver();
inline bool subscribed()const {return subscribed_;}
bool subscribe(const eventSubscriber& subscriber);
inline void invalidateSubscriber()
{
subscribed_ = false;
}
virtual bool update(const eventMessage& msg)=0;
};
} // pFlow
#endif // __eventObserver_hpp__

View File

@ -1,92 +0,0 @@
/*------------------------------- phasicFlow ---------------------------------
O C enter of
O O E ngineering and
O O M ultiscale modeling of
OOOOOOO F luid flow
------------------------------------------------------------------------------
Copyright (C): www.cemf.ir
email: hamid.r.norouzi AT gmail.com
------------------------------------------------------------------------------
Licence:
This file is part of phasicFlow code. It is a free software for simulating
granular and multiphase flows. You can redistribute it and/or modify it under
the terms of GNU General Public License v3 or any other later versions.
phasicFlow is distributed to help others in their research in the field of
granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-----------------------------------------------------------------------------*/
#include "eventSubscriber.hpp"
#include "Set.hpp"
pFlow::eventSubscriber::~eventSubscriber()
{
for(auto& observer:observerList_)
{
observer->invalidateSubscriber();
}
}
bool pFlow::eventSubscriber::subscribe
(
eventObserver* observer
)const
{
if(observer)
{
observerList_.push_back(observer);
return true;
}
else
{
return false;
}
}
bool pFlow::eventSubscriber::unsubscribe
(
eventObserver* observer
)const
{
if(observer)
{
observerList_.remove(observer);
}
return true;
}
bool pFlow::eventSubscriber::notify
(
const eventMessage &msg
)
{
for ( auto& observer:observerList_ )
{
if(observer)
if( !observer->update(msg) ) return false;
}
return true;
}
bool pFlow::eventSubscriber::notify
(
const eventMessage& msg,
const List<eventObserver*>& exclutionList
)
{
Set<eventObserver*> sortedExcList(exclutionList.begin(),exclutionList.end());
for(auto& observer:observerList_)
{
if( observer && sortedExcList.count(observer) == 0 )
{
if(!observer->update(msg)) return false;
}
}
return true;
}

View File

@ -1,64 +0,0 @@
/*------------------------------- phasicFlow ---------------------------------
O C enter of
O O E ngineering and
O O M ultiscale modeling of
OOOOOOO F luid flow
------------------------------------------------------------------------------
Copyright (C): www.cemf.ir
email: hamid.r.norouzi AT gmail.com
------------------------------------------------------------------------------
Licence:
This file is part of phasicFlow code. It is a free software for simulating
granular and multiphase flows. You can redistribute it and/or modify it under
the terms of GNU General Public License v3 or any other later versions.
phasicFlow is distributed to help others in their research in the field of
granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-----------------------------------------------------------------------------*/
#ifndef __eventSubscriber_hpp__
#define __eventSubscriber_hpp__
#include "List.hpp"
#include "eventObserver.hpp"
#include "eventMessage.hpp"
namespace pFlow
{
class eventSubscriber
{
protected:
// - list of subsribed objectd that recieve updage messages
mutable List<eventObserver*> observerList_;
public:
eventSubscriber()
{}
virtual ~eventSubscriber();
virtual bool subscribe(eventObserver* observer)const;
virtual bool unsubscribe(eventObserver* observer)const;
bool notify(const eventMessage& msg);
bool notify(const eventMessage& msg, const List<eventObserver*>& exclutionList );
};
} // pFlow
#endif // __eventSubscriber_hpp__

View File

@ -1,7 +1,7 @@
set(SourceFiles
readFromTimeFolder.cpp
#readControlDict.cpp
readControlDict.cpp
vtkFile/vtkFile.cpp
geometryPhasicFlow/Wall/Wall.cpp
geometryPhasicFlow/planeWall/planeWall.cpp