VirtualFluids 0.2.0
Parallel CFD LBM Solver
Loading...
Searching...
No Matches
Field.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//
33//=======================================================================================
34#ifndef FIELD_H
35#define FIELD_H
36
38
39namespace vf::gpu {
40
41struct Vertex;
42
43class Field : public enableSharedFromThis<Field>
44{
45public:
47 Field() = default;
48 void allocateMemory();
49 void freeMemory();
50
51 uint getSize() const;
52 char getFieldEntry(uint index) const;
53
54 bool is(uint index, char type) const;
55 bool isCoarseToFineNode(uint index) const;
56 bool isFineToCoarseNode(uint index) const;
57 bool isFluid(uint index) const;
58 bool isInvalidSolid(uint index) const;
59 bool isQ(uint index) const;
60 bool isBoundaryConditionNode(uint index) const;
61 bool isInvalidCoarseUnderFine(uint index) const;
62 bool isStopperOutOfGrid(uint index) const;
63 bool isStopperCoarseUnderFine(uint index) const;
64 bool isStopperSolid(uint index) const;
65 bool isStopper(uint index) const;
66 bool isInvalidOutOfGrid(uint index) const;
67
68 void setFieldEntry(uint index, char val);
69 void setFieldEntryToFluid(uint index);
76
77protected:
78 char *field = nullptr;
80};
81
82}
83
84#endif
85
void setFieldEntry(uint index, char val)
Definition Field.cpp:138
bool isStopperSolid(uint index) const
Definition Field.cpp:115
void setFieldEntryToStopperCoarseUnderFine(uint index)
Definition Field.cpp:163
void setFieldEntryToStopperOutOfGridBoundary(uint index)
Definition Field.cpp:158
void setFieldEntryToStopperOutOfGrid(uint index)
Definition Field.cpp:153
bool isFineToCoarseNode(uint index) const
Definition Field.cpp:79
Field()=default
void setFieldEntryToInvalidOutOfGrid(uint index)
Definition Field.cpp:173
bool isQ(uint index) const
Definition Field.cpp:125
char getFieldEntry(uint index) const
Definition Field.cpp:61
bool isStopperOutOfGrid(uint index) const
Definition Field.cpp:105
void allocateMemory()
Definition Field.cpp:43
bool is(uint index, char type) const
Definition Field.cpp:69
bool isFluid(uint index) const
Definition Field.cpp:84
uint size
Definition Field.h:79
bool isInvalidOutOfGrid(uint index) const
Definition Field.cpp:95
bool isInvalidCoarseUnderFine(uint index) const
Definition Field.cpp:100
bool isCoarseToFineNode(uint index) const
Definition Field.cpp:74
bool isStopperCoarseUnderFine(uint index) const
Definition Field.cpp:110
uint getSize() const
Definition Field.cpp:56
bool isStopper(uint index) const
Definition Field.cpp:120
bool isBoundaryConditionNode(uint index) const
Definition Field.cpp:130
bool isInvalidSolid(uint index) const
Definition Field.cpp:90
void freeMemory()
Definition Field.cpp:48
void setFieldEntryToInvalidSolid(uint index)
Definition Field.cpp:148
void setFieldEntryToFluid(uint index)
Definition Field.cpp:143
void setFieldEntryToInvalidCoarseUnderFine(uint index)
Definition Field.cpp:168
char * field
Definition Field.h:78
unsigned int uint
Definition DataTypes.h:47
std::enable_shared_from_this< T > enableSharedFromThis
UbTypeOp< typenameUbDuoT< N, UbDuo< A, B > >::ResultT >::RefT val(UbDuo< A, B > &d)
Definition UbTuple.h:393