Commit dd07e3ae authored by edward.vigmond's avatar edward.vigmond
Browse files

Will now associate vol with surf even if surface added later.

parent 76875d66
......@@ -2074,12 +2074,14 @@ Model::max_size( Object_t o )
/** determine the volume element to which a surface element is attached
*/
void
Model::_associate_surf_with_vol()
Model::associate_surf_with_vol()
{
vector<bool> surfpt(pt.num());
for( auto &surf : _surface ) {
if( surf->vol_assoc() ) continue;
// determine nodes in surface, and put all the faces in an
// unordered set
surfpt.assign(pt.num(),false);
......@@ -2122,6 +2124,8 @@ Model::_associate_surf_with_vol()
}
}
}
surf->vol_assoc(true);
}
}
......
......@@ -95,7 +95,7 @@ class Model
int localElemnum(int, int&);
int globalElemnum(int, int);
MultiPoint* _elems;
void associate_surf_with_vol(){if(!_surf2vol)_associate_surf_with_vol();_surf2vol=true;};
void associate_surf_with_vol();
private:
void read_region_file( string );
void read_normals( gzFile, const char * );
......@@ -105,7 +105,6 @@ class Model
bool read_elem_file( string );
void increase_ele( int );
bool check_element( SurfaceElement *e );
void _associate_surf_with_vol();
#ifdef USE_HDF5
bool read_elements(hid_t);
bool add_elements(hid_t hdf_file);
......
......@@ -85,6 +85,8 @@ class Surfaces
pair<int,GLfloat*> sharp_interface( Surfaces * );
void src_ele(int e, int s){ _sele[e] = s; }
long src_ele(int a){ return _sele[a]; }
bool vol_assoc(){ return _vol_assoc; }
void vol_assoc(bool b){ _vol_assoc=b; }
protected:
PPoint *_p;
GLfloat _fillcolor[4] = { 1., 0.5, 0.1, 1 };
......@@ -107,6 +109,7 @@ class Surfaces
vector<vtx_z> _zlist; //!< list of elements sorted by Z
int _numtri=-1; //!< number of triangles in surface
short _index; //!< index into surface list
bool _vol_assoc=false; //!< surface elements associated with a volume element?
};
#endif
......@@ -82,7 +82,6 @@ has_ext( string a, const char *ext )
}
/** compute the surfaces and output them
* the program should not exit if the filename
* begins with "+". If the filename=="(+)?/dev/null",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment