abaqusMeshSet.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2023 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::abaqusMeshSet
28 
29 Description
30  Generates sample positions from points specified in a file as Abaqus mesh
31  points.
32 
33  Example usage:
34 
35  \verbatim
36  sets
37  {
38  cone25 // user-specified set name
39  {
40  type abaqusMesh;
41  file "abaqusMesh.inp";
42 
43  // Optional entries
44 
45  // Scale, e.g. mm to m
46  scale 0.001;
47 
48  // Search distance when the sample point is not located in a cell
49  maxDist 0.25;
50 
51  ...
52  }
53  }
54  \endverbatim
55 
56  For a dictionary specification:
57  \table
58  Property | Description | Required | Default
59  type | abaqusMesh | yes |
60  file | Path to Abaqus file | yes |
61  scale | scale input point positions | no | 1
62  maxDist | Search distance for sample points | no | 1
63  \endtable
64 
65 SourceFiles
66  abaqusMeshSet.C
67 
68 \*---------------------------------------------------------------------------*/
69 
70 #ifndef Foam_abaqusMeshSet_H
71 #define Foam_abaqusMeshSet_H
72 
73 #include "sampledSet.H"
74 #include "vectorList.H"
75 
76 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
77 
78 namespace Foam
79 {
80 
81 /*---------------------------------------------------------------------------*\
82  Class abaqusMeshSet Declaration
83 \*---------------------------------------------------------------------------*/
84 
85 class abaqusMeshSet
86 :
87  public sampledSet
88 {
89  // Private data
90 
91  //- Scale
92  const scalar scale_;
93 
94  //- Sample coordinates
95  vectorList sampleCoords_;
96 
97  //- Maximum search distance-squared
98  const scalar maxDistSqr_;
99 
100 
101  // Private Member Functions
102 
103  bool readCoord(ISstream& is, vector& coord) const;
104 
105  //- Samples all points in sampleCoords.
106  void calcSamples
107  (
108  DynamicList<point>& samplingPts,
109  DynamicList<label>& samplingCells,
110  DynamicList<label>& samplingFaces,
111  DynamicList<label>& samplingSegments,
112  DynamicList<scalar>& samplingCurveDist
113  ) const;
114 
115  //- Uses calcSamples to obtain samples. Copies them into *this.
116  void genSamples();
117 
118 
119 public:
120 
121  //- Runtime type information
122  TypeName("abaqusMesh");
123 
124 
125  // Constructors
126 
127  //- Construct from dictionary
129  (
130  const word& name,
131  const polyMesh& mesh,
132  const meshSearch& searchEngine,
133  const dictionary& dict
134  );
135 
136 
137  //- Destructor
138  virtual ~abaqusMeshSet() = default;
139 };
140 
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 } // End namespace Foam
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 #endif
149 
150 // ************************************************************************* //
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search...
Definition: meshSearch.H:56
dictionary dict
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
List< vector > vectorList
List of vector.
Definition: vectorList.H:32
A class for handling words, derived from Foam::string.
Definition: word.H:63
abaqusMeshSet(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const dictionary &dict)
Construct from dictionary.
virtual ~abaqusMeshSet()=default
Destructor.
Vector< scalar > vector
Definition: vector.H:57
const word & name() const noexcept
The coord-set name.
Definition: coordSet.H:152
const polyMesh & mesh() const noexcept
Definition: sampledSet.H:373
const meshSearch & searchEngine() const noexcept
Definition: sampledSet.H:378
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
TypeName("abaqusMesh")
Runtime type information.
Namespace for OpenFOAM.