VirtualFluids
0.2.0
Parallel CFD LBM Solver
Loading...
Searching...
No Matches
Forest.h
Go to the documentation of this file.
1
//=======================================================================================
2
// ____ ____ __ ______ __________ __ __ __ __
3
// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
4
// \ \ | | | | | |_) | | | | | | | / \ | |
5
// \ \ | | | | | _ / | | | | | | / /\ \ | |
6
// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
7
// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
8
// \ \ | | ________________________________________________________________
9
// \ \ | | | ______________________________________________________________|
10
// \ \| | | | __ __ __ __ ______ _______
11
// \ | | |_____ | | | | | | | | | _ \ / _____)
12
// \ | | _____| | | | | | | | | | | \ \ \_______
13
// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
14
// \ _____| |__| |________| \_______/ |__| |______/ (_______/
15
//
16
// This file is part of VirtualFluids. VirtualFluids is free software: you can
17
// redistribute it and/or modify it under the terms of the GNU General Public
18
// License as published by the Free Software Foundation, either version 3 of
19
// the License, or (at your option) any later version.
20
//
21
// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
22
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
23
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24
// for more details.
25
//
26
// SPDX-License-Identifier: GPL-3.0-or-later
27
// SPDX-FileCopyrightText: Copyright © VirtualFluids Project contributors, see AUTHORS.md in root folder
28
//
32
#ifndef FOREST_H
33
#define FOREST_H
34
35
#include "
Parameter/Parameter.h
"
36
#include "
PreCollisionInteractor/PreCollisionInteractor.h
"
37
#include <
basics/DataTypes.h
>
38
#include <
basics/constants/NumericConstants.h
>
39
#include <stdexcept>
40
41
namespace
vf::gpu
{
42
class
GridProvider;
43
44
enum class
PlantAreaDensityFunction
{
45
Flat
,
46
BottomHeavy
,
47
TopHeavy
48
};
49
50
class
Forest
:
public
PreCollisionInteractor
51
{
52
public
:
53
Forest
(
SPtr<Parameter>
para
,
SPtr<CudaMemoryManager>
cudaMemoryManager
,
real
height
,
real
dragCoefficient
,
54
real
plantAreaIndex
,
int
level
,
PlantAreaDensityFunction
plantAreaDensityFunction
)
55
:
PreCollisionInteractor
(
para
,
cudaMemoryManager
),
56
height
(
height
),
57
dragCoefficient
(
dragCoefficient
),
58
plantAreaIndex
(
plantAreaIndex
),
59
level
(
level
),
60
plantAreaDensityFunction
(
plantAreaDensityFunction
),
61
leafAreaDensityH
(
nullptr
),
62
leafAreaDensityD
(
nullptr
)
63
{
64
// if (level > para->getMaxLevel())
65
// throw std::runtime_error("specified level does not exist.");
66
}
67
68
~Forest
()
override
;
69
void
init
()
override
;
70
void
interact
(
int
level
,
uint
t
)
override
;
71
void
getTaggedFluidNodes
(
GridProvider
*
gridProvider
)
override
;
72
73
uint
getNumberOfIndices
()
const
74
{
75
return
this->
numberOfIndices
;
76
}
77
78
private
:
79
void
initForestIndices();
80
void
initForestVelocities();
81
void
initLeafAreaDensity();
82
83
public
:
84
uint
*
forestIndicesH
;
85
uint
*
forestIndicesD
;
86
real
*
forestVelocitiesXPreviousTimestepD
;
87
real
*
forestVelocitiesYPreviousTimestepD
;
88
real
*
forestVelocitiesZPreviousTimestepD
;
89
real
*
leafAreaDensityH
;
90
real
*
leafAreaDensityD
;
91
92
protected
:
93
const
real
height
;
94
const
real
dragCoefficient
;
95
const
real
plantAreaIndex
;
96
const
int
level
;
97
PlantAreaDensityFunction
plantAreaDensityFunction
;
98
uint
numberOfIndices
{0};
99
real
forceRatio
;
100
};
101
102
}
103
#endif
// FOREST_H
104
DataTypes.h
NumericConstants.h
Parameter.h
PreCollisionInteractor.h
vf::gpu::Forest
Definition
Forest.h:51
vf::gpu::Forest::init
void init() override
vf::gpu::Forest::forestVelocitiesXPreviousTimestepD
real * forestVelocitiesXPreviousTimestepD
Definition
Forest.h:86
vf::gpu::Forest::dragCoefficient
const real dragCoefficient
Definition
Forest.h:94
vf::gpu::Forest::height
const real height
Definition
Forest.h:93
vf::gpu::Forest::leafAreaDensityH
real * leafAreaDensityH
Definition
Forest.h:89
vf::gpu::Forest::forestIndicesH
uint * forestIndicesH
Definition
Forest.h:84
vf::gpu::Forest::forestIndicesD
uint * forestIndicesD
Definition
Forest.h:85
vf::gpu::Forest::~Forest
~Forest() override
vf::gpu::Forest::plantAreaIndex
const real plantAreaIndex
Definition
Forest.h:95
vf::gpu::Forest::forceRatio
real forceRatio
Definition
Forest.h:99
vf::gpu::Forest::forestVelocitiesZPreviousTimestepD
real * forestVelocitiesZPreviousTimestepD
Definition
Forest.h:88
vf::gpu::Forest::plantAreaDensityFunction
PlantAreaDensityFunction plantAreaDensityFunction
Definition
Forest.h:97
vf::gpu::Forest::numberOfIndices
uint numberOfIndices
Definition
Forest.h:98
vf::gpu::Forest::interact
void interact(int level, uint t) override
vf::gpu::Forest::leafAreaDensityD
real * leafAreaDensityD
Definition
Forest.h:90
vf::gpu::Forest::getTaggedFluidNodes
void getTaggedFluidNodes(GridProvider *gridProvider) override
vf::gpu::Forest::level
const int level
Definition
Forest.h:96
vf::gpu::Forest::forestVelocitiesYPreviousTimestepD
real * forestVelocitiesYPreviousTimestepD
Definition
Forest.h:87
vf::gpu::Forest::getNumberOfIndices
uint getNumberOfIndices() const
Definition
Forest.h:73
vf::gpu::Forest::Forest
Forest(SPtr< Parameter > para, SPtr< CudaMemoryManager > cudaMemoryManager, real height, real dragCoefficient, real plantAreaIndex, int level, PlantAreaDensityFunction plantAreaDensityFunction)
Definition
Forest.h:53
vf::gpu::GridProvider
Definition
GridProvider.h:59
vf::gpu::PreCollisionInteractor
Definition
PreCollisionInteractor.h:46
vf::gpu::PreCollisionInteractor::cudaMemoryManager
SPtr< CudaMemoryManager > cudaMemoryManager
Definition
PreCollisionInteractor.h:58
vf::gpu::PreCollisionInteractor::para
SPtr< Parameter > para
Definition
PreCollisionInteractor.h:57
SPtr
std::shared_ptr< T > SPtr
Definition
PointerDefinitions.h:39
real
float real
Definition
DataTypes.h:42
uint
unsigned int uint
Definition
DataTypes.h:47
vf::gpu
Definition
AdvectionDiffusion.h:43
vf::gpu::PlantAreaDensityFunction
PlantAreaDensityFunction
Definition
Forest.h:44
vf::gpu::PlantAreaDensityFunction::BottomHeavy
@ BottomHeavy
vf::gpu::PlantAreaDensityFunction::Flat
@ Flat
vf::gpu::PlantAreaDensityFunction::TopHeavy
@ TopHeavy
src
gpu
core
PreCollisionInteractor
Forest.h
Generated on Sat Sep 12 2026 02:03:20 for VirtualFluids by
1.9.8