<commit_before>#include "pvESSI.h"
#include <stdlib.h>
#include "vtkMath.h"
#include "vtkObjectFactory.h"
#include "vtkStreamingDemandDrivenPipeline.h"
#include "vtkQuadratureSchemeDefinition.h"
#include "vtkQuadraturePointInterpolator.h"
#include "vtkQuadraturePointsGenerator.h"
#include "vtkQuadratureSchemeDictionaryGenerator.h"
#include "vtkInformationQuadratureSchemeDefinitionVectorKey.h"
#include "vtkIdTypeArray.h"
#include "vtkInformationVector.h"
#include "vtkFloatArray.h"
#include "vtkInformation.h"
#include "vtkDataObject.h"
#include "vtkSmartPointer.h"
#include "vtkCell.h"
#include "vtkCellData.h"
#include "vtkPointData.h"
#include "vtkVertexGlyphFilter.h"
#include "vtkUnstructuredGrid.h"
#include "vtkLookupTable.h"
#include "vtkDelaunay3D.h"
#include <string>
#include <iostream>
#include <map>
#include <vector>
#include "vtkExecutive.h"
#include <sstream>
#include "hdf5.h"
#include "vtkProbeFilter.h"
#include <vtkDelaunay3D.h>

// LINK_LIBRARIES(hdf5_cpp hdf5 )

/************************************************************************************************************************************************/
// cmake .. -DParaView_DIR=~/Softwares/Paraview/Paraview-Build/ -DGHOST_BUILD_CDAWEB=OFF
// cmake .. -DParaView_DIR="/home/sumeet/Softwares/ParaView-v4.4.0" -DGHOST_BUILD_CDAWEB=OFF
/************************************************************************************************************************************************/


vtkStandardNewMacro(pvESSI);

pvESSI::pvESSI(){ 

	this->FileName = NULL;
	this->SetNumberOfInputPorts(0);
	this->SetNumberOfOutputPorts(1);
	UGrid_Gauss_Mesh          = vtkSmartPointer<vtkUnstructuredGrid>::New();
	UGrid_Node_Mesh           = vtkSmartPointer<vtkUnstructuredGrid>::New();
	UGrid_Current_Node_Mesh   = vtkSmartPointer<vtkUnstructuredGrid>::New();
	UGrid_Current_Gauss_Mesh  = vtkSmartPointer<vtkUnstructuredGrid>::New();
	this->set_VTK_To_ESSI_Elements_Connectivity();
	this->Build_Meta_Array_Map();
	Build_Inverse_Matrices();
	Build_Gauss_To_Node_Interpolation_Map();
}

/*****************************************************************************
* This method responds to the request made by vtk Pipeleine. 
* This method is invoked when the time stamp is changed from paraview VCR.
*****************************************************************************/
int pvESSI::RequestData(vtkInformation *vtkNotUsed(request),vtkInformationVector **vtkNotUsed(inputVector),	vtkInformationVector *outputVector){

	vtkInformation *Node_Mesh = outputVector->GetInformationObject(0);
	// outInfo->Print(std::cout);

	piece_no = Node_Mesh->Get(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER());
	num_of_pieces = Node_Mesh->Get(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES());
	cout << "Piece_No " << piece_no << endl;
	cout << "Number_of_Pieces " << num_of_pieces << endl;

	if(single_file_visualization_mode){
		Step_Initializer(-1);
	}
	else{
		Step_Initializer(piece_no);
	}
	

  	this->Node_Mesh_Current_Time = Time_Map.find( Node_Mesh->Get(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP()))->second;

	if (!Whether_Node_Mesh_Build){
		this->Get_Node_Mesh(UGrid_Node_Mesh);
		UGrid_Current_Node_Mesh->ShallowCopy(UGrid_Node_Mesh);
	} 

  	// int Clength = outInfo->Length(vtkStreamingDemandDrivenPipeline::TIME_STEPS());
  	// double* Csteps = outInfo->Get(vtkStreamingDemandDrivenPipeline::TIME_STEPS());

 	/////////////////////////////////  Printing For Debugging ////////////////////////////////
 	// cout << "Number of Nodes "   << " " << Number_of_Nodes << endl;
	// cout << "Pseudo_Number_of_Nodes "  << " " << Pseudo_Number_of_Nodes << endl;
	// cout << "Number of Gauss Points " << Number_of_Gauss_Nodes << endl;
 	// cout << "Number of Elements "   << " " << Number_of_Elements << endl;
	// cout << "Pseudo_Number_of_Elements"  << " " << Pseudo_Number_of_Elements << endl;
	/////////////////////////////////////////////////////////////////////////////////////////

	Build_Node_Attributes(UGrid_Current_Node_Mesh, this->Node_Mesh_Current_Time );
	Build_Stress_Field_At_Nodes(UGrid_Current_Node_Mesh, this->Node_Mesh_Current_Time);
	
	// get the ouptut pointer to paraview 
	vtkUnstructuredGrid *Output_Node_Mesh = vtkUnstructuredGrid::SafeDownCast(Node_Mesh->Get(vtkDataObject::DATA_OBJECT()));

	Output_Node_Mesh->ShallowCopy(UGrid_Current_Node_Mesh);

	/*************************************************************************************************************************************/
	/****************************************************** if Gauss Mesh is Enabled *****************************************************/
	if(Enable_Gauss_Mesh){
		vtkInformation *Gauss_Mesh = outputVector->GetInformationObject(1);
		if (!Whether_Gauss_Mesh_Build ){ 
			this->Get_Gauss_Mesh(UGrid_Gauss_Mesh);
			UGrid_Current_Gauss_Mesh->ShallowCopy(UGrid_Gauss_Mesh);
		} 

		this->Gauss_Mesh_Current_Time = Time_Map.find( Gauss_Mesh->Get(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP()))->second;
	  	if(Gauss_Mesh_Current_Time > Number_Of_Time_Steps){
	  		Gauss_Mesh_Current_Time =0;
	  	}

	  	Build_Gauss_Attributes(UGrid_Current_Gauss_Mesh, this->Gauss_Mesh_Current_Time );
	  	vtkUnstructuredGrid *Output_Gauss_Mesh = vtkUnstructuredGrid::SafeDownCast(Gauss_Mesh->Get(vtkDataObject::DATA_OBJECT()));
	  	Output_Gauss_Mesh->ShallowCopy(UGrid_Current_Gauss_Mesh);
	}
	/***************************************************************************************************************************************/
	/***************************************************************************************************************************************/

	return 1;
}

// ****************************************************************************
// * This method is called only once for information about time stamp and extent. 
// * This is the method which is called firt after the default constructor is 
// * initialized
// ****************************************************************************

int pvESSI::RequestInformation( vtkInformation *request, vtkInformationVector **vtkNotUsed(inVec), vtkInformationVector* outVec){

	this->Initialize();

	if(Number_of_Processes_Used==1 || Process_Number>0)
		this->single_file_visualization_mode = true;

	vtkInformation* Node_Mesh = outVec->GetInformationObject(0);

	double Time_range[2]={Time[0],Time[Number_Of_Time_Steps-1]};
<commit_msg> Checking all conditions by user in parallel<commit_after>#include "pvESSI.h"
#include <stdlib.h>
#include "vtkMath.h"
#include "vtkObjectFactory.h"
#include "vtkStreamingDemandDrivenPipeline.h"
#include "vtkQuadratureSchemeDefinition.h"
#include "vtkQuadraturePointInterpolator.h"
#include "vtkQuadraturePointsGenerator.h"
#include "vtkQuadratureSchemeDictionaryGenerator.h"
#include "vtkInformationQuadratureSchemeDefinitionVectorKey.h"
#include "vtkIdTypeArray.h"
#include "vtkInformationVector.h"
#include "vtkFloatArray.h"
#include "vtkInformation.h"
#include "vtkDataObject.h"
#include "vtkSmartPointer.h"
#include "vtkCell.h"
#include "vtkCellData.h"
#include "vtkPointData.h"
#include "vtkVertexGlyphFilter.h"
#include "vtkUnstructuredGrid.h"
#include "vtkLookupTable.h"
#include "vtkDelaunay3D.h"
#include <string>
#include <iostream>
#include <map>
#include <vector>
#include "vtkExecutive.h"
#include <sstream>
#include "hdf5.h"
#include "vtkProbeFilter.h"
#include <vtkDelaunay3D.h>

// LINK_LIBRARIES(hdf5_cpp hdf5 )

/************************************************************************************************************************************************/
// cmake .. -DParaView_DIR=~/Softwares/Paraview/Paraview-Build/ -DGHOST_BUILD_CDAWEB=OFF
// cmake .. -DParaView_DIR="/home/sumeet/Softwares/ParaView-v4.4.0" -DGHOST_BUILD_CDAWEB=OFF
/************************************************************************************************************************************************/


vtkStandardNewMacro(pvESSI);

pvESSI::pvESSI(){ 

	this->FileName = NULL;
	this->SetNumberOfInputPorts(0);
	this->SetNumberOfOutputPorts(1);
	UGrid_Gauss_Mesh          = vtkSmartPointer<vtkUnstructuredGrid>::New();
	UGrid_Node_Mesh           = vtkSmartPointer<vtkUnstructuredGrid>::New();
	UGrid_Current_Node_Mesh   = vtkSmartPointer<vtkUnstructuredGrid>::New();
	UGrid_Current_Gauss_Mesh  = vtkSmartPointer<vtkUnstructuredGrid>::New();
	this->set_VTK_To_ESSI_Elements_Connectivity();
	this->Build_Meta_Array_Map();
	Build_Inverse_Matrices();
	Build_Gauss_To_Node_Interpolation_Map();
}

/*****************************************************************************
* This method responds to the request made by vtk Pipeleine. 
* This method is invoked when the time stamp is changed from paraview VCR.
*****************************************************************************/
int pvESSI::RequestData(vtkInformation *vtkNotUsed(request),vtkInformationVector **vtkNotUsed(inputVector),	vtkInformationVector *outputVector){

	vtkInformation *Node_Mesh = outputVector->GetInformationObject(0);
	// outInfo->Print(std::cout);

	piece_no = Node_Mesh->Get(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER());
	num_of_pieces = Node_Mesh->Get(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES());
	cout << "Piece_No " << piece_no << endl;
	// cout << "Number_of_Pieces " << num_of_pieces << endl;

	if(single_file_visualization_mode){
		if(piece_no>0)
			return 1;
		Step_Initializer(-1);
	}
	else{
		if(piece_no>Number_of_Processes_Used-1)
			return 1;
		Step_Initializer(piece_no);
	}

  	this->Node_Mesh_Current_Time = Time_Map.find( Node_Mesh->Get(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP()))->second;

	if (!Whether_Node_Mesh_Build){
		this->Get_Node_Mesh(UGrid_Node_Mesh);
		UGrid_Current_Node_Mesh->ShallowCopy(UGrid_Node_Mesh);
	} 

  	// int Clength = outInfo->Length(vtkStreamingDemandDrivenPipeline::TIME_STEPS());
  	// double* Csteps = outInfo->Get(vtkStreamingDemandDrivenPipeline::TIME_STEPS());

 	/////////////////////////////////  Printing For Debugging ////////////////////////////////
 	// cout << "Number of Nodes "   << " " << Number_of_Nodes << endl;
	// cout << "Pseudo_Number_of_Nodes "  << " " << Pseudo_Number_of_Nodes << endl;
	// cout << "Number of Gauss Points " << Number_of_Gauss_Nodes << endl;
 	// cout << "Number of Elements "   << " " << Number_of_Elements << endl;
	// cout << "Pseudo_Number_of_Elements"  << " " << Pseudo_Number_of_Elements << endl;
	/////////////////////////////////////////////////////////////////////////////////////////

	Build_Node_Attributes(UGrid_Current_Node_Mesh, this->Node_Mesh_Current_Time );
	Build_Stress_Field_At_Nodes(UGrid_Current_Node_Mesh, this->Node_Mesh_Current_Time);
	
	// get the ouptut pointer to paraview 
	vtkUnstructuredGrid *Output_Node_Mesh = vtkUnstructuredGrid::SafeDownCast(Node_Mesh->Get(vtkDataObject::DATA_OBJECT()));

	Output_Node_Mesh->ShallowCopy(UGrid_Current_Node_Mesh);

	/*************************************************************************************************************************************/
	/****************************************************** if Gauss Mesh is Enabled *****************************************************/
	if(Enable_Gauss_Mesh){
		vtkInformation *Gauss_Mesh = outputVector->GetInformationObject(1);
		if (!Whether_Gauss_Mesh_Build ){ 
			this->Get_Gauss_Mesh(UGrid_Gauss_Mesh);
			UGrid_Current_Gauss_Mesh->ShallowCopy(UGrid_Gauss_Mesh);
		} 

		this->Gauss_Mesh_Current_Time = Time_Map.find( Gauss_Mesh->Get(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP()))->second;
	  	if(Gauss_Mesh_Current_Time > Number_Of_Time_Steps){
	  		Gauss_Mesh_Current_Time =0;
	  	}

	  	Build_Gauss_Attributes(UGrid_Current_Gauss_Mesh, this->Gauss_Mesh_Current_Time );
	  	vtkUnstructuredGrid *Output_Gauss_Mesh = vtkUnstructuredGrid::SafeDownCast(Gauss_Mesh->Get(vtkDataObject::DATA_OBJECT()));
	  	Output_Gauss_Mesh->ShallowCopy(UGrid_Current_Gauss_Mesh);
	}
	/***************************************************************************************************************************************/
	/***************************************************************************************************************************************/	

	return 1;
}

// ****************************************************************************
// * This method is called only once for information about time stamp and extent. 
// * This is the method which is called firt after the default constructor is 
// * initialized
// ****************************************************************************

int pvESSI::RequestInformation( vtkInformation *request, vtkInformationVector **vtkNotUsed(inVec), vtkInformationVector* outVec){

	this->Initialize();

	if(Number_of_Processes_Used==1 || Process_Number>0)
		this->single_file_visualization_mode = true;

	vtkInformation* Node_Mesh = outVec->GetInformationObject(0);

	double Time_range[2]={Time[0],Time[Number_Of_Time_Steps-1]};

{'fraction_non_alphanumeric': 0.29336734693877553, 'fraction_numerical': 0.0035559678416821274, 'mean_word_length': 6.587683284457478, 'pattern_counts': {'":': 0, '<': 125, '<?xml version=': 0, '>': 95, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3563932', 'n_tokens_mistral': 4125, 'n_tokens_neox': 3861, 'n_words': 551}