@@ -170,6 +170,32 @@ int main(int argc, char *argv[]) {
170170 // let the schema know how many images there are in the sequence and the first frame id:
171171 schema->set_frame_range (first_frame_id,num_frames);
172172
173+ if (input_params->get <bool >(DICe::print_subset_locations_and_exit,false )){
174+ // write out the subset locations for left camera and exit
175+ Teuchos::RCP<MultiField> coords = schema->mesh ()->get_field (DICe::mesh::field_enums::INITIAL_COORDINATES_FS);
176+ const int_t ss_locs_size = proc_rank==0 ?
177+ coords->get_map ()->get_num_global_elements () : 0 ; // both x and y coords
178+ Teuchos::Array<int_t > owned_ids (ss_locs_size);
179+ for (int_t i=0 ;i<ss_locs_size;++i)
180+ owned_ids[i] = i;
181+ Teuchos::RCP<MultiField_Map> zero_map = Teuchos::rcp (new MultiField_Map (-1 , owned_ids,0 ,*schema->mesh ()->get_comm ()));
182+ Teuchos::RCP<MultiField> all_on_zero_coords = Teuchos::rcp ( new MultiField (zero_map,1 ,true ));
183+ // all to zero gather of coordinates
184+ MultiField_Exporter exporter (*zero_map,*coords->get_map ());
185+ // export the field to zero
186+ all_on_zero_coords->do_import (coords,exporter);
187+ // all_on_zero_coords->describe();
188+ if (proc_rank==0 ){
189+ std::FILE * ssFile = fopen (" subset_locs.txt" ," w" );
190+ for (int_t i=0 ;i<ss_locs_size/2 ;++i){
191+ fprintf (ssFile," %i %i\n " ,(int_t )all_on_zero_coords->local_value (i*2 +0 ),(int_t )all_on_zero_coords->local_value (i*2 +1 ));
192+ }
193+ fclose (ssFile);
194+ }
195+ DICe::finalize ();
196+ return 0 ;
197+ }
198+
173199 bool has_motion_windows = false ;
174200 if (schema->analysis_type ()==LOCAL_DIC){
175201 has_motion_windows = schema->motion_window_params ()->size ()>0 ;
@@ -195,6 +221,9 @@ int main(int argc, char *argv[]) {
195221 std::string stereo_file_prefix = input_params->get <std::string>(DICe::output_prefix," DICe_solution" );
196222 stereo_file_prefix += " _stereo" ;
197223
224+
225+
226+
198227 // if the user selects predict_resolution_error option, an error analysis is performed and the actual analysis is skipped
199228 if (correlation_params->get <bool >(DICe::estimate_resolution_error,false )){
200229 file_prefix = " DICe_error_estimation_solution" ;
0 commit comments