WearableNurbsWall.h
Go to the documentation of this file.
1 //Copyright (c) 2013-2023, The MercuryDPM Developers Team. All rights reserved.
2 //For the list of developers, see <http://www.MercuryDPM.org/Team>.
3 //
4 //Redistribution and use in source and binary forms, with or without
5 //modification, are permitted provided that the following conditions are met:
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above copyright
9 // notice, this list of conditions and the following disclaimer in the
10 // documentation and/or other materials provided with the distribution.
11 // * Neither the name MercuryDPM nor the
12 // names of its contributors may be used to endorse or promote products
13 // derived from this software without specific prior written permission.
14 //
15 //THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 //ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 //WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 //DISCLAIMED. IN NO EVENT SHALL THE MERCURYDPM DEVELOPERS TEAM BE LIABLE FOR ANY
19 //DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 //(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 //LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 //ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 //(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 //SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 
26 #ifndef MERCURYDPM_WEARABLENURBSWALL_H
27 #define MERCURYDPM_WEARABLENURBSWALL_H
28 
29 #include "Walls/NurbsWall.h"
30 
32 {
33 public:
34 
39 
44 
48  WearableNurbsWall(const NurbsSurface& nurbsSurface);
49 
54 
55  WearableNurbsWall(Mdouble lengthU, Mdouble lengthV, Mdouble resolutionU, Mdouble resolutionV, bool periodicU = false, bool periodicV = false);
56 
57  void set(Mdouble lengthU, Mdouble lengthV, Mdouble resolutionU, Mdouble resolutionV, bool periodicU = false, bool periodicV = false);
58 
62  void read(std::istream& is) override;
63 
67  void write(std::ostream& os) const override;
68 
72  std::string getName() const final;
73 
77  WearableNurbsWall* copy() const final;
78 
79  void computeWear() override;
80 
81  void writeWallDetailsVTK(VTKData& data) const override;
82 
83 private:
84  std::vector<std::vector<Mdouble>> localDebris_;
85  void storeDebris(Vec3D P, const Mdouble debris);
86  void processDebris();
87 public: // temp
88  Mdouble getVolumeUnderSurface(const std::vector<Mdouble>& knotsU, const std::vector<Mdouble>& knotsV,
89  const std::vector<std::vector<Vec3D>>& controlPoints, const std::vector<std::vector<Mdouble>>& weights) const;
90  Mdouble getVolumeUnderSurfaceX(const std::vector<Mdouble>& knotsU, const std::vector<Mdouble>& knotsV,
91  const std::vector<std::vector<Vec3D>>& controlPoints, const std::vector<std::vector<Mdouble>>& weights) const;
92  //temp
93 public:
94  void moveControlPoint(unsigned idxU, unsigned idxV, Vec3D dP)
95  {
96  nurbsSurface_.moveControlPoint(idxU, idxV, dP, false);
97  }
99  {
101  }
102 };
103 
104 
105 #endif //MERCURYDPM_WEARABLENURBSWALL_H
Definition: NurbsSurface.h:34
const std::vector< std::vector< Vec3D > > & getControlPoints() const
Definition: NurbsSurface.h:141
const std::vector< std::vector< Mdouble > > & getWeights() const
Definition: NurbsSurface.h:144
const std::vector< Mdouble > & getKnotsU() const
Definition: NurbsSurface.h:147
void moveControlPoint(unsigned int indexU, unsigned int indexV, Vec3D dP, bool includingClosedOrPeriodic)
Definition: NurbsSurface.cc:658
const std::vector< Mdouble > & getKnotsV() const
Definition: NurbsSurface.h:150
This function defines a wall via a NurbsSurface.
Definition: NurbsWall.h:37
NurbsSurface nurbsSurface_
Definition: NurbsWall.h:95
Definition: Kernel/VTKWriter/VTKData.h:36
Definition: Vector.h:51
Definition: WearableNurbsWall.h:32
void processDebris()
Definition: WearableNurbsWall.cc:250
~WearableNurbsWall()
Default destructor.
Definition: WearableNurbsWall.cc:55
void computeWear() override
Definition: WearableNurbsWall.cc:162
WearableNurbsWall * copy() const final
Copy this wall and return a pointer to the copy.
Definition: WearableNurbsWall.cc:157
void write(std::ostream &os) const override
Writes this wall to an output stream, for example a restart file.
Definition: WearableNurbsWall.cc:143
Mdouble getVolumeUnderSurface()
Definition: WearableNurbsWall.h:98
void moveControlPoint(unsigned idxU, unsigned idxV, Vec3D dP)
Definition: WearableNurbsWall.h:94
void read(std::istream &is) override
Reads this wall from an input stream, for example a restart file.
Definition: WearableNurbsWall.cc:119
void set(Mdouble lengthU, Mdouble lengthV, Mdouble resolutionU, Mdouble resolutionV, bool periodicU=false, bool periodicV=false)
Definition: WearableNurbsWall.cc:65
WearableNurbsWall()
Default constructor: make a wall with default parameters.
Definition: WearableNurbsWall.cc:31
void storeDebris(Vec3D P, const Mdouble debris)
Definition: WearableNurbsWall.cc:202
Mdouble getVolumeUnderSurfaceX(const std::vector< Mdouble > &knotsU, const std::vector< Mdouble > &knotsV, const std::vector< std::vector< Vec3D >> &controlPoints, const std::vector< std::vector< Mdouble >> &weights) const
Definition: WearableNurbsWall.cc:322
std::vector< std::vector< Mdouble > > localDebris_
Definition: WearableNurbsWall.h:84
void writeWallDetailsVTK(VTKData &data) const override
Definition: WearableNurbsWall.cc:366
std::string getName() const final
Returns the name of the object, here the string "WearableNurbsWall".
Definition: WearableNurbsWall.cc:152
double P
Uniform pressure.
Definition: TwenteMeshGluing.cpp:73