[asl] 90/177: Adding comments
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Thu Aug 27 09:22:44 UTC 2015
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to branch master
in repository asl.
commit 2aeee9ce785235d90bca3b4ea47474d9eb690dc9
Author: Avtech Scientific <AvtechScientific at users.noreply.github.com>
Date: Mon Jul 13 12:24:55 2015 +0300
Adding comments
---
CMakeLists.txt | 2 +-
README.md | 21 +++++++-------
cmake/ASLBuildOptions.cmake | 2 +-
examples/flow/locomotive_in_tunnel.cc | 52 +++++++++++++++++++++++++----------
examples/flow/multicomponent_flow.cc | 27 ++++++++----------
5 files changed, 61 insertions(+), 43 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5afa1c1..3f6cf2f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,7 +23,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/" "${CMAKE
include(GNUInstallDirs)
-# Add ASL definitions
+# Add ASL cmake definitions
include(ASLBuildOptions)
include(ASLBuildFunctions)
diff --git a/README.md b/README.md
index c12665f..42c238d 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,7 @@
+
+For more information, please visit <http://asl.org.il>.
+
+
# ASL
__Advanced Simulation Library (ASL)__ is a free and open source multiphysics simulation software package. Its computational engine is based, among others, on the [Lattice Boltzmann Methods](http://en.wikipedia.org/wiki/Lattice_Boltzmann_methods) and is written in [OpenCL](http://en.wikipedia.org/wiki/OpenCL) which enable [extraordinarily efficient deployment](http://asl.org.il/benchmarks) on a variety of massively parallel architectures, ranging from inexpensive FPGAs, DSPs and GPUs up t [...]
@@ -8,11 +12,6 @@ __Advanced Simulation Library (ASL)__ is a free and open source multiphysics sim
ASL is distributed under the free GNU Affero General Public License (AGPLv3) with an optional [commercial license](http://asl.org.il/licensing). Professional support and consulting services are provided by [Avtech Scientific](http://avtechscientific.com), whose team created and continues to extend the library. The company offers [innovative R&D solutions and services](http://avtechscientific.com/services) and is involved in diverse academic and industrial [collaborative projects](http:// [...]
-## Further information
-
-For more information, please visit <http://asl.org.il>.
-
-
## Quick Start
### Installation
@@ -22,8 +21,8 @@ For more information, please visit <http://asl.org.il>.
- [C++ bindings for OpenCL](https://www.khronos.org/registry/cl/api/1.1/cl.hpp) (OpenCL Specification License)
- [boost](http://www.boost.org) (Boost Software License)
- [VTK](http://vtk.org) (BSD License)
- - optional: [matio](https://sourceforge.net/projects/matio) (BSD License)
- - optional: [doxygen](http://doxygen.org) (preferably with [graphviz](http://www.graphviz.org)) for API documentation generation
+ - [optional](https://github.com/AvtechScientific/ASL/blob/master/cmake/ASLBuildOptions.cmake#L3): Matlab support - [matio](https://sourceforge.net/projects/matio) (BSD License)
+ - [optional](https://github.com/AvtechScientific/ASL/blob/master/cmake/ASLBuildOptions.cmake#L4): API documentation - [doxygen](http://doxygen.org) (preferably with [graphviz](http://www.graphviz.org))
2. Download and extract the [ASL source code archive](https://github.com/AvtechScientific/ASL/releases/latest).
3. Create a build directory: `mkdir build-asl; cd build-asl`
4. Use [cmake generator](http://www.cmake.org/cmake/help/v3.2/manual/cmake-generators.7.html) to produce Makefiles: `cmake -G "Unix Makefiles" ../ASL` or project files for your IDE (Visual Studio, Xcode, Eclipse, etc.): `cmake -G "Visual Studio 10" ../ASL`
@@ -34,16 +33,16 @@ For more information, please visit <http://asl.org.il>.
1. Go to examples: `cd examples/flow/locomotive_in_tunnel`
2. Copy the .stl input file: `cp ../../../../ASL/examples/input_data/locomotive.stl .`
3. Run: `./locomotive_in_tunnel`. Optionally: change some parameters - `./locomotive_in_tunnel --dx 0.1 --dt 2` or write all of them into a file for later editing/reuse - `./locomotive_in_tunnel -g bigGrid.ini`. List all available options - `locomotive_in_tunnel -h`.
-4. Post-processing: see [step by step example](https://github.com/AvtechScientific/ASL/wiki/User-Guide#post-processing) and the state file `examples/input_data/locomotive_in_tunnel.pvsm`.
+4. Post-processing: see [step by step example](https://github.com/AvtechScientific/ASL/wiki/User-Guide#post-processing) and the ParaView state file `examples/input_data/locomotive_in_tunnel.pvsm`.
### Writing your own code using ASL
1. Take a look on examples, start with [examples/flow/locomotive_in_tunnel.cc](http://asl.org.il/doc/Developer-Guide/locomotive_in_tunnel_8cc-example.html)
2. ASL installation supplies `ASL.pc` and `ASLConfig.cmake` files. To build your program using:
- - `pkg-config` - launch ``c++ `pkg-config --cflags --libs ASL` -o locomotive_in_tunnel locomotive_in_tunnel.cc``
- - `cmake` - write a basic `CMakeLists.txt` file:
+ - `pkg-config`: launch ``c++ `pkg-config --cflags --libs ASL` -o locomotive_in_tunnel locomotive_in_tunnel.cc``
+ - `cmake`: write a basic `CMakeLists.txt` file:
-```
+```CMakeLists.txt
project(locomotive)
cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR)
find_package(ASL 0.1.4 CONFIG REQUIRED)
diff --git a/cmake/ASLBuildOptions.cmake b/cmake/ASLBuildOptions.cmake
index 47043cb..83ec912 100644
--- a/cmake/ASLBuildOptions.cmake
+++ b/cmake/ASLBuildOptions.cmake
@@ -1,4 +1,4 @@
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
-option(WITH_MATIO "Build with Matlab support" OFF)
option(WITH_EXAMPLES "Build with examples" ON)
+option(WITH_MATIO "Build with Matlab support" OFF)
option(WITH_API_DOC "Compile doxygen API documentation" OFF)
\ No newline at end of file
diff --git a/examples/flow/locomotive_in_tunnel.cc b/examples/flow/locomotive_in_tunnel.cc
index 8c0279b..b8a02ee 100644
--- a/examples/flow/locomotive_in_tunnel.cc
+++ b/examples/flow/locomotive_in_tunnel.cc
@@ -116,7 +116,7 @@ int main(int argc, char* argv[])
// Define dimensionless viscosity value
FlT nuNum(nu.v() * dt.v() / dx.v() / dx.v());
- std::cout << "Data initialization... ";
+ cout << "Data initialization..." << endl;
// Read geometry of the locomotive from the file
auto locomotive(asl::readSurface("locomotive.stl", bl));
@@ -134,9 +134,11 @@ int main(int argc, char* argv[])
// Initialization
asl::initData(forceField, makeAVec(0., 0., 0.));
- std::cout << "Finished" << endl;
-
- std::cout << "Numerics initialization... ";
+ cout << "Finished" << endl;
+
+ cout << "Numerics initialization..." << endl;
+
+ // NOTE: the problem is considered in the reference frame related to the locomotive
// Generate numerical method for air flow - LBGK (lattice Bhatnagar–Gross–Krook)
asl::SPLBGK lbgk(new asl::LBGKTurbulence(block,
@@ -144,7 +146,9 @@ int main(int argc, char* argv[])
&asl::d3q15()));
lbgk->init();
+ // Generate an instance for LBGK data initialization
asl::SPLBGKUtilities lbgkUtil(new asl::LBGKUtilities(lbgk));
+ // Initialize the LBGK internal data so that the flow velocity of (0.1, 0, 0) in lattice units
lbgkUtil->initF(acl::generateVEConstant(.1, .0, .0));
auto vfTunnel(asl::generatePFConstant(makeAVec(0.1, 0., 0.)));
@@ -152,27 +156,39 @@ int main(int argc, char* argv[])
std::vector<asl::SPNumMethod> bc;
std::vector<asl::SPNumMethod> bcV;
+
+ // Generate boundary conditions for the tunnel geometry. Constant velocity BC
bc.push_back(generateBCVelocity(lbgk, vfTunnel, tunnelMap));
+ // Generate boundary conditions for the tunnel geometry. Constant velocity BC
+ // This BC is used for visualization.
bcV.push_back(generateBCVelocityVel(lbgk, vfTunnel, tunnelMap));
-// bcV.push_back(generateBCNoSlipRho(lbgk, tunnelMap));
+ bcV.push_back(generateBCNoSlipRho(lbgk, tunnelMap));
+
+ // Generate boundary conditions for the locomotive geometry. Non-slip BC
bc.push_back(generateBCNoSlip(lbgk, locomotive));
bcV.push_back(generateBCNoSlipVel(lbgk, locomotive));
-// bcV.push_back(generateBCNoSlipRho(lbgk, locomotive));
+ bcV.push_back(generateBCNoSlipRho(lbgk, locomotive));
+
+ // Generate constant presure BC for in and out planes of the tunnel
bc.push_back(generateBCConstantPressureVelocity(lbgk, 1.,
makeAVec(0.1, 0., 0.),
{asl::X0, asl::XE}));
+ // Initialization and building of all BC
initAll(bc);
initAll(bcV);
+ // Generate an object for force field of air on the locomotive
auto computeForce(generateComputeSurfaceForce(lbgk, forceField, locomotive));
computeForce->init();
- std::cout << "Finished" << endl;
- std::cout << "Computing... ";
+ cout << "Finished" << endl;
+ cout << "Computing..." << endl;
asl::Timer timer;
+ // Initialization of the output system
+ // Write the output to the directory containing the input parameters file (default "./")
asl::WriterVTKXML writer(appParamsManager.getDir() + "locomotive_in_tunnel");
writer.addScalars("map", *locomotive);
writer.addScalars("tunnel", *tunnelMap);
@@ -180,36 +196,42 @@ int main(int argc, char* argv[])
writer.addVector("v", *lbgk->getVelocity());
writer.addVector("force", *forceField);
+ // Execute all BC
executeAll(bc);
executeAll(bcV);
computeForce->execute();
+ // First data output
writer.write();
timer.start();
+ // Iteration loop
for (unsigned int i(1); i < 20001; ++i)
{
+ // One iteration (timestep) of bulk numerical procedure
lbgk->execute();
+ // Execution of the BC procedures
executeAll(bc);
+ // Output and analysis scope
if (!(i%1000))
{
cout << i << endl;
+ // Execution of the visualization BC procedures
executeAll(bcV);
+ // Computation of the force field
computeForce->execute();
+ // Data writing
writer.write();
}
}
timer.stop();
- std::cout << "Finished" << endl;
+ cout << "Finished" << endl;
- cout << "time=" << timer.getTime() << "; clockTime="
- << timer.getClockTime() << "; load="
+ cout << "Computation statistic:" << endl;
+ cout << "time = " << timer.getTime() << "; clockTime = "
+ << timer.getClockTime() << "; load = "
<< timer.getProcessorLoad() * 100 << "%" << endl;
- std::cout << "Output... ";
- std::cout << "Finished" << endl;
- std::cout << "Ok" << endl;
-
return 0;
}
\ No newline at end of file
diff --git a/examples/flow/multicomponent_flow.cc b/examples/flow/multicomponent_flow.cc
index e8f0407..1e3ccdc 100644
--- a/examples/flow/multicomponent_flow.cc
+++ b/examples/flow/multicomponent_flow.cc
@@ -146,7 +146,7 @@ int main(int argc, char *argv[])
Parameters params;
params.load(argc, argv);
- std::cout << "Data initialization...";
+ cout << "Data initialization..." << endl;
asl::Block block(params.size, params.dx.v());
@@ -159,9 +159,9 @@ int main(int argc, char *argv[])
asl::initData(component3Frac, 0);
- std::cout << "Finished" << endl;
-
- std::cout << "Numerics initialization...";
+ cout << "Finished" << endl;
+
+ cout << "Numerics initialization..." << endl;
auto templ(&asl::d3q15());
@@ -211,8 +211,8 @@ int main(int argc, char *argv[])
initAll(bcDif);
initAll(bcV);
- std::cout << "Finished" << endl;
- std::cout << "Computing..." << endl;
+ cout << "Finished" << endl;
+ cout << "Computing..." << endl;
asl::Timer timer;
asl::WriterVTKXML writer("multicomponent_flow");
@@ -240,7 +240,7 @@ int main(int argc, char *argv[])
if (!(i%100))
{
timer.stop();
- cout << i << "/10000; expected left time: " << timer.getLeftTime(double(i)/10000.) << endl;
+ cout << i << "/10000; time left (expected): " << timer.getLeftTime(double(i)/10000.) << endl;
executeAll(bcV);
writer.write();
timer.resume();
@@ -248,15 +248,12 @@ int main(int argc, char *argv[])
}
timer.stop();
- std::cout << "Finished" << endl;
-
- cout << "time=" << timer.getTime() << "; clockTime="
- << timer.getClockTime() << "; load="
- << timer.getProcessorLoad() * 100 << "%" << endl;
+ cout << "Finished" << endl;
- std::cout << "Output...";
- std::cout << "Finished" << endl;
- std::cout << "Ok" << endl;
+ cout << "Computation statistic:" << endl;
+ cout << "time = " << timer.getTime() << "; clockTime = "
+ << timer.getClockTime() << "; load = "
+ << timer.getProcessorLoad() * 100 << "%" << endl;
return 0;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/asl.git
More information about the debian-science-commits
mailing list