Browse Source

non-closed loops are now grounded

master
Trevor Irons 5 years ago
parent
commit
b6b2ffabb9
1 changed files with 9 additions and 1 deletions
  1. 9
    1
      Modules/FDEM1D/src/PolygonalWireAntenna.cpp

+ 9
- 1
Modules/FDEM1D/src/PolygonalWireAntenna.cpp View File

@@ -126,9 +126,17 @@ namespace Lemma {
126 126
 		    std::vector< std::shared_ptr<DipoleSource> >       xDipoles;
127 127
 
128 128
 		    // loop over all segments
129
-		    for (int iseg=0; iseg<NumberOfPoints-1; ++iseg) {
129
+		    int iseg;
130
+            for (iseg=0; iseg<NumberOfPoints-1; ++iseg) {
130 131
 			    InterpolateLineSegment(Points.col(iseg), Points.col(iseg+1), rp, xDipoles);
131 132
 		    }
133
+
134
+            // Check to see if the loop is closed, if not, assume its grounded on ends,
135
+            if ( (Points.col(0)-Points.col(iseg)).norm() > 1e-3 ) {
136
+                xDipoles[0]->SetType(GROUNDEDELECTRICDIPOLE);
137
+                xDipoles.back()->SetType(GROUNDEDELECTRICDIPOLE);
138
+            }
139
+
132 140
             Dipoles = std::move(xDipoles);
133 141
             rRepeat = rp;
134 142
 

Loading…
Cancel
Save