32#define get_merged_surface_ GET_MERGED_SURFACE
33#define get_merged_lines_ GET_MERGED_LINES
35#define union_surface_ UNION_SURFACE
36#define delete_surface_ DELETE_SURFACE
37#define intersect_surface_ INTERSECT_SURFACE
39#define union_line_ UNION_LINE
40#define delete_line_ DELETE_LINE
41#define intersect_line_ INTERSECT_LINE
43#define surf_remove_duplicates_ SURF_REMOVE_DUPLICATES
44#define line_remove_duplicates_ LINE_REMOVE_DUPLICATES
60#define STUPL tuple < int,int,int,int,int,int >
70#define LTUPL tuple < int,int,int,int >
80 STUPL new_member = make_tuple ( n1,n2,n3,n4,eltype,elid);
88 LTUPL new_member = make_tuple ( n1,n2,eltype,elid);
158 if (res != 0)
return res;
164 if (res != 0)
return res;
170 if (res != 0)
return res;
176 if (res != 0)
return res;
208 if (res != 0)
return res;
214 if (res != 0)
return res;
228 cout <<
"Number of members= " <<
surface.size() << endl;
233 cout << i <<
" -- nodes : " << get<0>(member) <<
" , " << get<1>(member) <<
" , " << get<2>(member) <<
" , " << get<3>(member) <<
234 " -- eltyp :" << get<4>(member) <<
" -- elid :" << get<5>(member) << endl;
244 cout <<
"Number of members= " <<
lines.size() << endl;
246 for (
auto mem =
lines.begin(); mem !=
lines.end(); mem++){
249 cout << i <<
" -- nodes : " << get<0>(member) <<
" , " << get<1>(member) <<
" -- eltyp :" << get<2>(member) <<
" -- elid :" << get<3>(member) << endl;
282void union_surface_(
int * s1_nd1,
int * s1_nd2,
int * s1_nd3,
int* s1_nd4,
int * s1_eltyp,
int * s1_elid,
int * s1_nmemb,
283 int * s2_nd1,
int * s2_nd2,
int * s2_nd3,
int* s2_nd4,
int * s2_eltyp,
int * s2_elid,
int * s2_nmemb,
293 while (iterator ==
true ){
294 if (i1 == (*s1_nmemb) ) {
295 for (
int j=i2; j< *s2_nmemb; j++){
303 if (i2 == (*s2_nmemb) ) {
304 for (
int j=i1; j< * s1_nmemb; j++){
316 if (res == 1) {
surface.push_back(member2); i2++ ; }
317 else if (res == -1) {
surface.push_back(member1); i1++; }
318 else {
surface.push_back(member1); i1++; i2++; }
348void delete_surface_(
int * s1_nd1,
int * s1_nd2,
int * s1_nd3,
int* s1_nd4,
int * s1_eltyp,
int * s1_elid,
int * s1_nmemb,
349 int * s2_nd1,
int * s2_nd2,
int * s2_nd3,
int* s2_nd4,
int * s2_eltyp,
int * s2_elid,
int * s2_nmemb,
359 while (iterator ==
true ){
361 if (i1 == (*s1_nmemb) ) {
366 if (i2 == (*s2_nmemb) ) {
367 for (
int j=i1; j< * s1_nmemb; j++){
379 if (res == 1) { i2++ ; }
380 else if (res == -1) {
surface.push_back(member1); i1++; }
411void intersect_surface_(
int * s1_nd1,
int * s1_nd2,
int * s1_nd3,
int* s1_nd4,
int * s1_eltyp,
int * s1_elid,
int * s1_nmemb,
412 int * s2_nd1,
int * s2_nd2,
int * s2_nd3,
int* s2_nd4,
int * s2_eltyp,
int * s2_elid,
int * s2_nmemb,
422 while (iterator ==
true ){
424 if (i1 == (*s1_nmemb) ) {
429 if (i2 == (*s2_nmemb) ) {
438 if (res == 1) { i2++ ; }
439 else if (res == -1) { i1++ ; }
440 else {
surface.push_back(member1); i1++; i2++; }
457 void surf_remove_duplicates_(
int * s1_nd1,
int * s1_nd2,
int * s1_nd3,
int* s1_nd4,
int * s1_eltyp,
int * s1_elid,
int *size,
int * new_size)
468 s1_nd1[sz] = s1_nd1[i];
469 s1_nd2[sz] = s1_nd2[i];
470 s1_nd3[sz] = s1_nd3[i];
471 s1_nd4[sz] = s1_nd4[i];
472 s1_eltyp[sz] = s1_eltyp[i];
473 s1_elid[sz] = s1_elid[i];
508 int * s2_nd1,
int * s2_nd2,
int * s2_eltyp,
int * s2_elid,
int * s2_nmemb,
518 while (iterator ==
true ){
519 if (i1 == (*s1_nmemb) ) {
520 for (
int j=i2; j< *s2_nmemb; j++){
522 lines.push_back(member);
524 * nmember =
lines.size();
528 if (i2 == (*s2_nmemb) ) {
529 for (
int j=i1; j< * s1_nmemb; j++){
531 lines.push_back(member);
533 * nmember =
lines.size();
541 if (res == 1) {
lines.push_back(member2); i2++ ; }
542 else if (res == -1) {
lines.push_back(member1); i1++; }
543 else {
lines.push_back(member1); i1++; i2++; }
572 int * s2_nd1,
int * s2_nd2,
int * s2_eltyp,
int * s2_elid,
int * s2_nmemb,
582 while (iterator ==
true ){
583 if (i1 == (*s1_nmemb) ) {
584 * nmember =
lines.size();
588 if (i2 == (*s2_nmemb) ) {
589 for (
int j=i1; j< * s1_nmemb; j++){
591 lines.push_back(member);
593 * nmember =
lines.size();
601 if (res == 1) { i2++ ; }
602 else if (res == -1) {
lines.push_back(member1); i1++; }
632 int * s2_nd1,
int * s2_nd2,
int * s2_eltyp,
int * s2_elid,
int * s2_nmemb,
642 while (iterator ==
true ){
643 if (i1 == (*s1_nmemb) ) {
644 * nmember =
lines.size();
648 if (i2 == (*s2_nmemb) ) {
649 * nmember =
lines.size();
657 if (res == 1) { i2++ ; }
658 else if (res == -1) { i1++; }
659 else {
lines.push_back(member1); i1++; i2++; }
686 l1_nd1[sz] = l1_nd1[i];
687 l1_nd2[sz] = l1_nd2[i];
688 l1_eltyp[sz] = l1_eltyp[i];
689 l1_elid[sz] = l1_elid[i];
712 s_nd1[i] = get<0>(member);
713 s_nd2[i] = get<1>(member);
714 s_nd3[i] = get<2>(member);
715 s_nd4[i] = get<3>(member);
716 s_eltyp[i] = get<4>(member);
717 s_elid[i] = get<5>(member);
721 std::vector<STUPL>().swap(
surface);
735 for (
auto mem =
lines.begin(); mem !=
lines.end(); mem++){
737 s_nd1[i] = get<0>(member);
738 s_nd2[i] = get<1>(member);
739 s_eltyp[i] = get<2>(member);
740 s_elid[i] = get<3>(member);
744 std::vector<LTUPL>().swap(
lines);
757 int s1_nd1[6]={3,3,4,4,7,7};
758 int s1_nd2[6]={5,5,1,1,8,8};
759 int s1_nd3[6]={4,6,2,4,1,4};
760 int s1_nd4[6]={1,2,1,5,2,5};
761 int s1_eltyp[6]={3,3,3,3,3,3};
762 int s1_elid[6]={1,2,3,4,5,6};
765 int s2_nd1[4]={1,3,4,9};
766 int s2_nd2[4]={5,5,8,8};
767 int s2_nd3[4]={4,6,2,7};
768 int s2_nd4[4]={1,2,1,6};
769 int s2_eltyp[4]={3,3,3,3};
770 int s2_elid[4]={9,2,7,8};
773 cout <<
"Union Surface \n";
774 cout <<
"------------- \n" <<
"\n";
776 union_surface_(s1_nd1, s1_nd2, s1_nd3, s1_nd4, s1_eltyp, s1_elid,&s1_nmemb,
777 s2_nd1, s2_nd2, s2_nd3, s2_nd4, s2_eltyp, s2_elid,&s2_nmemb,
786 int s_eltyp[nmember];
792 cout <<
"Delete Surface \n";
793 cout <<
"-------------- \n" <<
"\n";
795 delete_surface_(s1_nd1, s1_nd2, s1_nd3, s1_nd4, s1_eltyp, s1_elid,&s1_nmemb,
796 s2_nd1, s2_nd2, s2_nd3, s2_nd4, s2_eltyp, s2_elid,&s2_nmemb,
805 int sd_eltyp[nmember];
806 int sd_elid[nmember];
812 cout <<
"Intersect Surface \n";
813 cout <<
"----------------- \n" <<
"\n";
816 s2_nd1, s2_nd2, s2_nd3, s2_nd4, s2_eltyp, s2_elid,&s2_nmemb,
825 int si_eltyp[nmember];
826 int si_elid[nmember];
831 cout <<
"\n\nLines"<< endl;;
832 cout <<
"----- \n\n";
835 int l1_nd1[6]={3,3,4,4,7,7};
836 int l1_nd2[6]={5,6,1,5,1,8};
837 int l1_eltyp[6]={3,3,3,3,3,3};
838 int l1_elid[6]={1,2,3,4,5,6};
841 int l2_nd1[4]={1,3,4,9};
842 int l2_nd2[4]={5,6,8,8};
843 int l2_eltyp[4]={3,3,3,3};
844 int l2_elid[4]={9,2,7,8};
847 cout <<
"Union Line \n";
848 cout <<
"---------- \n" <<
"\n";
850 union_line_(l1_nd1, l1_nd2, l1_eltyp, l1_elid, &l1_nmemb,
851 l2_nd1, l2_nd2, l2_eltyp, l2_elid, &l2_nmemb,
858 int lu_eltyp[nmember];
859 int lu_elid[nmember];
863 cout <<
"\nDelete Line \n";
864 cout <<
"------------- \n" <<
"\n";
866 delete_line_(l1_nd1, l1_nd2, l1_eltyp, l1_elid, &l1_nmemb,
867 l2_nd1, l2_nd2, l2_eltyp, l2_elid, &l2_nmemb,
874 int ld_eltyp[nmember];
875 int ld_elid[nmember];
881 cout <<
"\nIntsersect Line \n";
882 cout <<
"---------------- \n" <<
"\n";
885 l2_nd1, l2_nd2, l2_eltyp, l2_elid, &l2_nmemb,
892 int li_eltyp[nmember];
893 int li_elid[nmember];
900 int l5_nd1[7]={3,3,4,4,4,7,7};
901 int l5_nd2[7]={5,6,1,1,5,1,8};
902 int l5_eltyp[7]={3,3,3,3,3,3,3};
903 int l5_elid[7]={1,2,3,3,4,5,6};
907 cout <<
"New Size :" << ns <<
"\n";
908 for (
int i=0;i<ns;i++){
909 cout << i <<
" - " << l5_nd1[i] <<
" " << l5_nd2[i]<<
" " << l5_eltyp[i]<<
" " << l5_elid[i] <<
"\n";
void _FCALL intersect_line_(int *s1_nd1, int *s1_nd2, int *s1_eltyp, int *s1_elid, int *s1_nmemb, int *s2_nd1, int *s2_nd2, int *s2_eltyp, int *s2_elid, int *s2_nmemb, int *nmember)
void _FCALL union_line_(int *s1_nd1, int *s1_nd2, int *s1_eltyp, int *s1_elid, int *s1_nmemb, int *s2_nd1, int *s2_nd2, int *s2_eltyp, int *s2_elid, int *s2_nmemb, int *nmember)
void intersect_surface_(int *s1_nd1, int *s1_nd2, int *s1_nd3, int *s1_nd4, int *s1_eltyp, int *s1_elid, int *s1_nmemb, int *s2_nd1, int *s2_nd2, int *s2_nd3, int *s2_nd4, int *s2_eltyp, int *s2_elid, int *s2_nmemb, int *nmember)
void _FCALL get_merged_surface_(int *s_nd1, int *s_nd2, int *s_nd3, int *s_nd4, int *s_eltyp, int *s_elid)
int tupl_compare(STUPL lhs, STUPL rhs)
void surf_remove_duplicates_(int *s1_nd1, int *s1_nd2, int *s1_nd3, int *s1_nd4, int *s1_eltyp, int *s1_elid, int *size, int *new_size)
void _FCALL delete_line_(int *s1_nd1, int *s1_nd2, int *s1_eltyp, int *s1_elid, int *s1_nmemb, int *s2_nd1, int *s2_nd2, int *s2_eltyp, int *s2_elid, int *s2_nmemb, int *nmember)
void union_surface_(int *s1_nd1, int *s1_nd2, int *s1_nd3, int *s1_nd4, int *s1_eltyp, int *s1_elid, int *s1_nmemb, int *s2_nd1, int *s2_nd2, int *s2_nd3, int *s2_nd4, int *s2_eltyp, int *s2_elid, int *s2_nmemb, int *nmember)
STUPL create_surface_member(int n1, int n2, int n3, int n4, int eltype, int elid)
int tupl_compare_surf(STUPL lhs, STUPL rhs)
void _FCALL get_merged_lines_(int *s_nd1, int *s_nd2, int *s_eltyp, int *s_elid)
LTUPL create_line_member(int n1, int n2, int eltype, int elid)
void delete_surface_(int *s1_nd1, int *s1_nd2, int *s1_nd3, int *s1_nd4, int *s1_eltyp, int *s1_elid, int *s1_nmemb, int *s2_nd1, int *s2_nd2, int *s2_nd3, int *s2_nd4, int *s2_eltyp, int *s2_elid, int *s2_nmemb, int *nmember)
int ltupl_compare(LTUPL lhs, LTUPL rhs)
void line_remove_duplicates_(int *l1_nd1, int *l1_nd2, int *l1_eltyp, int *l1_elid, int *size, int *new_size)