svFSIplus
read_msh.h
1 /**
2  * Copyright (c) Stanford University, The Regents of the University of California, and others.
3  *
4  * All Rights Reserved.
5  *
6  * See Copyright-SimVascular.txt for additional details.
7  *
8  * Permission is hereby granted, free of charge, to any person obtaining
9  * a copy of this software and associated documentation files (the
10  * "Software"), to deal in the Software without restriction, including
11  * without limitation the rights to use, copy, modify, merge, publish,
12  * distribute, sublicense, and/or sell copies of the Software, and to
13  * permit persons to whom the Software is furnished to do so, subject
14  * to the following conditions:
15  *
16  * The above copyright notice and this permission notice shall be included
17  * in all copies or substantial portions of the Software.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
20  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
23  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30  */
31 
32 #ifndef READ_MSH_H
33 #define READ_MSH_H
34 
35 #include "ComMod.h"
36 #include "Simulation.h"
37 #include "Vector.h"
38 
39 #include "utils.h"
40 
41 #include <string>
42 
43 namespace read_msh_ns {
44 
45  class blkType
46  {
47  public:
48  int n = 0;
49  Vector<int> gN;
50  };
51 
52  void calc_elem_ar(ComMod& com_mod, const CmMod& cm_mod, mshType& lM, bool& rflag);
53  void calc_elem_jac(ComMod& com_mod, const CmMod& cm_mod, mshType& lM, bool& rflag);
54  void calc_elem_skew(ComMod& com_mod, const CmMod& cm_mod, mshType& lM, bool& rflag);
55 
56  void calc_mesh_props(ComMod& com_mod, const CmMod& cm_mod, const int nMesh, std::vector<mshType>& mesh);
57 
58  void calc_nbc(mshType& mesh, faceType& face);
59 
60  void check_ien(Simulation* simulation, mshType& mesh);
70 
71  int find_blk(const int nsd, const int nBkd, const std::vector<bool>& nFlt, const Vector<double>&xMin, const Vector<double>&dx, const Vector<double>& x);
72 
73  void load_var_ini(Simulation* simulation, const ComMod& com_mod);
74 
75  void match_faces(const ComMod& com_mod, const faceType& face1, const faceType& face2, const double tol, utils::stackType& lPrj);
76 
77  void read_fib_nff(Simulation* simulation, mshType& mesh, const std::string& fName, const std::string& kwrd, const int idx);
78  void read_msh(Simulation* simulation);
79 
80  void set_dmn_id_ff(Simulation* simulation, mshType& mesh, const std::string& file_name);
81  void set_dmn_id_vtk(Simulation* simulation, mshType& mesh, const std::string& file_name, const std::string& kwrd);
82  void set_projector(Simulation* simulation, utils::stackType& avNds);
83 
84 
85 };
86 
87 #endif
88 
The CmMod class duplicates the data structures in the Fortran CMMOD module defined in COMU....
Definition: CmMod.h:63
The ComMod class duplicates the data structures in the Fortran COMMOD module defined in MOD....
Definition: ComMod.h:1311
Definition: Simulation.h:41
The face type containing mesh at boundary.
Definition: ComMod.h:501
This is the container for a mesh or NURBS patch, those specific to NURBS are noted.
Definition: ComMod.h:788
Definition: read_msh.h:46
Definition: utils.h:40
Definition: CmMod.h:46
Definition: mesh.cpp:52
Definition: read_msh.cpp:55
void check_tet_conn(mshType &mesh)
Check and reorder tet connectivity if needed.
Definition: read_msh.cpp:680
void calc_elem_ar(ComMod &com_mod, const CmMod &cm_mod, mshType &lM, bool &rflag)
Calculate element Aspect Ratio of a given mesh.
Definition: read_msh.cpp:81
void check_tri3_conn(mshType &mesh)
Definition: read_msh.cpp:732
void check_line_conn(mshType &mesh)
Check and reorder line connectivity if needed.
Definition: read_msh.cpp:644
void check_quad4_conn(mshType &mesh)
Definition: read_msh.cpp:674
void set_dmn_id_ff(Simulation *simulation, mshType &lM, const std::string &file_name)
Read domain from a dat file.
Definition: read_msh.cpp:1696
void load_var_ini(Simulation *simulation, ComMod &com_mod)
Read initial field values (pressure, velocity or displacement).
Definition: read_msh.cpp:784
void check_ien(Simulation *simulation, mshType &mesh)
Check the mesh connectivity and node ordering.
Definition: read_msh.cpp:543
void set_dmn_id_vtk(Simulation *simulation, mshType &mesh, const std::string &file_name, const std::string &kwrd)
Read mesh domains from a vtu/vtp file.
Definition: read_msh.cpp:1758
void check_wedge_conn(mshType &mesh)
Check and reorder wedge connectivity if needed.
Definition: read_msh.cpp:744
void read_msh(Simulation *simulation)
For each mesh defined for the simulation.
Definition: read_msh.cpp:1080
void check_tri6_conn(mshType &mesh)
Definition: read_msh.cpp:738
void check_hex20_conn(mshType &mesh)
Check and reorder hex connectivity if needed.
Definition: read_msh.cpp:660
void check_hex8_conn(mshType &mesh)
Check and reorder hex connectivity if needed.
Definition: read_msh.cpp:652
void set_projector(Simulation *simulation, utils::stackType &avNds)
This routines associates two faces with each other and sets gN.
Definition: read_msh.cpp:1773
void read_fib_nff(Simulation *simulation, mshType &mesh, const std::string &fName, const std::string &kwrd, const int idx)
Read fiber direction from a vtu file.
Definition: read_msh.cpp:1069
void calc_elem_skew(ComMod &com_mod, const CmMod &cm_mod, mshType &lM, bool &rflag)
Calculate element Skewness of a given mesh.
Definition: read_msh.cpp:296
void calc_nbc(mshType &mesh, faceType &face)
Checks that face nodes are valid and creates a list of unique node IDs for the face.
Definition: read_msh.cpp:476
int find_blk(const int nsd, const int nBkd, const std::vector< bool > &nFlt, const Vector< double > &xMin, const Vector< double > &dx, const Vector< double > &x)
Compute the block ID for the given coordinate.
Definition: read_msh.cpp:602
void calc_elem_jac(ComMod &com_mod, const CmMod &cm_mod, mshType &lM, bool &rflag)
Calculate element Jacobian of a given mesh.
Definition: read_msh.cpp:176
void check_hex27_conn(mshType &mesh)
Check and reorder hex connectivity if needed.
Definition: read_msh.cpp:668