47 const std :: list< int > &bcDofMans,
83 const std :: list< int > &bcDofMans,
90 int nnode =
domain->giveNumberOfDofManagers();
95 for ( i = 0; i < nnode; i++ ) {
101 for (
int jnode: bcDofMans ) {
110 for (
int jnode: bcDofMans ) {
115 if ( neighbor == i ) {
133FastMarchingMethod :: updateTrialValue(
FloatArray &dmanValues,
int id,
double F)
135 int ai, bi, ci, h, nroot, _ind = 0;
136 double at, bt, ht, a, b, u, cos_fi, sin_fi, _a, _b, _c, r1, r2, r3, t = 0.0, _h;
148 for (
int j = 1; j <= 3; j++ ) {
160 at = dmanValues.
at(ai);
161 bt = dmanValues.
at(bi);
162 if ( fabs(at) > fabs(bt) ) {
172 const auto &ac =
domain->giveNode(ai)->giveCoordinates();
173 const auto &bc =
domain->giveNode(bi)->giveCoordinates();
174 const auto &cc =
domain->giveNode(ci)->giveCoordinates();
186 sin_fi = sqrt(1.0 - cos_fi * cos_fi);
189 _a = ( a * a + b * b - 2.0 * a * b * cos_fi );
190 _b = 2.0 * b * u * ( a * cos_fi - b );
191 _c = b * b * ( u * u - F * F * a * a * sin_fi * sin_fi );
192 cubic3r(0.0, _a, _b, _c, & r1, & r2, & r3, & nroot);
196 reg_upd_flag =
false;
197 }
else if ( nroot == 1 ) {
199 }
else if ( r1 >= 0.0 ) {
201 }
else if ( r2 >= 0.0 ) {
204 reg_upd_flag =
false;
207 if ( reg_upd_flag ) {
208 _h = b * ( t - u ) / t;
209 if ( ( t > u ) && ( _h > a * cos_fi ) && ( _h < a / cos_fi ) ) {
211 dmanValues.
at(ci) =
sgn(F) * t + at;
212 }
else if ( F > 0. ) {
213 dmanValues.
at(ci) =
min(dmanValues.
at(ci),
sgn(F) * t + at);
215 dmanValues.
at(ci) =
max(dmanValues.
at(ci),
sgn(F) * t + at);
218 reg_upd_flag =
false;
222 if ( !reg_upd_flag ) {
224 _h =
min(b * F + at, a * F + bt);
226 _h =
max(b * F + at, a * F + bt);
230 dmanValues.
at(ci) = _h;
231 }
else if ( F > 0. ) {
232 dmanValues.
at(ci) =
min(dmanValues.
at(ci), _h);
234 dmanValues.
at(ci) =
max(dmanValues.
at(ci), _h);
250FastMarchingMethod :: getSmallestTrialDofMan()
const IntArray * giveDofManConnectivityArray(int dofman)
const IntArray & giveDofManArray() const
int giveDofManagerNumber(int i) const
virtual Element_Geometry_Type giveGeometryType() const =0
std ::vector< FMM_DofmanRecord > dmanRecords
Array of DofManager records.
std ::priority_queue< int, std ::vector< int >, FMM_DofmanRecordDelegate_greater > dmanTrialQueue
Priority queue for trial T values.
void initialize(FloatArray &dmanValues, const std ::list< int > &bcDofMans, double F)
Initialize receiver.
@ FMM_Status_TRIAL
Trial nodes, candidates for known (accepted).
@ FMM_Status_FAR
Nodes not yet visited.
@ FMM_Status_KNOWN_BOUNDARY
Boundary nodes, from which the front will not propagate.
@ FMM_Status_KNOWN
Accepted nodes.
const FloatArray * dmanValuesPtr
Pointer to working set of dmanValues.
int getSmallestTrialDofMan()
Get the trial point with smallest T; zero if empty.
void updateTrialValue(FloatArray &dmanValues, int id, double F)
Updates the distance of trial node with given id).
double dotProduct(const FloatArray &x) const
void beDifferenceOf(const FloatArray &a, const FloatArray &b)
FloatArrayF< N > min(const FloatArrayF< N > &a, const FloatArrayF< N > &b)
FloatArrayF< N > max(const FloatArrayF< N > &a, const FloatArrayF< N > &b)
void cubic3r(double a, double b, double c, double d, double *r1, double *r2, double *r3, int *num)
double sgn(double i)
Returns the signum of given value (if value is < 0 returns -1, otherwise returns 1).
double distance(const FloatArray &x, const FloatArray &y)