-
Notifications
You must be signed in to change notification settings - Fork 5
C++ D3plot
This holds all data needed to read d3plot files.
static size_t index_for_id(const Array<d3_word> &ids, d3_word id);
Returns the index of id in the array ids. If it cannot be found then UINT64_MAX will be returned. The ids array needs to sorted in ascending order.
- ids The sorted array in which to look for id
- id The id to look for
D3plot(const std::filesystem::path &root_file_name);
Open a d3plot file family by giving the root file name Example: d3plot of d3plot01, d3plot02, d3plot03, etc.
-
root_file_name The file path to the first file of the d3plot file family (Usually
d3plot
)
Array<d3_word> read_node_ids();
Read all ids of the nodes.
Array<d3_word> read_solid_element_ids();
Read all ids of the solid elements.
Array<d3_word> read_beam_element_ids();
Read all ids of the beam elements.
Array<d3_word> read_shell_element_ids();
Read all ids of the shell elements.
Array<d3_word> read_thick_shell_element_ids();
Read all ids of the thick shell elements.
Array<d3_word> read_all_element_ids();
Read all ids of the solid, beam, shell and thick shell elements.
Array<d3_word> read_part_ids();
Read all ids of the parts.
std::vector<SizedString> read_part_titles();
Returns a vector containing all part titles as sized strings.
Array<dVec3> read_node_coordinates(size_t state = 0);
Read the node coordinates of all nodes of a given state (time step)
- state The time step from which to read the coordinates. If left empty the initial coordinates are returned
std::vector<Array<dVec3>> read_all_node_coordinates();
Reads all node coordinates of all time steps and returns them as one big array.
Array<dVec3> read_node_velocity(size_t state);
Read the node velocity of all nodes of a given state (time step).
- state The time step from which to read the velocity
std::vector<Array<dVec3>> read_all_node_velocity();
Reads all node velocities of all time steps and returns them as one big array.
Array<dVec3> read_node_acceleration(size_t state);
Read the node acceleration of all nodes of a given state (time step).
- state The time step from which to read the acceleration
std::vector<Array<dVec3>> read_all_node_acceleration();
Read all node accelerations of all time steps and returns the as one big array.
Array<fVec3> read_node_coordinates_32(size_t state = 0);
Read the node coordinates of all nodes of a given state (time step)
- state The time step from which to read the coordinates. If left empty the initial coordinates are returned
std::vector<Array<fVec3>> read_all_node_coordinates_32();
Reads all node coordinates of all time steps and returns them as one big array.
Array<fVec3> read_node_velocity_32(size_t state);
Read the node velocity of all nodes of a given state (time step).
- state The time step from which to read the velocity
std::vector<Array<fVec3>> read_all_node_velocity_32();
Reads all node velocities of all time steps and returns them as one big array.
Array<fVec3> read_node_acceleration_32(size_t state);
Read the node acceleration of all nodes of a given state (time step).
- state The time step from which to read the acceleration
std::vector<Array<fVec3>> read_all_node_acceleration_32();
Read all node accelerations of all time steps and returns the as one big array.
double read_time(size_t state);
Read the time of a given state (time step) in milliseconds.
- state The time step from which to read the time
Array<double> read_all_time();
Reads all time of every state (time step) in milliseconds.
float read_time_32(size_t state);
Read the time of a given state (time step) in milliseconds.
- state The time step from which to read the time
Array<float> read_all_time_32();
Reads all time of every state (time step) in milliseconds.
Array<d3plot_solid> read_solids_state(size_t state);
Returns stress, strain (if NEIPH >= 6) for a given state.
- state The time step from which to read the solids state
Array<D3plotThickShell> read_thick_shells_state(size_t state);
Returns stress, strain (if ISTRN == 1) for a given state.
- state The time step from which to read the thick shells state
Array<d3plot_beam> read_beams_state(size_t state);
Returns Axial Force, S shear resultant, T shear resultant, S bending moment, T bending moment and Torsional resultant of all beams for a given state.
- state The time step from which to read the beams state
Array<D3plotShell> read_shells_state(size_t state);
Returns stress, strain (if ISTRN == 1) and some other variables (see docs pg. 36) of all shells for a given state.
- state The time step from which to read the beams state
Array<d3plot_solid_con> read_solid_elements();
Returns the node connectivity + material number of all 8 node solid elements.
Array<d3plot_thick_shell_con> read_thick_shell_elements();
Returns the node connectivity + material number of all 8 node thick shell elements.
Array<d3plot_beam_con> read_beam_elements();
Returns the node connectivity + orientation node + material number of all beam elements.
Array<d3plot_shell_con> read_shell_elements();
Returns the node connectivity + material number of all shell elements.
SizedString read_title();
Returns a string holding the Title of the d3plot file.
std::chrono::system_clock::time_point read_run_time();
Returns the time at which the simulation has been run as calender time.
D3plotPart read_part(size_t part_index);
Returns all elements (solid, thick shell, beam, shell) of a part. The part_index can retrieved by iterating over the array returned by read_part_ids.
- part_index The index of the part into the part ids array returned by read_part_ids
D3plotPart read_part_by_id(size_t part_id, const Array<d3_word> &part_ids = Array<d3_word>());
The same as read_part, but instead of an index into the parts, this functions takes an id. You can supply this function with the part ids returned by read_part_ids. If you do not do this, they will be read in this function call. Which means that if you intend to call this function multiple times, it is best to preload the part ids.
- part_id The id of the part as defined in the keyword file
- part_ids The array returned by read_part_ids. Can be set to increase performance
size_t num_time_steps() const;
Returns the number of states (time steps).
d3plot_file &get_handle();
const d3plot_file &get_handle() const;
Returns the underlying C d3plot_file.
A class used to access data of a certain part in a d3plot file (family).
D3plotPart(const d3plot_part &part);
D3plotPart(D3plotPart &&rhs);
D3plotPart &operator=(D3plotPart &&rhs);
Only move semantics are enabled.
Array<d3_word> get_solid_elements();
Returns all solid element ids of the part.
Array<d3_word> get_thick_shell_elements();
Returns all thick shell element ids of the part.
Array<d3_word> get_beam_elements();
Returns all beam element ids of the part.
Array<d3_word> get_shell_elements();
Returns all shell element ids of the part.
Array<size_t> get_solid_element_indices();
Returns all solid element indices (into the array returned by dro::D3plot::read_solid_element_ids) of the part.
Array<size_t> get_thick_shell_element_indices();
Returns all thick shell element indices (into the array returned by dro::D3plot::read_thick_shell_element_ids) of the part.
Array<size_t> get_beam_element_indices();
Returns all beam element indices (into the array returned by dro::D3plot::read_beam_element_ids) of the part.
Array<size_t> get_shell_element_indices();
Returns all shell element indices (into the array returned by dro::D3plot::read_shell_element_ids) of the part.
Array<d3_word> get_node_ids(
D3plot &plot_file, const Array<d3_word> *solid_ids = nullptr,
const Array<d3_word> *beam_ids = nullptr,
const Array<d3_word> *shell_ids = nullptr,
const Array<d3_word> *thick_shell_ids = nullptr,
const Array<d3_word> *node_ids = nullptr,
const Array<d3plot_solid_con> *solid_cons = nullptr,
const Array<d3plot_beam_con> *beam_cons = nullptr,
const Array<d3plot_shell_con> *shell_cons = nullptr,
const Array<d3plot_thick_shell_con> *thick_shell_cons = nullptr) const;
Returns all node ids of the part. All ids and connectivities of all different elements can be provided to improve performance, since they would not need to be loaded.
- plot_file The dro::D3plot from which to load not provided data
- solid_ids The array returned by dro::D3plot::read_solid_element_ids
- beam_ids The array returned by dro::D3plot::read_beam_element_ids
- shell_ids The array returned by dro::D3plot::read_shell_element_ids
- thick_shell_ids The array returned by the dro::D3plot::read_thick_shell_element_ids
- node_ids The array returned by dro::D3plot::read_node_ids
- solid_cons The array returned by dro::D3plot::read_solid_elements
- beam_cons The array returned by dro::D3plot::read_beam_elements
- shell_cons The array returned by dro::D3plot::read_shell_elements
- thick_shell_cons The array returned by dro::D3plot::read_thick_shell_elements
Array<d3_word> get_node_indices(
D3plot &plot_file, const Array<d3_word> *solid_ids = nullptr,
const Array<d3_word> *beam_ids = nullptr,
const Array<d3_word> *shell_ids = nullptr,
const Array<d3_word> *thick_shell_ids = nullptr,
const Array<d3plot_solid_con> *solid_cons = nullptr,
const Array<d3plot_beam_con> *beam_cons = nullptr,
const Array<d3plot_shell_con> *shell_cons = nullptr,
const Array<d3plot_thick_shell_con> *thick_shell_cons = nullptr) const;
Returns all node indices of the part. All ids and connectivities of all different elements can be provided to improve performance, since they would not need to be loaded. This returns indices into the node ids array returned by dro::D3plot::read_node_ids.
- plot_file The dro::D3plot from which to load not provided data
- solid_ids The array returned by dro::D3plot::read_solid_element_ids
- beam_ids The array returned by dro::D3plot::read_beam_element_ids
- shell_ids The array returned by dro::D3plot::read_shell_element_ids
- thick_shell_ids The array returned by the dro::D3plot::read_thick_shell_element_ids
- solid_cons The array returned by dro::D3plot::read_solid_elements
- beam_cons The array returned by dro::D3plot::read_beam_elements
- shell_cons The array returned by dro::D3plot::read_shell_elements
- thick_shell_cons The array returned by dro::D3plot::read_thick_shell_elements
size_t get_num_nodes(
D3plot &plot_file, const Array<d3_word> *solid_ids = nullptr,
const Array<d3_word> *beam_ids = nullptr,
const Array<d3_word> *shell_ids = nullptr,
const Array<d3_word> *thick_shell_ids = nullptr,
const Array<d3plot_solid_con> *solid_cons = nullptr,
const Array<d3plot_beam_con> *beam_cons = nullptr,
const Array<d3plot_shell_con> *shell_cons = nullptr,
const Array<d3plot_thick_shell_con> *thick_shell_cons = nullptr) const;
Returns the number of nodes of a part. Internally it just calls get_node_indices and returns the number of node indices.
- plot_file The dro::D3plot from which to load not provided data
- solid_ids The array returned by dro::D3plot::read_solid_element_ids
- beam_ids The array returned by dro::D3plot::read_beam_element_ids
- shell_ids The array returned by dro::D3plot::read_shell_element_ids
- thick_shell_ids The array returned by the dro::D3plot::read_thick_shell_element_ids
- solid_cons The array returned by dro::D3plot::read_solid_elements
- beam_cons The array returned by dro::D3plot::read_beam_elements
- shell_cons The array returned by dro::D3plot::read_shell_elements
- thick_shell_cons The array returned by dro::D3plot::read_thick_shell_elements
size_t get_num_elements() const;
Returns the number of all elements of a part.
Array<d3_word> get_all_element_ids() const;
Returns an array containing all element ids.
const Array<double> get_mid_history_variables() const noexcept;
const Array<double> get_inner_history_variables() const noexcept;
const Array<double> get_outer_history_variables() const noexcept;
const Array<double> get_mean_history_variables() const noexcept;
const Array<double> get_add_ip_history_variables(size_t add_idx) const noexcept;
Returns the history variables of either integration point. get_mean_history_variables returns an average over all integration points. get_add_ip_history_variables returns the history variables of a specific additional integration point.
- add_idx Index of the integration point (Excluding mid, inner and outer)
const Array<d3plot_surface> get_add_ips() const noexcept;
Returns an array containing all additional integration points.
D3plotSurface get_mean() const noexcept;
Returns the average values of all integration points.
const Array<double> get_mid_history_variables() const noexcept;
const Array<double> get_inner_history_variables() const noexcept;
const Array<double> get_outer_history_variables() const noexcept;
const Array<double> get_mean_history_variables() const noexcept;
const Array<double> get_add_ip_history_variables(size_t add_idx) const noexcept;
Returns the history variables of either integration point. get_mean_history_variables returns an average over all integration points. get_add_ip_history_variables returns the history variables of a specific additional integration point.
- add_idx Index of the integration point (Excluding mid, inner and outer)
const Array<d3plot_surface> get_add_ips() const noexcept;
Returns an array containing all additional integration points.
D3plotSurface get_mean() const noexcept;
Returns the average values of all integration points.