@@ -59,6 +59,13 @@ namespace geode
5959 std::string string () const
6060 {
6161 auto message = absl::StrCat ( " FractureSetDescription: " , name );
62+ for ( const auto & fixed_object : observed_fractures )
63+ {
64+ absl::StrAppend ( &message,
65+ " \n\t --> observation (x,y,z)start: " ,
66+ fixed_object[0 ].string (),
67+ " (x,y,z)end: " , fixed_object[1 ].string () );
68+ }
6269 absl::StrAppend (
6370 &message, " \n\t --> length distribution: " , length.string () );
6471 absl::StrAppend (
@@ -81,6 +88,13 @@ namespace geode
8188 {
8289 }
8390
91+ void add_x_node_monitoring ( double beta_x_node )
92+ {
93+ OPENGEODE_EXCEPTION ( beta_x_node <= 1.0 && beta_x_node >= 0 .,
94+ " [FractureSimulationRunner] x node should be inhibitated, "
95+ " please provise a value in [0., 1.]." );
96+ beta_x_node_ = beta_x_node;
97+ }
8498 void add_fracture_set_descriptor (
8599 const FractureSetDescription& descriptor )
86100 {
@@ -134,23 +148,43 @@ namespace geode
134148 set_desc.p20 , std::vector< uuid >{ set_id },
135149 this ->domain_ ) ) );
136150 // spacing
137- if ( set_desc.minimal_spacing < GLOBAL_EPSILON )
151+ if ( set_desc.minimal_spacing > GLOBAL_EPSILON )
138152 {
139- continue ;
153+ auto interaction = std::make_unique<
154+ EuclideanCutoffInteraction< OwnerSegment2D > >(
155+ set_desc.minimal_spacing ,
156+ PairwiseInteraction<
157+ OwnerSegment2D >::SCOPE ::same_set );
158+
159+ this ->ordered_energy_terms_ .push_back (
160+ this ->energy_terms_collection_ .add_energy_term (
161+ std::make_unique< PairwiseTerm< OwnerSegment2D > >(
162+ absl::StrCat ( set_desc.name , " _min_spacing" ),
163+ 0 ., std::vector< uuid >{ set_id },
164+ std::move ( interaction ), this ->domain_ ) ) );
165+ }
166+ }
167+ // x node monitoring
168+ if ( std::fabs ( beta_x_node_ - 1 . ) > GLOBAL_EPSILON )
169+ {
170+ std::vector< uuid > set_uuids;
171+ set_uuids.reserve ( name_to_uuid.size () );
172+ for ( const auto & [name, id] : name_to_uuid )
173+ {
174+ set_uuids.push_back ( id );
140175 }
141176 auto interaction = std::make_unique<
142177 EuclideanCutoffInteraction< OwnerSegment2D > >(
143- set_desc. minimal_spacing ,
144- PairwiseInteraction< OwnerSegment2D >::SCOPE ::same_set );
178+ 0 ., PairwiseInteraction<
179+ OwnerSegment2D >::SCOPE ::different_set );
145180
146181 this ->ordered_energy_terms_ .push_back (
147182 this ->energy_terms_collection_ .add_energy_term (
148183 std::make_unique< PairwiseTerm< OwnerSegment2D > >(
149- absl::StrCat ( set_desc. name , " _min_spacing " ), 0 . ,
150- std::vector< uuid >{ set_id } ,
151- std::move ( interaction ), this ->domain_ ) ) );
184+ absl::StrCat ( " inter_set_x_nodes " ), beta_x_node_ ,
185+ set_uuids, std::move ( interaction ) ,
186+ this ->domain_ ) ) );
152187 }
153-
154188 this ->mh_sampler_ =
155189 std::make_unique< MetropolisHastings< OwnerSegment2D > >(
156190 this ->energy_terms_collection_ ,
@@ -173,8 +207,32 @@ namespace geode
173207 }
174208 }
175209
210+ std::string string () const
211+ {
212+ auto message =
213+ absl::StrCat ( " Fracture Simulation Runner description" );
214+ for ( const auto & desc : set_descriptors_ )
215+ {
216+ absl::StrAppend ( &message, " \n\t " , desc.string () );
217+ }
218+ if ( std::fabs ( beta_x_node_ - 1 . ) > GLOBAL_EPSILON )
219+ {
220+ absl::StrAppend ( &message,
221+ " \n\t --> x node monitioring (beta inhibition value): " ,
222+ beta_x_node_ );
223+ }
224+ else
225+ {
226+ absl::StrAppend (
227+ &message, " \n\t --> x node monitioring : no inhibition." );
228+ }
229+ return message;
230+ }
231+
176232 private:
177233 std::vector< FractureSetDescription > set_descriptors_;
234+ // x node monitoring
235+ double beta_x_node_{ 1 . };
178236 };
179237
180238} // namespace geode
0 commit comments