<aside> 💡 The “result_info_provider” parses the most global information of a file. It lists the available results of a file and metadata (unit system, analysis type, physics type, solver name, solver version,…). The available results are associated to their dimension, homogeneity, location and to the operator name allowing to access those results.

</aside>

Untitled

Document it

The specification allows to document each operator. For consistency, the specification can be used through different reader plugins.

struct CustomResultInfoProvider
	{
		// TO DO: rename "custom_solver" to the real solver name and "custom_extension" to the real file extension
		static std::string name() { return "custom_solver::custom_extension::result_info_provider"; }

		static void run(ansys::dpf::OperatorMain& main);

		static ansys::dpf::OperatorSpecification specification()
		{
			ansys::dpf::OperatorSpecification spec;
			spec.setDocumentation("Read the result info from result streams.");
			spec.setInputPins(
				{
					ansys::dpf::PinDefinition(ansys::dpf::eStreamPin)
						.setName("streams_container")
						.setAcceptedTypes({ ansys::dpf::types::streams })
						.setDoc("streams (result file container) (optional)")
						.setOptional(true),
					ansys::dpf::PinDefinition(ansys::dpf::eDataSourcesPin)
						.setName("data_sources")
						.setAcceptedTypes({ ansys::dpf::types::data_sources })
						.setDoc("if the stream is null then we need to get the file path from the data sources"),
				});

			spec.setOutputPins(
				{
					ansys::dpf::PinDefinition(0)
						.setName("result_info")
						.setAcceptedTypes({ ansys::dpf::types::result_info })
						.setDoc("result_info"),
				});

			spec.setProperty(ansys::dpf::spec::exposure::sExposure, ansys::dpf::spec::exposure::sPrivate);

			return spec;
		}
	};

Implementation

For the "run" method implementation, refer to here:

For a template enabling to fill a ResultInfo from a Stream, refer to: