Nektar++
Public Member Functions | Private Attributes | List of all members
Nektar::FieldUtils::Iso Class Reference

#include <ProcessIsoContour.h>

Public Member Functions

void Condense (void)
 
void GlobalCondense (std::vector< std::shared_ptr< Iso > > &iso, bool verbose)
 
void SeparateRegions (std::vector< std::shared_ptr< Iso > > &iso, int minsize, bool verbose)
 
void Smooth (int n_iter, NekDouble lambda, NekDouble mu)
 
int GetNVert (void)
 
void SetNVert (int n)
 
int GetNTris (void)
 
void SetNTris (int n)
 
void SetFields (const int loc, const Array< OneD, Array< OneD, NekDouble > > &intfields, const int j)
 
NekDouble GetFields (const int i, const int j)
 
void SetX (int loc, NekDouble val)
 
void SetY (int loc, NekDouble val)
 
void SetZ (int loc, NekDouble val)
 
NekDouble GetX (int loc)
 
NekDouble GetY (int loc)
 
NekDouble GetZ (int loc)
 
int GetVId (int i)
 
void ResizeVId (int nconn)
 
void SetVId (int i, int j)
 
void ResizeFields (int size)
 
 Iso (int nfields)
 
 ~Iso (void)
 

Private Attributes

bool m_condensed
 
int m_nvert
 
int m_ntris
 
std::vector< NekDoublem_x
 
std::vector< NekDoublem_y
 
std::vector< NekDoublem_z
 
std::vector< std::vector< NekDouble > > m_fields
 
Array< OneD, int > m_vid
 

Detailed Description

Definition at line 44 of file ProcessIsoContour.h.

Constructor & Destructor Documentation

◆ Iso()

Nektar::FieldUtils::Iso::Iso ( int  nfields)
inline

Definition at line 154 of file ProcessIsoContour.h.

155 {
156 m_condensed = false;
157 m_nvert = 0;
158 m_fields.resize(nfields);
159 // set up initial vectors to be 1000 long
160 m_x.resize(1000);
161 m_y.resize(1000);
162 m_z.resize(1000);
163 for (int i = 0; i < m_fields.size(); ++i)
164 {
165 m_fields[i].resize(1000);
166 }
167 };
std::vector< NekDouble > m_z
std::vector< std::vector< NekDouble > > m_fields
std::vector< NekDouble > m_y
std::vector< NekDouble > m_x

References m_condensed, m_fields, m_nvert, m_x, m_y, and m_z.

◆ ~Iso()

Nektar::FieldUtils::Iso::~Iso ( void  )
inline

Definition at line 169 of file ProcessIsoContour.h.

170 {
171 }

Member Function Documentation

◆ Condense()

void Nektar::FieldUtils::Iso::Condense ( void  )

Definition at line 659 of file ProcessIsoContour.cpp.

660{
661 int i, j, cnt;
662 IsoVertex v;
663 vector<IsoVertex> vert;
664
665 if (!m_ntris)
666 {
667 return;
668 }
669
670 if (m_condensed)
671 {
672 return;
673 }
674 m_condensed = true;
675
676 vert.reserve(m_ntris / 6);
677
678 m_vid = Array<OneD, int>(3 * m_ntris);
679
680 // fill first 3 points and initialise fields
681 v.m_fields.resize(m_fields.size());
682 for (cnt = 0, i = 0; i < 3; ++i)
683 {
684 v.m_x = m_x[i];
685 v.m_y = m_y[i];
686 v.m_z = m_z[i];
687 for (int f = 0; f < m_fields.size(); ++f)
688 {
689 v.m_fields[f] = m_fields[f][i];
690 }
691 v.m_id = cnt;
692 vert.push_back(v);
693 m_vid[i] = v.m_id;
694 ++cnt;
695 }
696
697 for (i = 1; i < m_ntris; ++i)
698 {
699 for (j = 0; j < 3; ++j)
700 {
701 v.m_x = m_x[3 * i + j];
702 v.m_y = m_y[3 * i + j];
703 v.m_z = m_z[3 * i + j];
704
705 auto pt = find(vert.begin(), vert.end(), v);
706 if (pt != vert.end())
707 {
708 m_vid[3 * i + j] = pt[0].m_id;
709 }
710 else
711 {
712 v.m_id = cnt;
713
714 for (int f = 0; f < m_fields.size(); ++f)
715 {
716 v.m_fields[f] = m_fields[f][3 * i + j];
717 }
718
719 vert.push_back(v);
720
721 m_vid[3 * i + j] = v.m_id;
722 ++cnt;
723 }
724 }
725 }
726
727 // remove elements with multiple vertices
728 for (i = 0, cnt = 0; i < m_ntris;)
729 {
730 if ((m_vid[3 * i] == m_vid[3 * i + 1]) ||
731 (m_vid[3 * i] == m_vid[3 * i + 2]) ||
732 (m_vid[3 * i + 1] == m_vid[3 * i + 2]))
733 {
734 cnt++;
735 for (j = 3 * i; j < 3 * (m_ntris - 1); ++j)
736 {
737 m_vid[j] = m_vid[j + 3];
738 }
739 m_ntris--;
740 }
741 else
742 {
743 ++i;
744 }
745 }
746
747 m_nvert = vert.size();
748
749 m_x.resize(m_nvert);
750 m_y.resize(m_nvert);
751 m_z.resize(m_nvert);
752
753 for (int f = 0; f < m_fields.size(); ++f)
754 {
755 m_fields[f].resize(m_nvert);
756 }
757
758 for (i = 0; i < m_nvert; ++i)
759 {
760 m_x[i] = vert[i].m_x;
761 m_y[i] = vert[i].m_y;
762 m_z[i] = vert[i].m_z;
763 for (int f = 0; f < m_fields.size(); ++f)
764 {
765 m_fields[f][i] = vert[i].m_fields[f];
766 }
767 }
768}
Array< OneD, int > m_vid
InputIterator find(InputIterator first, InputIterator last, InputIterator startingpoint, const EqualityComparable &value)
Definition: StdRegions.hpp:447

References Nektar::StdRegions::find(), m_condensed, m_fields, Nektar::FieldUtils::IsoVertex::m_fields, Nektar::FieldUtils::IsoVertex::m_id, m_ntris, m_nvert, m_vid, m_x, Nektar::FieldUtils::IsoVertex::m_x, m_y, Nektar::FieldUtils::IsoVertex::m_y, m_z, and Nektar::FieldUtils::IsoVertex::m_z.

◆ GetFields()

NekDouble Nektar::FieldUtils::Iso::GetFields ( const int  i,
const int  j 
)
inline

Definition at line 88 of file ProcessIsoContour.h.

89 {
90 return m_fields[i][j];
91 }

References m_fields.

◆ GetNTris()

int Nektar::FieldUtils::Iso::GetNTris ( void  )
inline

Definition at line 64 of file ProcessIsoContour.h.

65 {
66 return m_ntris;
67 }

References m_ntris.

◆ GetNVert()

int Nektar::FieldUtils::Iso::GetNVert ( void  )
inline

Definition at line 54 of file ProcessIsoContour.h.

55 {
56 return m_nvert;
57 }

References m_nvert.

◆ GetVId()

int Nektar::FieldUtils::Iso::GetVId ( int  i)
inline

Definition at line 123 of file ProcessIsoContour.h.

124 {
125 return m_vid[i];
126 }

References m_vid.

◆ GetX()

NekDouble Nektar::FieldUtils::Iso::GetX ( int  loc)
inline

Definition at line 108 of file ProcessIsoContour.h.

109 {
110 return m_x[loc];
111 }

References CG_Iterations::loc, and m_x.

◆ GetY()

NekDouble Nektar::FieldUtils::Iso::GetY ( int  loc)
inline

Definition at line 113 of file ProcessIsoContour.h.

114 {
115 return m_y[loc];
116 }

References CG_Iterations::loc, and m_y.

◆ GetZ()

NekDouble Nektar::FieldUtils::Iso::GetZ ( int  loc)
inline

Definition at line 118 of file ProcessIsoContour.h.

119 {
120 return m_z[loc];
121 }

References CG_Iterations::loc, and m_z.

◆ GlobalCondense()

void Nektar::FieldUtils::Iso::GlobalCondense ( std::vector< std::shared_ptr< Iso > > &  iso,
bool  verbose 
)

Definition at line 770 of file ProcessIsoContour.cpp.

771{
772 typedef bg::model::point<NekDouble, 3, bg::cs::cartesian> BPoint;
773 typedef std::pair<BPoint, unsigned int> PointPair;
774
775 int i, j, n;
776 int nelmt;
777 int niso = iso.size();
778 int id1, id2;
779 Array<OneD, Array<OneD, int>> vidmap;
780
781 if (m_condensed)
782 {
783 return;
784 }
785 m_condensed = true;
786
787 vidmap = Array<OneD, Array<OneD, int>>(niso);
788
789 m_ntris = 0;
790 for (i = 0; i < niso; ++i)
791 {
792 if (iso[i]->m_ntris)
793 {
794 m_ntris += iso[i]->m_ntris;
795 }
796 }
797
798 m_vid = Array<OneD, int>(3 * m_ntris);
799
800 m_nvert = 0;
801 for (i = 0; i < niso; ++i)
802 {
803 if (iso[i]->m_ntris)
804 {
805 m_nvert += iso[i]->m_nvert;
806 }
807 }
808
809 vector<vector<int>> isocon;
810 isocon.resize(niso);
811 vector<int> global_to_unique_map;
812 global_to_unique_map.resize(m_nvert);
813
814 vector<pair<int, int>> global_to_iso_map;
815 global_to_iso_map.resize(m_nvert);
816
817 // Fill vertex array into rtree format
818 id2 = 0;
819 std::vector<PointPair> inPoints;
820 for (i = 0; i < niso; ++i)
821 {
822 for (id1 = 0; id1 < iso[i]->m_nvert; ++id1)
823 {
824 inPoints.push_back(PointPair(
825 BPoint(iso[i]->m_x[id1], iso[i]->m_y[id1], iso[i]->m_z[id1]),
826 id2));
827 global_to_unique_map[id2] = id2;
828 global_to_iso_map[id2] = make_pair(i, id1);
829 id2++;
830 }
831 }
832
833 if (verbose)
834 {
835 cout << "\t Process building tree ..." << endl;
836 }
837
838 // Build tree
839 bgi::rtree<PointPair, bgi::rstar<16>> rtree;
840 rtree.insert(inPoints.begin(), inPoints.end());
841
842 // Find neighbours
843 int unique_index = 0;
844 int prog = 0;
845 for (i = 0; i < m_nvert; ++i)
846 {
847 if (verbose)
848 {
849 prog = LibUtilities::PrintProgressbar(i, m_nvert, "Nearest verts",
850 prog);
851 }
852
853 BPoint queryPoint = inPoints[i].first;
854
855 // check to see if point has been already reset to lower than
856 // unique value
857 if (global_to_unique_map[i] < unique_index) // do nothing
858 {
859 }
860 else
861 {
862 // find nearest 10 points within the distance box
863 std::vector<PointPair> result;
864 rtree.query(bgi::nearest(queryPoint, 10),
865 std::back_inserter(result));
866
867 // see if any values have unique value already
868 set<int> samept;
869 int new_index = -1;
870 for (id1 = 0; id1 < result.size(); ++id1)
871 {
872 NekDouble dist = bg::distance(queryPoint, result[id1].first);
873 if (dist * dist < NekConstants::kNekZeroTol) // same point
874 {
875 id2 = result[id1].second;
876 samept.insert(id2);
877
878 if (global_to_unique_map[id2] < unique_index)
879 {
880 new_index = global_to_unique_map[id2];
881 }
882 }
883 }
884 if (new_index == -1)
885 {
886 new_index = unique_index;
887 unique_index++;
888 }
889
890 // reset all same values to new_index
891 global_to_unique_map[i] = new_index;
892 for (auto &it : samept)
893 {
894 global_to_unique_map[it] = new_index;
895 }
896 }
897 }
898
899 if (verbose)
900 {
901 cout << endl;
902 }
903
904 m_nvert = unique_index;
905
906 nelmt = 0;
907 // reset m_vid;
908 int cnt = 0;
909 for (n = 0; n < niso; ++n)
910 {
911 for (i = 0; i < iso[n]->m_ntris; ++i, nelmt++)
912 {
913 for (j = 0; j < 3; ++j)
914 {
915 m_vid[3 * nelmt + j] =
916 global_to_unique_map[iso[n]->m_vid[3 * i + j] + cnt];
917 }
918 }
919 cnt += iso[n]->m_nvert;
920 }
921
922 m_ntris = nelmt;
923
924 m_x.resize(m_nvert);
925 m_y.resize(m_nvert);
926 m_z.resize(m_nvert);
927
928 m_fields.resize(iso[0]->m_fields.size());
929 for (i = 0; i < iso[0]->m_fields.size(); ++i)
930 {
931 m_fields[i].resize(m_nvert);
932 }
933
934 for (n = 0; n < global_to_unique_map.size(); ++n)
935 {
936
937 m_x[global_to_unique_map[n]] = bg::get<0>(inPoints[n].first);
938 m_y[global_to_unique_map[n]] = bg::get<1>(inPoints[n].first);
939 m_z[global_to_unique_map[n]] = bg::get<2>(inPoints[n].first);
940
941 int isoid = global_to_iso_map[n].first;
942 int ptid = global_to_iso_map[n].second;
943 for (j = 0; j < m_fields.size(); ++j)
944 {
945 m_fields[j][global_to_unique_map[n]] =
946 iso[isoid]->m_fields[j][ptid];
947 }
948 }
949}
int PrintProgressbar(const int position, const int goal, const std::string message, int lastprogress=-1)
Prints a progressbar.
Definition: Progressbar.hpp:65
static const NekDouble kNekZeroTol
double NekDouble

References Nektar::NekConstants::kNekZeroTol, m_condensed, m_fields, m_ntris, m_nvert, m_vid, m_x, m_y, m_z, and Nektar::LibUtilities::PrintProgressbar().

◆ ResizeFields()

void Nektar::FieldUtils::Iso::ResizeFields ( int  size)
inline

Definition at line 138 of file ProcessIsoContour.h.

139 {
140 if (size > m_x.size()) // add 1000 element to vectors
141 {
142 m_x.resize(size + 100);
143 m_y.resize(size + 100);
144 m_z.resize(size + 100);
145 ;
146 for (int i = 0; i < m_fields.size(); ++i)
147 {
148 m_fields[i].resize(size + 1000);
149 }
150 }
151 m_nvert = size;
152 }

References m_fields, m_nvert, m_x, m_y, and m_z.

◆ ResizeVId()

void Nektar::FieldUtils::Iso::ResizeVId ( int  nconn)
inline

Definition at line 128 of file ProcessIsoContour.h.

129 {
130 m_vid = Array<OneD, int>(nconn);
131 }

References m_vid.

◆ SeparateRegions()

void Nektar::FieldUtils::Iso::SeparateRegions ( std::vector< std::shared_ptr< Iso > > &  iso,
int  minsize,
bool  verbose 
)

Definition at line 1078 of file ProcessIsoContour.cpp.

1080{
1081 int i, j, k, id;
1082 Array<OneD, vector<int>> vertcon(m_nvert);
1083 list<int> tocheck;
1084
1085 Array<OneD, bool> viddone(m_nvert, false);
1086
1087 // make list of connecting tris around each vertex
1088 for (i = 0; i < m_ntris; ++i)
1089 {
1090 for (j = 0; j < 3; ++j)
1091 {
1092 vertcon[m_vid[3 * i + j]].push_back(i);
1093 }
1094 }
1095
1096 Array<OneD, int> vidregion(m_nvert, -1);
1097
1098 int nregions = -1;
1099
1100 // check all points are assigned to a region
1101 int progcnt = -1;
1102 for (k = 0; k < m_nvert; ++k)
1103 {
1104 if (verbose)
1105 {
1107 k, m_nvert, "Separating regions", progcnt);
1108 }
1109
1110 if (vidregion[k] == -1)
1111 {
1112 vidregion[k] = ++nregions;
1113
1114 // find all elmts around this.. vertex that need to be checked
1115 for (auto &ipt : vertcon[k])
1116 {
1117 for (i = 0; i < 3; ++i)
1118 {
1119 if (vidregion[id = m_vid[3 * ipt + i]] == -1)
1120 {
1121 tocheck.push_back(id);
1122 vidregion[id] = nregions;
1123 }
1124 }
1125 }
1126 viddone[k] = 1;
1127
1128 // check all other neighbouring vertices
1129 while (tocheck.size())
1130 {
1131 auto cid = tocheck.begin();
1132 while (cid != tocheck.end())
1133 {
1134 if (!viddone[*cid])
1135 {
1136 for (auto &ipt : vertcon[*cid])
1137 {
1138 for (i = 0; i < 3; ++i)
1139 {
1140 if (vidregion[id = m_vid[3 * ipt + i]] == -1)
1141 {
1142 tocheck.push_back(id);
1143 vidregion[id] = nregions;
1144 }
1145 }
1146 }
1147 viddone[*cid] = 1;
1148 ++cid;
1149 tocheck.pop_front();
1150 }
1151 }
1152 }
1153 }
1154 }
1155 nregions++;
1156
1157 Array<OneD, int> nvert(nregions, 0);
1158 Array<OneD, int> nelmt(nregions, 0);
1159
1160 // count nverts
1161 for (i = 0; i < m_nvert; ++i)
1162 {
1163 nvert[vidregion[i]] += 1;
1164 }
1165
1166 // count nelmts
1167 for (i = 0; i < m_ntris; ++i)
1168 {
1169 nelmt[vidregion[m_vid[3 * i]]] += 1;
1170 }
1171
1172 Array<OneD, int> vidmap(m_nvert);
1173 // generate new list of isocontour
1174 for (int n = 0; n < nregions; ++n)
1175 {
1176 if (nelmt[n] > minsize)
1177 {
1178 int nfields = m_fields.size();
1180
1181 iso->m_ntris = nelmt[n];
1182 iso->m_vid = Array<OneD, int>(3 * nelmt[n]);
1183
1184 iso->m_nvert = nvert[n];
1185 iso->m_x.resize(nvert[n]);
1186 iso->m_y.resize(nvert[n]);
1187 iso->m_z.resize(nvert[n]);
1188
1189 iso->m_fields.resize(nfields);
1190 for (i = 0; i < nfields; ++i)
1191 {
1192 iso->m_fields[i].resize(nvert[n]);
1193 }
1194
1195 int cnt = 0;
1196 // generate vid map;
1197 Vmath::Zero(m_nvert, vidmap, 1);
1198 for (i = 0; i < m_nvert; ++i)
1199 {
1200 if (vidregion[i] == n)
1201 {
1202 vidmap[i] = cnt++;
1203 }
1204 }
1205
1206 cnt = 0;
1207 for (i = 0; i < m_ntris; ++i)
1208 {
1209 if (vidregion[m_vid[3 * i]] == n)
1210 {
1211 for (j = 0; j < 3; ++j)
1212 {
1213 iso->m_vid[3 * cnt + j] = vidmap[m_vid[3 * i + j]];
1214
1215 iso->m_x[vidmap[m_vid[3 * i + j]]] =
1216 m_x[m_vid[3 * i + j]];
1217 iso->m_y[vidmap[m_vid[3 * i + j]]] =
1218 m_y[m_vid[3 * i + j]];
1219 iso->m_z[vidmap[m_vid[3 * i + j]]] =
1220 m_z[m_vid[3 * i + j]];
1221
1222 for (k = 0; k < nfields; ++k)
1223 {
1224 iso->m_fields[k][vidmap[m_vid[3 * i + j]]] =
1225 m_fields[k][m_vid[3 * i + j]];
1226 }
1227 }
1228 cnt++;
1229 }
1230 }
1231
1232 WARNINGL0(cnt == nelmt[n], "Number of elements do not match");
1233 sep_iso.push_back(iso);
1234 }
1235 }
1236}
#define WARNINGL0(condition, msg)
Definition: ErrorUtil.hpp:215
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
std::shared_ptr< Iso > IsoSharedPtr
void Zero(int n, T *x, const int incx)
Zero vector.
Definition: Vmath.hpp:273

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), m_fields, m_ntris, m_nvert, m_vid, m_x, m_y, m_z, Nektar::LibUtilities::PrintProgressbar(), WARNINGL0, and Vmath::Zero().

◆ SetFields()

void Nektar::FieldUtils::Iso::SetFields ( const int  loc,
const Array< OneD, Array< OneD, NekDouble > > &  intfields,
const int  j 
)
inline

Definition at line 74 of file ProcessIsoContour.h.

77 {
78 m_x[loc] = intfields[0][j];
79 m_y[loc] = intfields[1][j];
80 m_z[loc] = intfields[2][j];
81
82 for (int i = 0; i < intfields.size() - 3; ++i)
83 {
84 m_fields[i][loc] = intfields[i + 3][j];
85 }
86 }

References CG_Iterations::loc, m_fields, m_x, m_y, and m_z.

◆ SetNTris()

void Nektar::FieldUtils::Iso::SetNTris ( int  n)
inline

Definition at line 69 of file ProcessIsoContour.h.

70 {
71 m_ntris = n;
72 }

References m_ntris.

◆ SetNVert()

void Nektar::FieldUtils::Iso::SetNVert ( int  n)
inline

Definition at line 59 of file ProcessIsoContour.h.

60 {
61 m_nvert = n;
62 }

References m_nvert.

◆ SetVId()

void Nektar::FieldUtils::Iso::SetVId ( int  i,
int  j 
)
inline

Definition at line 133 of file ProcessIsoContour.h.

134 {
135 m_vid[i] = j;
136 }

References m_vid.

◆ SetX()

void Nektar::FieldUtils::Iso::SetX ( int  loc,
NekDouble  val 
)
inline

Definition at line 93 of file ProcessIsoContour.h.

94 {
95 m_x[loc] = val;
96 }

References CG_Iterations::loc, and m_x.

◆ SetY()

void Nektar::FieldUtils::Iso::SetY ( int  loc,
NekDouble  val 
)
inline

Definition at line 98 of file ProcessIsoContour.h.

99 {
100 m_y[loc] = val;
101 }

References CG_Iterations::loc, and m_y.

◆ SetZ()

void Nektar::FieldUtils::Iso::SetZ ( int  loc,
NekDouble  val 
)
inline

Definition at line 103 of file ProcessIsoContour.h.

104 {
105 m_z[loc] = val;
106 }

References CG_Iterations::loc, and m_z.

◆ Smooth()

void Nektar::FieldUtils::Iso::Smooth ( int  n_iter,
NekDouble  lambda,
NekDouble  mu 
)

Definition at line 973 of file ProcessIsoContour.cpp.

974{
975 int iter, i, j, k;
976 NekDouble del_v[3];
977 NekDouble w;
978 Array<OneD, NekDouble> xtemp, ytemp, ztemp;
979 vector<vector<int>> adj, vertcon;
980 vector<vector<NekDouble>> wght;
981
982 // determine elements around each vertex
983 vertcon.resize(m_nvert);
984 for (i = 0; i < m_ntris; ++i)
985 {
986 for (j = 0; j < 3; ++j)
987 {
988 vertcon[m_vid[3 * i + j]].push_back(i);
989 }
990 }
991
992 // determine vertices and weights around each vertex
993 adj.resize(m_nvert);
994 wght.resize(m_nvert);
995
996 for (i = 0; i < m_nvert; ++i)
997 {
998 // loop over surrounding elements
999 for (auto &ipt : vertcon[i])
1000 {
1001 for (j = 0; j < 3; ++j)
1002 {
1003 // make sure not adding own vertex
1004 if (m_vid[3 * ipt + j] != i)
1005 {
1006 // check to see if vertex has already been added
1007 for (k = 0; k < adj[i].size(); ++k)
1008 {
1009 if (adj[i][k] == m_vid[3 * ipt + j])
1010 {
1011 break;
1012 }
1013 }
1014
1015 if (k == adj[i].size())
1016 {
1017 adj[i].push_back(m_vid[3 * ipt + j]);
1018 }
1019 }
1020 }
1021 }
1022 }
1023
1024 // Currently set weights up as even distribution
1025 for (i = 0; i < m_nvert; ++i)
1026 {
1027 w = 1.0 / ((NekDouble)adj[i].size());
1028 for (j = 0; j < adj[i].size(); ++j)
1029 {
1030 wght[i].push_back(w);
1031 }
1032 }
1033
1034 xtemp = Array<OneD, NekDouble>(m_nvert);
1035 ytemp = Array<OneD, NekDouble>(m_nvert);
1036 ztemp = Array<OneD, NekDouble>(m_nvert);
1037
1038 // smooth each point
1039 for (iter = 0; iter < n_iter; iter++)
1040 {
1041 // compute first weighted average
1042 for (i = 0; i < m_nvert; ++i)
1043 {
1044 del_v[0] = del_v[1] = del_v[2] = 0.0;
1045 for (j = 0; j < adj[i].size(); ++j)
1046 {
1047 del_v[0] = del_v[0] + (m_x[adj[i][j]] - m_x[i]) * wght[i][j];
1048 del_v[1] = del_v[1] + (m_y[adj[i][j]] - m_y[i]) * wght[i][j];
1049 del_v[2] = del_v[2] + (m_z[adj[i][j]] - m_z[i]) * wght[i][j];
1050 }
1051
1052 xtemp[i] = m_x[i] + del_v[0] * lambda;
1053 ytemp[i] = m_y[i] + del_v[1] * lambda;
1054 ztemp[i] = m_z[i] + del_v[2] * lambda;
1055 }
1056
1057 // compute second weighted average
1058 for (i = 0; i < m_nvert; ++i)
1059 {
1060 del_v[0] = del_v[1] = del_v[2] = 0;
1061 for (j = 0; j < adj[i].size(); ++j)
1062 {
1063 del_v[0] =
1064 del_v[0] + (xtemp[adj[i][j]] - xtemp[i]) * wght[i][j];
1065 del_v[1] =
1066 del_v[1] + (ytemp[adj[i][j]] - ytemp[i]) * wght[i][j];
1067 del_v[2] =
1068 del_v[2] + (ztemp[adj[i][j]] - ztemp[i]) * wght[i][j];
1069 }
1070
1071 m_x[i] = xtemp[i] + del_v[0] * mu;
1072 m_y[i] = ytemp[i] + del_v[1] * mu;
1073 m_z[i] = ztemp[i] + del_v[2] * mu;
1074 }
1075 }
1076}
std::vector< double > w(NPUPPER)

References m_ntris, m_nvert, m_vid, m_x, m_y, m_z, and Nektar::UnitTests::w().

Member Data Documentation

◆ m_condensed

bool Nektar::FieldUtils::Iso::m_condensed
private

Definition at line 174 of file ProcessIsoContour.h.

Referenced by Condense(), GlobalCondense(), and Iso().

◆ m_fields

std::vector<std::vector<NekDouble> > Nektar::FieldUtils::Iso::m_fields
private

◆ m_ntris

int Nektar::FieldUtils::Iso::m_ntris
private

◆ m_nvert

int Nektar::FieldUtils::Iso::m_nvert
private

◆ m_vid

Array<OneD, int> Nektar::FieldUtils::Iso::m_vid
private

◆ m_x

std::vector<NekDouble> Nektar::FieldUtils::Iso::m_x
private

◆ m_y

std::vector<NekDouble> Nektar::FieldUtils::Iso::m_y
private

◆ m_z

std::vector<NekDouble> Nektar::FieldUtils::Iso::m_z
private