FEDEM Solver  R8.0
Source code of the dynamics solver
FFaVolume.H
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2023 SAP SE
2 //
3 // SPDX-License-Identifier: Apache-2.0
4 //
5 // This file is part of FEDEM - https://openfedem.org
7 
13 #ifndef FFA_VOLUME_H
14 #define FFA_VOLUME_H
15 
16 class FaVec3;
17 class FFaTensor3;
18 
19 
30 namespace FFaVolume
31 {
33  void tetVolume (const FaVec3& v1, const FaVec3& v2,
34  const FaVec3& v3, const FaVec3& v4, double& vol);
36  void wedVolume (const FaVec3& v1, const FaVec3& v2,
37  const FaVec3& v3, const FaVec3& v4,
38  const FaVec3& v5, const FaVec3& v6, double& vol);
40  void hexVolume (const FaVec3& v1, const FaVec3& v2,
41  const FaVec3& v3, const FaVec3& v4,
42  const FaVec3& v5, const FaVec3& v6,
43  const FaVec3& v7, const FaVec3& v8, double& vol);
44 
46  // Calculation of volume center. The input vertices are then shifted
47  // such that they become relative to the computed volume center.
48  // The return value is the volume of the object.
49 
51  double tetCenter (FaVec3& v1, FaVec3& v2,
52  FaVec3& v3, FaVec3& v4, FaVec3& vc);
54  double wedCenter (FaVec3& v1, FaVec3& v2,
55  FaVec3& v3, FaVec3& v4,
56  FaVec3& v5, FaVec3& v6, FaVec3& vc);
58  double hexCenter (FaVec3& v1, FaVec3& v2,
59  FaVec3& v3, FaVec3& v4,
60  FaVec3& v5, FaVec3& v6,
61  FaVec3& v7, FaVec3& v8, FaVec3& vc);
62 
64  // Calculation of volume moments (inertias). The input vertices
65  // are here assumed to be relative to the objects volume center.
66 
68  void tetMoment (const FaVec3& v1, const FaVec3& v2,
69  const FaVec3& v3, const FaVec3& v4, FFaTensor3& vm);
71  void wedMoment (const FaVec3& v1, const FaVec3& v2,
72  const FaVec3& v3, const FaVec3& v4,
73  const FaVec3& v5, const FaVec3& v6, FFaTensor3& vm);
75  void hexMoment (const FaVec3& v1, const FaVec3& v2,
76  const FaVec3& v3, const FaVec3& v4,
77  const FaVec3& v5, const FaVec3& v6,
78  const FaVec3& v7, const FaVec3& v8, FFaTensor3& vm);
79 }
80 
81 #endif
Class to represent a 3D symmetric tensor.
Definition: FFaTensor3.H:35
Class for point vectors in 3D space.
Definition: FFaVec3.H:40
A namespace with volume calculation functions for some 3D shapes.
Definition: FFaVolume.H:31
void wedMoment(const FaVec3 &v1, const FaVec3 &v2, const FaVec3 &v3, const FaVec3 &v4, const FaVec3 &v5, const FaVec3 &v6, FFaTensor3 &vm)
Calculates the volume moment of intertia of a wedge.
Definition: FFaVolume.C:226
void tetVolume(const FaVec3 &v1, const FaVec3 &v2, const FaVec3 &v3, const FaVec3 &v4, double &vol)
Calculates the volume of a tetrahedron.
Definition: FFaVolume.C:71
double wedCenter(FaVec3 &v1, FaVec3 &v2, FaVec3 &v3, FaVec3 &v4, FaVec3 &v5, FaVec3 &v6, FaVec3 &vc)
Calculates the volume and volume center of a wedge.
Definition: FFaVolume.C:144
void tetMoment(const FaVec3 &v1, const FaVec3 &v2, const FaVec3 &v3, const FaVec3 &v4, FFaTensor3 &vm)
Calculates the volume moment of intertia of a tetrahedron.
Definition: FFaVolume.C:211
void wedVolume(const FaVec3 &v1, const FaVec3 &v2, const FaVec3 &v3, const FaVec3 &v4, const FaVec3 &v5, const FaVec3 &v6, double &vol)
Calculates the volume of a wedge.
Definition: FFaVolume.C:84
double tetCenter(FaVec3 &v1, FaVec3 &v2, FaVec3 &v3, FaVec3 &v4, FaVec3 &vc)
Calculates the volume and volume center of a tetrahedron.
Definition: FFaVolume.C:129
double hexCenter(FaVec3 &v1, FaVec3 &v2, FaVec3 &v3, FaVec3 &v4, FaVec3 &v5, FaVec3 &v6, FaVec3 &v7, FaVec3 &v8, FaVec3 &vc)
Calculates the volume and volume center of a hexahedron.
Definition: FFaVolume.C:173
void hexVolume(const FaVec3 &v1, const FaVec3 &v2, const FaVec3 &v3, const FaVec3 &v4, const FaVec3 &v5, const FaVec3 &v6, const FaVec3 &v7, const FaVec3 &v8, double &vol)
Calculates the volume of a hexahedron.
Definition: FFaVolume.C:105
void hexMoment(const FaVec3 &v1, const FaVec3 &v2, const FaVec3 &v3, const FaVec3 &v4, const FaVec3 &v5, const FaVec3 &v6, const FaVec3 &v7, const FaVec3 &v8, FFaTensor3 &vm)
Calculates the volume moment of intertia of a hexahedron.
Definition: FFaVolume.C:244
real(dp), dimension(:), allocatable v1
Definition: inverseModule.f90:27
real(dp), dimension(:), allocatable v2
Definition: inverseModule.f90:28