#include <selection.h>
Public Member Functions | |
void | conv2lst (long nit, long nobj, long *selobj) |
convert the given list of objects to the list selection type | |
void | conv2range (long nit, long nobj, long *selobj) |
convert the given list of objects to the range selection type | |
long | conv_selprop (siftop *top, objtype ot) |
converts selection type of property to selection type of list | |
long | give_nselcomp (long tncomp) |
counts number of selected components in array with length tncomp | |
long | give_num_lst_items (long nobj, long *selobj) |
returns number of selected objects | |
long | give_num_range_items (long nobj, long *selobj) |
returns number of detected ranges in the array selobj | |
long | presence_id (sel *consel, long id, long idc, long &ir) |
checks presence of ids at given selection and conjugated selections | |
long | presence_id (sel *consel, long id, long idc) |
checks presence of ids at given selection and conjugated selections | |
long | presence_id (long id, double rid, long &ir) |
checks presence of ids at given selection | |
long | presence_id (long id, long sid, long &ir) |
checks presence of id at given selection with index sid | |
long | presence_id (long id, long &ir) |
checks presence of id at given selection | |
long | presence_id (double id, long &ir) |
checks presence of id at given selection | |
long | presence_id (long id, double rid, timecontr &tc) |
checks presence of ids at given selection | |
long | presence_id (long id, double rid) |
checks presence of ids at given selection | |
long | presence_id (long id) |
checks presence of id at given selection | |
long | presence_id (double id) |
checks presence of id at given selection | |
long | presence_idgt (long id, long &ir) |
checks presence of id at given selection with index greater than ir | |
void | print (FILE *out) |
prints description data to file | |
long | read (XFILE *in) |
reads data from file | |
sel () | |
constructor | |
~sel () | |
destructor | |
Public Attributes | |
gentity * | ent |
type of entity for property selection of nodes/elements | |
double | err |
required error of real range, real list or real period | |
double | fintime |
final time for selection of real period | |
long * | id1 |
array with the first indices | |
double | initime |
initial time for selection of real period | |
long | n |
number of selections | |
long * | ncomp |
array with lengthes of selections | |
double | r |
real period | |
double * | rid1 |
array with begining real values of real range, real list or real period | |
double * | rid2 |
array with ending real values of real range | |
seltype | st |
type of selection |
Class manages the selections of steps, nodes, elements, strains, stresses and other values. It is devoted especially to outdrivers, but generally it should be used in whatever case where the above quantities are need to select.
created 03.2004 by Tomas Koudelka, koudelka@cml.fsv.cvut.cz modified 10.10.2007 by Tomas Koudelka, koudelka@cml.fsv.cvut.cz
Definition at line 18 of file selection.h.
sel | ( | ) |
~sel | ( | ) |
void conv2lst | ( | long | nit, | |
long | nobj, | |||
long * | selobj | |||
) |
convert the given list of objects to the list selection type
The function converts list of selected objects to the list type of selection. It is supposed that the number of selected items was detected by call of give_num_lst_items. The list of selected objects is represented by the array selobj with length nobj. Selected object is indicated by nonzero selobj component while the remaining components are zero.
nit | - number of list items | |
nobj | - length of array selobj, i.e. the total number of selectable objects | |
selobj | - array of indicators whether the given object is selected (selobj[i] != 0) or not (selobj[i] = 0) |
Created by Tomas Koudelka, 9.1.2015
Definition at line 1121 of file selection.cpp.
References id1, memset(), n, ncomp, sel_list, and st.
Referenced by conv_selprop().
void conv2range | ( | long | nit, | |
long | nobj, | |||
long * | selobj | |||
) |
convert the given list of objects to the range selection type
The function converts list of selected objects to the range type of selection. It is supposed that the number of selected ranges was detected by call of give_num_range_items. The list of selected objects is represented by the array selobj with length nobj. Selected object is indicated by nonzero selobj component while the remaining components are zero.
nit | - number of detected ranges | |
nobj | - length of array selobj, i.e. the total number of selectable objects | |
selobj | - array of indicators whether the given object is selected (selobj[i] != 0) or not (selobj[i] = 0) |
Created by Tomas Koudelka, 9.1.2015
Definition at line 1061 of file selection.cpp.
References id1, memset(), n, ncomp, sel_range, and st.
Referenced by conv_selprop().
long conv_selprop | ( | siftop * | top, | |
objtype | ot | |||
) |
converts selection type of property to selection type of list
The function converts selection of nodes/elements according to given property id and entity type to selection type list or range.
top | - mesh topology with defined properties of nodes and elements | |
ot | - object type indicator for the given property sekection it specifies whether the given selection by property id is related to nodes or elements |
0 | - on success | |
1 | - in case of unknown type of object | |
2 | - no edge or surface property ids were specified on elements in the given topology |
Created by Tomas Koudelka, 9.1.2015
Definition at line 905 of file selection.cpp.
References conv2lst(), conv2range(), ent, gelem, give_num_lst_items(), give_num_range_items(), gnod, id1, memset(), n, ncomp, and print_err().
Referenced by elemoutgm::conv_sel_prop(), elemoutm::conv_sel_prop(), nodeoutgm::conv_sel_prop(), and nodeoutm::conv_sel_prop().
long give_nselcomp | ( | long | tncomp | ) |
counts number of selected components in array with length tncomp
Function computes number of selected items.
tncomp | - total number of components which could be selected |
number | of selected components |
TKo 9.2008
Definition at line 848 of file selection.cpp.
References id1, n, ncomp, print_err(), sel_all, sel_list, sel_no, sel_range, and st.
Referenced by mechmat::save_intpoints_bin(), mechmat::save_intpoints_txt(), transmat::save_intpointst_bin(), and transmat::save_intpointst_txt().
long give_num_lst_items | ( | long | nobj, | |
long * | selobj | |||
) |
returns number of selected objects
The function returns number of selected objects given in the array selobj.
nobj | - length of the array selobj, i.e. the total number of selectable objects | |
selobj | - array of indicators whether the given object is selected (selobj[i] != 0) or not (selobj[i] = 0) |
Created by Tomas Koudelka, 9.1.2015
Definition at line 983 of file selection.cpp.
Referenced by conv_selprop().
long give_num_range_items | ( | long | nobj, | |
long * | selobj | |||
) |
returns number of detected ranges in the array selobj
The function returns number of contiuous index ranges of selected objects given by selobj array.
nobj | - length of the array selobj, i.e. the total number of selectable objects | |
selobj | - array of indicators whether the given object is selected (selobj[i] != 0) or not (selobj[i] = 0) |
Created by Tomas Koudelka, 9.1.2015
Definition at line 1010 of file selection.cpp.
Referenced by conv_selprop().
long presence_id | ( | sel * | consel, | |
long | id, | |||
long | idc, | |||
long & | ir | |||
) |
checks presence of ids at given selection and conjugated selections
Function checks presence of the index id in ranges of the selection and also checks presence of the index idc in conjugated selections consel. Conjugated selections means array of selections whose size is number of ranges of given selection. Each element (i.e. selection) of this array corresponds to one range of given selection.
consel | - array of conjugated selections | |
id | - checked index of given selection | |
idc | - checked index of of conjugated selections | |
ir | - index of conjugated selection where the idc was found (output) |
0 | - indices were not found | |
1 | - indices were found |
Definition at line 819 of file selection.cpp.
References n, presence_id(), and presence_idgt().
long presence_id | ( | sel * | consel, | |
long | id, | |||
long | idc | |||
) |
checks presence of ids at given selection and conjugated selections
Function checks presence of the index id in ranges of the selection and also checks presence of the index idc in conjugated selections consel. Conjugated selections means array of selections whose size is number of ranges of given selection. Each element (i.e. selection) of this array corresponds to one range of given selection.
consel | - array of conjugated selections | |
id | - checked index of given selection | |
idc | - checked index of of conjugated selections |
0 | - indices were not found | |
1 | - indices were found |
Definition at line 783 of file selection.cpp.
References n, presence_id(), and presence_idgt().
long presence_id | ( | long | id, | |
double | rid, | |||
long & | ir | |||
) |
checks presence of ids at given selection
Function checks presence of the index id or value rid in ranges of the selection.
id | - checked index | |
rid | - checked value | |
ir | - output parameter which contains index of range where the id was found. |
0 | - index was not found | |
1 | - index was found |
Definition at line 759 of file selection.cpp.
References presence_id(), sel_reallist, sel_realperiod, sel_realrange, and st.
long presence_id | ( | long | id, | |
long | sid, | |||
long & | ir | |||
) |
checks presence of id at given selection with index sid
Function checks presence of the index id in sid-th range of the selection.
id | - checked index | |
ir | - output parameter which contains index of range where the id was found. | |
sid | - index of range where the index should be found |
0 | - index was not found | |
1 | - index was found |
Definition at line 685 of file selection.cpp.
References id1, n, ncomp, print_err(), sel_all, sel_list, sel_mtx, sel_no, sel_period, sel_range, sel_range_mtx, sel_range_vec, sel_vec, and st.
long presence_id | ( | long | id, | |
long & | ir | |||
) |
checks presence of id at given selection
Function checks presence of the index id in ranges of the selection.
id | - checked index | |
ir | - output parameter which contains index of range where the id was found. |
0 | - index was not found | |
1 | - index was found |
Definition at line 529 of file selection.cpp.
References id1, n, ncomp, print_err(), sel_all, sel_list, sel_mtx, sel_no, sel_period, sel_range, sel_range_mtx, sel_range_vec, sel_vec, and st.
long presence_id | ( | double | id, | |
long & | ir | |||
) |
checks presence of id at given selection
Function checks presence of the value id in ranges of the selection.
id | - checked value | |
ir | - output parameter which contains index of range where the id was found. |
0 | - index was not found | |
1 | - index was found |
Definition at line 483 of file selection.cpp.
References err, n, print_err(), rid1, rid2, sel_reallist, sel_realperiod, sel_realrange, and st.
long presence_id | ( | long | id, | |
double | rid, | |||
timecontr & | tc | |||
) |
checks presence of ids at given selection
Function checks presence of the index id or value rid in ranges of the selection or checks important times in time controler tc. The function is used especially for step selection.
id | - checked index | |
rid | - checked value | |
tc | - time controler from the problem description |
0 | - value was not found | |
1 | - value was found |
Definition at line 451 of file selection.cpp.
References timecontr::apit, id1, timecontr::iiit, n, presence_id(), sel_impvallst, sel_impvalues, sel_reallist, sel_realperiod, sel_realrange, and st.
long presence_id | ( | long | id, | |
double | rid | |||
) |
checks presence of ids at given selection
Function checks presence of the index id or value rid in ranges of the selection.
id | - checked index | |
rid | - checked value |
0 | - value was not found | |
1 | - value was found |
Definition at line 427 of file selection.cpp.
References presence_id(), sel_reallist, sel_realperiod, sel_realrange, and st.
long presence_id | ( | long | id | ) |
checks presence of id at given selection
Function checks presence of the index id in ranges of the selection.
id | - checked index |
0 | - index was not found | |
1 | - index was found |
Definition at line 375 of file selection.cpp.
References id1, n, ncomp, print_err(), sel_all, sel_list, sel_mtx, sel_no, sel_period, sel_range, sel_range_mtx, sel_range_vec, sel_vec, and st.
long presence_id | ( | double | id | ) |
checks presence of id at given selection
Function checks presence of the value id in ranges of the selection.
id | - checked value |
0 | - value was not found | |
1 | - value was found |
Definition at line 342 of file selection.cpp.
References err, n, print_err(), rid1, rid2, sel_reallist, sel_realperiod, sel_realrange, and st.
Referenced by aepointst::init(), aepoints::init(), presence_id(), nodeoutm::print_disp(), pointoutt::print_eqother(), elemoutt::print_eqother(), nodeoutt::print_eqother(), pointoutt::print_flux(), elemoutt::print_flux(), nodeoutt::print_flux(), pointoutt::print_grad(), elemoutt::print_grad(), nodeoutt::print_grad(), outdrivert::print_graphics(), outdriverm::print_graphics(), outdriverm::print_graphics_forced(), outdrivert::print_newstep(), outdriverm::print_newstep(), pointoutt::print_other(), elemoutt::print_other(), nodeoutt::print_other(), pointoutm::print_other(), elemoutm::print_other(), nodeoutm::print_other(), outdrivert::print_out(), outdriverm::print_out(), outdriverm::print_out_forced(), pointoutm::print_stra(), elemoutm::print_stra(), nodeoutm::print_stra(), pointoutm::print_stre(), elemoutm::print_stre(), nodeoutm::print_stre(), nodeoutt::print_unkn(), outdiagt::printval(), outdiagm::printval(), intpointst::restore_data_bin(), intpoints::restore_data_bin(), intpointst::restore_data_txt(), intpoints::restore_data_txt(), mechmat::restore_intpoints_bin(), mechmat::restore_intpoints_txt(), transmat::restore_intpointst_bin(), transmat::restore_intpointst_txt(), intpointst::save_data_bin(), intpoints::save_data_bin(), intpointst::save_data_txt(), intpoints::save_data_txt(), mechmat::save_intpoints_bin(), mechmat::save_intpoints_txt(), transmat::save_intpointst_bin(), transmat::save_intpointst_txt(), write_gid_elem_type_scalar(), write_gid_elem_type_scalart(), write_gid_elem_type_tensor(), write_gid_elem_type_vector(), write_gid_elem_type_vectort(), write_gid_nodscalar(), write_gid_nodtensor(), write_gid_nodvector(), and write_vtk_unkn().
long presence_idgt | ( | long | id, | |
long & | ir | |||
) |
checks presence of id at given selection with index greater than ir
Function checks presence of the index id in ranges of the selection. Index of ranges have to be greater than ir. It allows for the checking of all overlapping ranges of main selection and corresponding conjugated selections.
id | - checked index | |
ir | - input/output parameter which contains befor the call: minimum value of required index of range after call : index of range where the id was found. |
0 | - index was not found | |
1 | - index was found |
Definition at line 608 of file selection.cpp.
References id1, n, ncomp, print_err(), sel_all, sel_list, sel_mtx, sel_no, sel_period, sel_range, sel_range_mtx, sel_range_vec, sel_vec, and st.
Referenced by presence_id().
void print | ( | FILE * | out | ) |
prints description data to file
Function prints data of selections to the text file given by the parameter out.
in | - pointer to opened text file |
0 | - on success | |
1 | - error reading number of ranges | |
2 | - error reading range |
Definition at line 268 of file selection.cpp.
References ent, err, fintime, id1, initime, n, ncomp, print_err(), r, rid1, rid2, sel_all, sel_impvallst, sel_impvalues, sel_list, sel_mtx, sel_no, sel_period, sel_prop, sel_range, sel_range_mtx, sel_range_vec, sel_reallist, sel_realperiod, sel_realrange, sel_vec, and st.
Referenced by pointoutt::print(), elemoutgt::print(), elemoutt::print(), nodeoutgt::print(), nodeoutt::print(), outdiagt::print(), pointoutm::print(), elemoutgm::print(), elemoutm::print(), nodeoutgm::print(), nodeoutm::print(), outdiagm::print(), and hdbcontr::print().
long read | ( | XFILE * | in | ) |
reads data from file
Function reads data of selections from a text file given by parameter in.
in | - pointer to opened text file |
0 | - on success | |
1 | - error selection type | |
2 | - error reading selection values | |
3 | - error reading range or list | |
4 | - error reading real range or real list |
Created by Tomas Koudelka, 2004
Definition at line 52 of file selection.cpp.
References ent, err, fintime, gentity_kwdset(), id1, initime, long(), memset(), n, ncomp, print_err(), r, rid1, rid2, sel_all, sel_impvallst, sel_impvalues, sel_list, sel_mtx, sel_no, sel_period, sel_prop, sel_range, sel_range_mtx, sel_range_vec, sel_reallist, sel_realperiod, sel_realrange, sel_vec, seltype_kwdset(), st, and xfscanf().
Referenced by pointoutt::read(), elemoutgt::read(), elemoutt::read(), nodeoutgt::read(), nodeoutt::read(), outdiagt::read(), pointoutm::read(), elemoutgm::read(), elemoutm::read(), nodeoutgm::read(), nodeoutm::read(), outdiagm::read(), and hdbcontr::read().
type of entity for property selection of nodes/elements
Definition at line 85 of file selection.h.
Referenced by conv_selprop(), print(), read(), sel(), and ~sel().
double err |
required error of real range, real list or real period
Definition at line 77 of file selection.h.
Referenced by presence_id(), print(), read(), and sel().
double fintime |
final time for selection of real period
Definition at line 81 of file selection.h.
long* id1 |
array with the first indices
Definition at line 69 of file selection.h.
Referenced by conv2lst(), conv2range(), conv_selprop(), give_nselcomp(), presence_id(), presence_idgt(), print(), elemoutgm::print_gr_oth_mtx(), elemoutgm::print_gr_oth_vec(), nodeoutgm::print_gr_oth_vec(), elemoutgm::print_gr_stra_vec(), nodeoutgm::print_gr_stra_vec(), elemoutgm::print_gr_stre_vec(), nodeoutgm::print_gr_stre_vec(), read(), intpointst::restore_data_bin(), intpoints::restore_data_bin(), intpointst::restore_data_txt(), intpoints::restore_data_txt(), mechmat::restore_intpoints_bin(), mechmat::restore_intpoints_txt(), transmat::restore_intpointst_bin(), transmat::restore_intpointst_txt(), sel(), write_gid_elem_type_tensor(), write_gid_elem_type_vector(), write_gid_elem_type_vectort(), write_gid_nodtensor(), write_gid_nodvector(), and ~sel().
double initime |
initial time for selection of real period
Definition at line 79 of file selection.h.
long n |
number of selections
Definition at line 67 of file selection.h.
Referenced by conv2lst(), conv2range(), conv_selprop(), give_nselcomp(), presence_id(), presence_idgt(), pointoutt::print(), elemoutgt::print(), elemoutt::print(), nodeoutgt::print(), nodeoutt::print(), pointoutm::print(), elemoutgm::print(), elemoutm::print(), nodeoutgm::print(), nodeoutm::print(), print(), hdbcontr::print(), pointoutt::print_eqother(), pointoutt::print_flux(), elemoutgt::print_gr_eqoth_scal(), elemoutgt::print_gr_eqoth_vec(), elemoutgt::print_gr_flux_scal(), elemoutgt::print_gr_flux_vec(), elemoutgt::print_gr_grad_scal(), elemoutgt::print_gr_grad_vec(), elemoutgm::print_gr_oth_mtx(), nodeoutgm::print_gr_oth_mtx(), elemoutgt::print_gr_oth_scal(), elemoutgm::print_gr_oth_scal(), nodeoutgm::print_gr_oth_scal(), elemoutgt::print_gr_oth_vec(), elemoutgm::print_gr_oth_vec(), nodeoutgm::print_gr_oth_vec(), elemoutgm::print_gr_stra_mtx(), nodeoutgm::print_gr_stra_mtx(), elemoutgm::print_gr_stra_scal(), nodeoutgm::print_gr_stra_scal(), elemoutgm::print_gr_stra_vec(), nodeoutgm::print_gr_stra_vec(), elemoutgm::print_gr_stre_mtx(), nodeoutgm::print_gr_stre_mtx(), elemoutgm::print_gr_stre_scal(), nodeoutgm::print_gr_stre_scal(), elemoutgm::print_gr_stre_vec(), nodeoutgm::print_gr_stre_vec(), pointoutt::print_grad(), nodeoutgt::print_graphics(), pointoutt::print_other(), pointoutm::print_other(), pointoutm::print_stra(), pointoutm::print_stre(), pointoutt::read(), elemoutgt::read(), elemoutt::read(), nodeoutgt::read(), nodeoutt::read(), pointoutm::read(), elemoutgm::read(), elemoutm::read(), nodeoutgm::read(), nodeoutm::read(), read(), hdbcontr::read(), mechmat::restore_intpoints_txt(), transmat::restore_intpointst_txt(), mechmat::save_intpoints_bin(), mechmat::save_intpoints_txt(), transmat::save_intpointst_bin(), transmat::save_intpointst_txt(), sel(), outdriverm::testlcs(), write_vtk_unkn(), and hdbcontr::~hdbcontr().
long* ncomp |
array with lengthes of selections
Definition at line 71 of file selection.h.
Referenced by conv2lst(), conv2range(), conv_selprop(), give_nselcomp(), presence_id(), presence_idgt(), print(), elemoutgm::print_gr_oth_mtx(), elemoutgm::print_gr_oth_vec(), nodeoutgm::print_gr_oth_vec(), elemoutgm::print_gr_stra_vec(), nodeoutgm::print_gr_stra_vec(), elemoutgm::print_gr_stre_vec(), nodeoutgm::print_gr_stre_vec(), read(), sel(), write_gid_elem_type_tensor(), write_gid_elem_type_vector(), write_gid_elem_type_vectort(), write_gid_nodtensor(), write_gid_nodvector(), and ~sel().
double r |
double* rid1 |
array with begining real values of real range, real list or real period
Definition at line 73 of file selection.h.
Referenced by presence_id(), print(), read(), sel(), and ~sel().
double* rid2 |
array with ending real values of real range
Definition at line 75 of file selection.h.
Referenced by presence_id(), print(), read(), sel(), and ~sel().
type of selection
Definition at line 65 of file selection.h.
Referenced by outdrivert::close_files_gidsp(), conv2lst(), conv2range(), elemoutgm::conv_sel_prop(), elemoutm::conv_sel_prop(), nodeoutgm::conv_sel_prop(), nodeoutm::conv_sel_prop(), outdrivert::create_files_gidsp(), outdriverm::create_files_gidsp(), give_nselcomp(), presence_id(), presence_idgt(), pointoutt::print(), elemoutgt::print(), elemoutt::print(), nodeoutgt::print(), nodeoutt::print(), outdiagt::print(), pointoutm::print(), elemoutgm::print(), elemoutm::print(), nodeoutgm::print(), nodeoutm::print(), outdiagm::print(), print(), hdbcontr::print(), pointoutt::print_eqother(), pointoutt::print_flux(), elemoutgt::print_gr_eqoth_scal(), elemoutgt::print_gr_eqoth_vec(), elemoutgt::print_gr_flux_scal(), elemoutgt::print_gr_flux_vec(), elemoutgt::print_gr_grad_scal(), elemoutgt::print_gr_grad_vec(), elemoutgm::print_gr_oth_mtx(), nodeoutgm::print_gr_oth_mtx(), elemoutgt::print_gr_oth_scal(), elemoutgm::print_gr_oth_scal(), nodeoutgm::print_gr_oth_scal(), elemoutgt::print_gr_oth_vec(), elemoutgm::print_gr_oth_vec(), nodeoutgm::print_gr_oth_vec(), elemoutgm::print_gr_stra_mtx(), nodeoutgm::print_gr_stra_mtx(), elemoutgm::print_gr_stra_scal(), nodeoutgm::print_gr_stra_scal(), elemoutgm::print_gr_stra_vec(), nodeoutgm::print_gr_stra_vec(), elemoutgm::print_gr_stre_mtx(), nodeoutgm::print_gr_stre_mtx(), elemoutgm::print_gr_stre_scal(), nodeoutgm::print_gr_stre_scal(), elemoutgm::print_gr_stre_vec(), nodeoutgm::print_gr_stre_vec(), pointoutt::print_grad(), nodeoutgt::print_graphics(), nodeoutgm::print_graphics(), pointoutt::print_other(), pointoutm::print_other(), elemoutt::print_out(), nodeoutt::print_out(), elemoutm::print_out(), nodeoutm::print_out(), pointoutm::print_stra(), pointoutm::print_stre(), pointoutt::read(), elemoutgt::read(), elemoutt::read(), nodeoutgt::read(), nodeoutt::read(), outdrivert::read(), outdiagt::read(), pointoutm::read(), elemoutgm::read(), elemoutm::read(), nodeoutgm::read(), nodeoutm::read(), outdriverm::read(), outdiagm::read(), read(), hdbcontr::read(), sel(), solve_linear_statics(), write_gid_elem_type_scalar(), write_vtk_unkn(), and outdriverm::write_vtk_unkn().