162 d_numElements -= dif;
196 int size = faces.
size();
198 for( i = 0; i < size; i++ ){
204 for( j = 0; j < num; j++ ){
205 if( sep_nodes.
move_to( fnodes[j] ) ){
206 int ind = sep_nodes.
index();
207 node_faces.
index( ind );
226 int node_size = sep_nodes.
size();
229 for( i = 0; i < node_size; i++ ) {
235 boolean separated = node->
separate(
this, flist, new_material );
236 if( separated ) sep_count++;
239 cerr <<
" separated " << sep_count <<
" nodes, out of " << node_size
240 <<
" involved" << endl;
250 int size = sep_elements->
size();
256 for( i = 0; i < size; i++ ) {
257 sep_elements->
index(i);
263 for( j = 0; j < numf; j++ ){
282 if( sep_elements->
move_to( oelem ) ){
290 Face* oface = ( cofaces[0] == face ? cofaces[1] : cofaces[0] );
297 if( sep_elements->
move_to( other ) ) {
298 sep_elements->
append( oelem );
315 int num_out_faces = out_faces.
size();
322 for( i = 0; i < num_out_faces; i++ ){
349 sep_elements->
reset();
350 size = sep_elements->
size();
351 for( i = 0; i < size; i++ ){
354 sep_elements->
next();
364 if ((*mesh.
d_elements[j]).isCohesive()) numcohesive += 1;
368 <<
'\t' << numcohesive <<
'\t' << mesh.
getMinEdge() <<endl;
370 stream.setf(ios::uppercase);
371 stream.setf(ios::scientific,ios::floatfield);
381 stream << numbc_nodes << endl;
398 return(
d_elements[elementID]->getMinEdgeLength());
406 stream >> nume >> numn;
412 for( i = 0; i < numn;i++ ){
427 for( i = 0; i < nume;i++ ){
430 stream >>
id >> type;
442 for( i = 0; i < numbcn; i++ ){
445 stream >> num >> flag;
450 int numFaceFlags, numFaceNodes, elementtype, theflag, totalFaces;
452 stream >> numFaceFlags;
455 for (i=0 ; i < numFaceFlags ; i++) {
456 stream >> elementtype;
469 for (j=0; j < totalFaces; j++) {
471 Node** theNodes = theFace->getNodes();
479 for (k=0; k<numFaceNodes; k++) {
481 int numExistingFaceNodes;
483 if (numFaceNodes != numExistingFaceNodes)
break;
487 for (m=0; m<numExistingFaceNodes; m++) {
488 if(theNodes[k]==trialNodes[m]) {
494 if(!nodeFound)
break;
496 if(numFound==numFaceNodes) {
512 if(
d_faces[i]->isExterior() ){
516 stream << count << endl;
519 if(
d_faces[i]->isExterior() ){
521 stream << e1->
getID() <<
'\t';
525 for( j = 0; j < numf; j++ ){
boolean separate(Mesh *mesh, FaceList *list, int new_material)
void insert_first(FaceList *val)
virtual void replaceFaceNode(Node *node, Node *new_node, Face *face)
static Element * create(int id, Type type)
void setFlag(int theFlag)
Sets the flag for the face.
int getMaterialType() const
This class encapsulate a node over a window manifold.
void removeNode(Node *node)
static Face * create(eType type)
void replaceNode(Node *node, Node *new_node)
void setMaterialType(int mtype)
Element * getElement2()
Get the pointer to the second element that this face is associated with.
int getFlag() const
Gets the flag for the face.
boolean addCohesive(int material1, int material2, int new_material=-1)
The addCohesive method is the driver for the entire process of adding cohesive elements to the mesh...
void addNode(Node *node)
The following add/remove/get methods are utility methods to add, remove, or return instances of nodes...
Class Mesh is the main class that holds all information to describe the current state of the mesh...
int d_nodeArraySize
The current size of the nodes array (must be as big or bigger than numNodes).
virtual int getNumFaces() const =0
Node ** d_nodes
An ordered array of all nodes in the mesh.
boolean containsNode(Node *node) const
double calcEdgeLength(int elementID)
void addElement(Element *element)
void removeElement(Element *element)
virtual Element * buildCohesive(Element *side_elem, Node *node, Node *new_node)=0
Element ** d_elements
Array of all the Elements in the mesh.
void replaceNode(Node *node, Node *new_node, ElementList *sep_elements, int new_material)
void setMinEdge(double me)
int d_numNodes
The number of Nodes in the nodes array.
Node ** getNodes()
Returns the array of nodes.
void removeFace(Face *face)
static void setMesh(Mesh *emesh)
boolean isCohesive() const
static T_VertexSet * face
static void setMesh(Mesh *emesh)
unsigned long id(const Leda_like_handle &x)
boolean move_to(Element *val)
void setID(int theID)
Sets the serial ID for the face.
std::ostream & operator<<(std::ostream &os, const COM_exception &ex)
Print out a given exception.
boolean move_to(Node *val)
The Face class is an abstract base class that supplies implemented general methods, as well as a vew virtual interface methods to child classes.
Element * getElement1()
Get the pointer to the first element that this face is associated with.
void write_boundary(ostream &stream)
virtual int getNumNodes() const =0
Retrieves the number of nodes that make up the face.
void append(Element *val)
void insert_first(Node *val)
void insert_first(Face *val)