We propose a novel C++ open-source package dfemtoolz that enables highly efficient: (1) discretization of a triangular surface mesh into volumetric tetrahedral elements (by using the Tetgen); (2) splitting of prism or tetrahedral meshes into hexahedral meshes; and (3) application of boundary conditions for modeling various physical phenomena (i.e. fluid flow, structural analysis, heat transfer, mass transport, etc.). The novelty of the proposed library is two-fold: (1) it avoids computationally expensive merging by performing a more efficient search of neighboring nodes; and (2) it enables highly efficient manipulation of nodes' BCs in the bitwise manner. The framework is initially proposed and validated for biomedical simulations; however, it could have wide-scale applications. Program summary Program Title: dfemtoolz Program Files doi: http://dx.doi.org/10.17632/9xy4x3ggch.1 Licensing provisions: GNU General Public License 3 Programming language: C++ Nature of the problem: In silico trials assume reproducing medical phenomena on computers with the aim to reduce harms, costs and time required for performing traditional clinical trials. A typical in silico workflow consists of the following six steps: (1) Segmentation of medical scans; (2) Reconstruction of the segmented region: (3) Meshing of the obtained volume; (4) Application of appropriate materials and boundary conditions (BCs); (5) Solving governing equations that describe how the considered phenomena will behave under the specified conditions and (6) Visualization of the obtained results. At the moment, there are available mature open-source frameworks for solving the following tasks: segmentation (i.e. ITK, ImageJ), meshing (i.e. Tetgen, Triangle), simulation (i.e. OpenFOAM, Elmer, FEniCS) and visualization (i.e. VTK, OpenGL). However, the step 4 (application of materials and boundary conditions) remains an open question in terms of open-source packages. To the best of our knowledge, there is no robust and publically available framework for these purposes which inspired us to propose the dfemtoolz with the aim to improve compatibility and ease integration of the overall six in silico trials steps. Solution method: The dfemtoolz is provided as both stand-alone executable modules and C++ library that could be integrated into an existing software package. The dfemtoolz supports two use-case scenarios: (1) a user has a surface geometry of the FEM model that needs to be discretized before further application of boundary conditions; and (2) a user has an existing FE mesh and only needs to prescribe BCs. Since it is generic, the dfemtoolz is capable of processing any FEM model represented as a list of nodes (defined with coordinates in an arbitrary dimension) and a list of elements (of an arbitrary type). Additional comments: The source code, working examples and benchmarks are available for download at the URL: https://github.comidmilashinovicidfemtoolz and are tested to work under Linux and Windows OS. The library was developed using the Code::Blocks IDE and the g++ compiler. (C) 2019 Elsevier B.V. All rights reserved.