52 GetPot cl(argc, argv);
54 unsigned char dim = -1;
55 if (!cl.search(
"--dim"))
64 if (!cl.search(
"--input"))
66 libMesh::err <<
"No --input argument found!" << std::endl;
69 const char * meshname = cl.next(
"mesh.xda");
74 if (!cl.search(
"--newbcid"))
76 libMesh::err <<
"No --bcid argument found!" << std::endl;
82 Point minpt(-std::numeric_limits<Real>::max());
84 minpt(1) = -std::numeric_limits<Real>::max();
87 minpt(2) = -std::numeric_limits<Real>::max();
94 if (cl.search(
"--minnormalx"))
95 normals.min()(0) = cl.next(normals.min()(0));
96 if (cl.search(
"--maxnormalx"))
97 normals.max()(0) = cl.next(normals.max()(0));
99 if (cl.search(
"--minpointx"))
100 points.min()(0) = cl.next(points.min()(0));
101 if (cl.search(
"--maxpointx"))
102 points.max()(0) = cl.next(points.max()(0));
105 if (cl.search(
"--minnormaly"))
106 normals.min()(1) = cl.next(normals.min()(1));
107 if (cl.search(
"--maxnormaly"))
108 normals.max()(1) = cl.next(normals.max()(1));
110 if (cl.search(
"--minpointy"))
111 points.min()(1) = cl.next(points.min()(1));
112 if (cl.search(
"--maxpointy"))
113 points.max()(1) = cl.next(points.max()(1));
117 if (cl.search(
"--minnormalz"))
118 normals.min()(2) = cl.next(normals.min()(2));
119 if (cl.search(
"--maxnormalz"))
120 normals.max()(2) = cl.next(normals.max()(2));
122 if (cl.search(
"--minpointz"))
123 points.min()(2) = cl.next(points.min()(2));
124 if (cl.search(
"--maxpointz"))
125 points.max()(2) = cl.next(points.max()(2));
128 libMesh::out <<
"min point = " << points.min() << std::endl;
129 libMesh::out <<
"max point = " << points.max() << std::endl;
130 libMesh::out <<
"min normal = " << normals.min() << std::endl;
131 libMesh::out <<
"max normal = " << normals.max() << std::endl;
133 bool matcholdbcid =
false;
135 if (cl.search(
"--oldbcid"))
138 oldbcid = cl.next(oldbcid);
140 oldbcid = BoundaryInfo::invalid_id;
145 fe->attach_quadrature_rule(&qface);
146 const std::vector<Point> & face_points = fe->get_xyz();
147 const std::vector<Point> & face_normals = fe->get_normals();
149 for (
auto & elem :
mesh.element_ptr_range())
151 unsigned int n_sides = elem->n_sides();
154 std::vector<boundary_id_type> ids;
156 for (
unsigned short s=0; s != n_sides; ++s)
158 if (elem->neighbor_ptr(s))
162 const Point & p = face_points[0];
163 const Point & n = face_normals[0];
170 if (points.contains_point(p) &&
171 normals.contains_point(n))
183 if (matcholdbcid && b_id != oldbcid)
199 std::string outputname;
200 if (cl.search(
"--output"))
202 outputname = cl.next(
"mesh.xda");
207 outputname += meshname;
212 libMesh::out <<
"Wrote mesh " << outputname << std::endl;
class FEType hides (possibly multiple) FEFamily and approximation orders, thereby enabling specialize...
virtual void read(const std::string &name, void *mesh_data=nullptr, bool skip_renumber_nodes_and_elements=false, bool skip_find_neighbors=false)=0
Interfaces for reading/writing a mesh to/from a file.
void boundary_ids(const Node *node, std::vector< boundary_id_type > &vec_to_fill) const
Fills a user-provided std::vector with the boundary ids associated with Node node.
The LibMeshInit class, when constructed, initializes the dependent libraries (e.g.
const BoundaryInfo & get_boundary_info() const
The information about boundary ids on the mesh.
void init(triangulateio &t)
Initializes the fields of t to nullptr/0 as necessary.
void regenerate_id_sets()
Clears and regenerates the cached sets of ids.
virtual void write(const std::string &name) const =0
Defines a Cartesian bounding box by the two corner extremum.
void remove_side(const Elem *elem, const unsigned short int side)
Removes all boundary conditions associated with side side of element elem, if any exist...
void add_side(const dof_id_type elem, const unsigned short int side, const boundary_id_type id)
Add side side of element number elem with boundary id id to the boundary information data structure...
This class implements specific orders of Gauss quadrature.
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.
void usage_error(const char *progname)
A Point defines a location in LIBMESH_DIM dimensional Real space.