Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/art_net/4C_art_net_artery_ele_calc_pres_based.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ int Discret::Elements::ArteryEleCalcPresBased<distype>::evaluate_service(Artery*
switch (action)
{
case Arteries::calc_flow_pressurebased:
evaluate_flow(ele, discretization, la, elevec1, mat);
evaluate_flow(ele, discretization, la, elevec1, elevec2, mat);
break;
default:
FOUR_C_THROW("Unknown type of action {} for Artery (PressureBased formulation)", action);
Expand Down Expand Up @@ -203,7 +203,8 @@ void Discret::Elements::ArteryEleCalcPresBased<distype>::sysmat(Artery* ele,
template <Core::FE::CellType distype>
void Discret::Elements::ArteryEleCalcPresBased<distype>::evaluate_flow(Artery* ele,
Core::FE::Discretization& discretization, Core::Elements::LocationArray& la,
Core::LinAlg::SerialDenseVector& flowVec, std::shared_ptr<const Core::Mat::Material> material)
Core::LinAlg::SerialDenseVector& flowVec, Core::LinAlg::SerialDenseVector& ele_length,
std::shared_ptr<const Core::Mat::Material> material)
{
// get pressure
std::shared_ptr<const Core::LinAlg::Vector<double>> pressnp =
Expand All @@ -216,12 +217,14 @@ void Discret::Elements::ArteryEleCalcPresBased<distype>::evaluate_flow(Artery* e

// calculate the element length
const double L = calculate_ele_length(ele, discretization, la);
FOUR_C_ASSERT(ele_length.length() == 1, "ele_length must be of size 1");
ele_length(0) = L;
Comment thread
lkoeglmeier marked this conversation as resolved.

// check here, if we really have an artery !!
if (material->material_type() != Core::Materials::m_cnst_art)
FOUR_C_THROW("Wrong material type for artery");

// cast the material to artery material material
// cast the material to artery material
const Mat::Cnst1dArt* actmat = static_cast<const Mat::Cnst1dArt*>(material.get());

// Read in diameter
Expand All @@ -233,8 +236,6 @@ void Discret::Elements::ArteryEleCalcPresBased<distype>::evaluate_flow(Artery* e

// TODO: this works only for line 2 elements
flowVec(0) = -hag_pois * (mypress(1) - mypress(0)) / L;

return;
}

/*----------------------------------------------------------------------*
Expand Down
2 changes: 2 additions & 0 deletions src/art_net/4C_art_net_artery_ele_calc_pres_based.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,14 @@ namespace Discret
\param discretization[in] discretization to which element belongs
\param la[in] element location array
\param flowVec[in,out] element flow to calculate
\param ele_length[in,out] element length to calculate
\param material[in] artery material/dimesion

\note only checked for line2 elements
*/
void evaluate_flow(Artery* ele, Core::FE::Discretization& discretization,
Core::Elements::LocationArray& la, Core::LinAlg::SerialDenseVector& flowVec,
Core::LinAlg::SerialDenseVector& ele_length,
std::shared_ptr<const Core::Mat::Material> material);

/*!
Expand Down
183 changes: 25 additions & 158 deletions src/art_net/4C_art_net_impl_stationary.cpp

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions src/art_net/4C_art_net_impl_stationary.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ namespace Arteries
//! get element radius
void get_radius();

//! calculate element volumetric flow
void reconstruct_flow();
//! calculate element volumetric flow and element length
void compute_element_flow_and_length();

//! set the initial field on the artery discretization
void set_initial_field(const ArtDyn::InitialField init, //!< type of initial field
Expand Down Expand Up @@ -156,6 +156,8 @@ namespace Arteries
std::shared_ptr<Core::LinAlg::Vector<double>> neumann_loads_;
//! volumetric flow (for output)
std::shared_ptr<Core::LinAlg::Vector<double>> ele_volflow_;
//! element length (for output)
std::shared_ptr<Core::LinAlg::Vector<double>> ele_length_;
//! element radius (for output)
std::shared_ptr<Core::LinAlg::Vector<double>> ele_radius_;
/// underlying scatra problem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ PROBLEM TYPE:
STRUCTURAL DYNAMIC:
DYNAMICTYPE: "OneStepTheta"
LINEAR_SOLVER: 1
IO/RUNTIME VTK OUTPUT:
OUTPUT_DATA_FORMAT: ascii
porofluid_elasticity_dynamic:
total_simulation_time: 0.5
time_integration:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ PROBLEM SIZE:
PROBLEM TYPE:
PROBLEMTYPE: "porofluid_pressure_based_elasticity_scatra"
IO/RUNTIME VTK OUTPUT:
OUTPUT_DATA_FORMAT: binary
OUTPUT_DATA_FORMAT: ascii
porofluid_elasticity_scatra_dynamic:
total_simulation_time: 2.5
time_integration:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0"?>
<!--
# vtk DataFile Version 3.0
-->
<VTKFile type="Collection" version="0.1" ByteOrder="LittleEndian">
<Collection>
<DataSet timestep="0.00000000000000e+00" group="" part="0" file="porofluid_pressure_based_elast_2D_quad4_linebased_artery_coupling_mono_MP_teko-vtk-files/artery-00000.pvtu"/>
<DataSet timestep="2.00000000000000e-01" group="" part="0" file="porofluid_pressure_based_elast_2D_quad4_linebased_artery_coupling_mono_MP_teko-vtk-files/artery-00002.pvtu"/>
<DataSet timestep="4.00000000000000e-01" group="" part="0" file="porofluid_pressure_based_elast_2D_quad4_linebased_artery_coupling_mono_MP_teko-vtk-files/artery-00004.pvtu"/>
</Collection>
</VTKFile>
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?xml version="1.0" ?>
<!--
# vtk DataFile Version 3.0
-->
<VTKFile type="UnstructuredGrid" version="0.1" compressor="vtkZLibDataCompressor" byte_order="LittleEndian">
<UnstructuredGrid>
<FieldData>
<DataArray type="Float64" Name="TIME" NumberOfTuples="1" format="ascii">
4.000000000000000e-01
</DataArray>
</FieldData>

<Piece NumberOfPoints="2" NumberOfCells="1" >
<Points>
<DataArray type="Float64" NumberOfComponents="3" format="ascii">
-5.000000000000000e-01 -5.000000000000000e-01 0.000000000000000e+00
-5.000000000000000e-01 5.000000000000000e-01 0.000000000000000e+00
</DataArray>
</Points>

<Cells>
<DataArray type="Int32" Name="connectivity" format="ascii">
0 1
</DataArray>
<DataArray type="Int32" Name="offsets" format="ascii">
2
</DataArray>
<DataArray type="UInt8" Name="types" format="ascii">
3
</DataArray>
</Cells>

<PointData>
<DataArray type="Float64" Name="pressure" format="ascii">
2.500000000000000e-01
7.500000000000000e-01
</DataArray>
</PointData>
<CellData>
<DataArray type="Float64" Name="Owner" format="ascii">
0.000000000000000e+00
</DataArray>
<DataArray type="Float64" Name="ele_length" format="ascii">
2.200000000000110e+00
</DataArray>
<DataArray type="Float64" Name="ele_radius" format="ascii">
1.200000000000000e+01
</DataArray>
<DataArray type="Float64" Name="ele_volflow" format="ascii">
-4.626709180741099e+04
</DataArray>
</CellData>

</Piece>
</UnstructuredGrid>
</VTKFile>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" ?>
<!--
# vtk DataFile Version 3.0
-->
<VTKFile type="PUnstructuredGrid" version="0.1" byte_order="LittleEndian">
<PUnstructuredGrid GhostLevel="0">
<PPoints>
<PDataArray type="Float64" NumberOfComponents="3"/>
</PPoints>
<PPointData>
<PDataArray type="Float64" Name="pressure" format="ascii"/>
</PPointData>
<PCellData>
<PDataArray type="Float64" Name="Owner" format="ascii"/>
<PDataArray type="Float64" Name="ele_length" format="ascii"/>
<PDataArray type="Float64" Name="ele_radius" format="ascii"/>
<PDataArray type="Float64" Name="ele_volflow" format="ascii"/>
</PCellData>
<Piece Source="artery-00004-0.vtu"/>
</PUnstructuredGrid>
</VTKFile>
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
-->
<VTKFile type="Collection" version="0.1" ByteOrder="LittleEndian">
<Collection>
<DataSet timestep="0.00000000000000e+00" group="" part="0" file="poromultielastscatra_2D_quad4_nodetopoint_artery_airway_coupling_mono-vtk-files/artery-00000.pvtu"/>
<DataSet timestep="2.00000000000000e-01" group="" part="0" file="poromultielastscatra_2D_quad4_nodetopoint_artery_airway_coupling_mono-vtk-files/artery-00002.pvtu"/>
<DataSet timestep="4.00000000000000e-01" group="" part="0" file="poromultielastscatra_2D_quad4_nodetopoint_artery_airway_coupling_mono-vtk-files/artery-00004.pvtu"/>
<DataSet timestep="6.00000000000000e-01" group="" part="0" file="poromultielastscatra_2D_quad4_nodetopoint_artery_airway_coupling_mono-vtk-files/artery-00006.pvtu"/>
<DataSet timestep="8.00000000000000e-01" group="" part="0" file="poromultielastscatra_2D_quad4_nodetopoint_artery_airway_coupling_mono-vtk-files/artery-00008.pvtu"/>
<DataSet timestep="1.00000000000000e+00" group="" part="0" file="poromultielastscatra_2D_quad4_nodetopoint_artery_airway_coupling_mono-vtk-files/artery-00010.pvtu"/>
<DataSet timestep="1.20000000000000e+00" group="" part="0" file="poromultielastscatra_2D_quad4_nodetopoint_artery_airway_coupling_mono-vtk-files/artery-00012.pvtu"/>
<DataSet timestep="1.40000000000000e+00" group="" part="0" file="poromultielastscatra_2D_quad4_nodetopoint_artery_airway_coupling_mono-vtk-files/artery-00014.pvtu"/>
<DataSet timestep="1.60000000000000e+00" group="" part="0" file="poromultielastscatra_2D_quad4_nodetopoint_artery_airway_coupling_mono-vtk-files/artery-00016.pvtu"/>
<DataSet timestep="1.80000000000000e+00" group="" part="0" file="poromultielastscatra_2D_quad4_nodetopoint_artery_airway_coupling_mono-vtk-files/artery-00018.pvtu"/>
<DataSet timestep="2.00000000000000e+00" group="" part="0" file="poromultielastscatra_2D_quad4_nodetopoint_artery_airway_coupling_mono-vtk-files/artery-00020.pvtu"/>
<DataSet timestep="2.20000000000000e+00" group="" part="0" file="poromultielastscatra_2D_quad4_nodetopoint_artery_airway_coupling_mono-vtk-files/artery-00022.pvtu"/>
<DataSet timestep="2.40000000000000e+00" group="" part="0" file="poromultielastscatra_2D_quad4_nodetopoint_artery_airway_coupling_mono-vtk-files/artery-00024.pvtu"/>
<DataSet timestep="0.00000000000000e+00" group="" part="0" file="porofluid_pressure_based_elast_scatra_2D_quad4_nodetopoint_artery_airway_coupling_mono-vtk-files/artery-00000.pvtu"/>
<DataSet timestep="2.00000000000000e-01" group="" part="0" file="porofluid_pressure_based_elast_scatra_2D_quad4_nodetopoint_artery_airway_coupling_mono-vtk-files/artery-00002.pvtu"/>
<DataSet timestep="4.00000000000000e-01" group="" part="0" file="porofluid_pressure_based_elast_scatra_2D_quad4_nodetopoint_artery_airway_coupling_mono-vtk-files/artery-00004.pvtu"/>
<DataSet timestep="6.00000000000000e-01" group="" part="0" file="porofluid_pressure_based_elast_scatra_2D_quad4_nodetopoint_artery_airway_coupling_mono-vtk-files/artery-00006.pvtu"/>
<DataSet timestep="8.00000000000000e-01" group="" part="0" file="porofluid_pressure_based_elast_scatra_2D_quad4_nodetopoint_artery_airway_coupling_mono-vtk-files/artery-00008.pvtu"/>
<DataSet timestep="1.00000000000000e+00" group="" part="0" file="porofluid_pressure_based_elast_scatra_2D_quad4_nodetopoint_artery_airway_coupling_mono-vtk-files/artery-00010.pvtu"/>
<DataSet timestep="1.20000000000000e+00" group="" part="0" file="porofluid_pressure_based_elast_scatra_2D_quad4_nodetopoint_artery_airway_coupling_mono-vtk-files/artery-00012.pvtu"/>
<DataSet timestep="1.40000000000000e+00" group="" part="0" file="porofluid_pressure_based_elast_scatra_2D_quad4_nodetopoint_artery_airway_coupling_mono-vtk-files/artery-00014.pvtu"/>
<DataSet timestep="1.60000000000000e+00" group="" part="0" file="porofluid_pressure_based_elast_scatra_2D_quad4_nodetopoint_artery_airway_coupling_mono-vtk-files/artery-00016.pvtu"/>
<DataSet timestep="1.80000000000000e+00" group="" part="0" file="porofluid_pressure_based_elast_scatra_2D_quad4_nodetopoint_artery_airway_coupling_mono-vtk-files/artery-00018.pvtu"/>
<DataSet timestep="2.00000000000000e+00" group="" part="0" file="porofluid_pressure_based_elast_scatra_2D_quad4_nodetopoint_artery_airway_coupling_mono-vtk-files/artery-00020.pvtu"/>
<DataSet timestep="2.20000000000000e+00" group="" part="0" file="porofluid_pressure_based_elast_scatra_2D_quad4_nodetopoint_artery_airway_coupling_mono-vtk-files/artery-00022.pvtu"/>
<DataSet timestep="2.40000000000000e+00" group="" part="0" file="porofluid_pressure_based_elast_scatra_2D_quad4_nodetopoint_artery_airway_coupling_mono-vtk-files/artery-00024.pvtu"/>
</Collection>
</VTKFile>
</VTKFile>
Comment thread
lkoeglmeier marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -37,28 +37,33 @@
<PointData>
<DataArray type="Float64" Name="pressure" format="ascii">
1.300000000000000e+00
1.275205783587330e+00
1.275205783587330e+00
1.243599235259219e+00
1.275205783587330e+00
1.243599235259218e+00
1.275205783587201e+00
1.275205783587201e+00
1.243599235258923e+00
1.275205783587201e+00
1.243599235258927e+00
</DataArray>
</PointData>
<CellData>
<DataArray type="Float64" Name="Owner" format="ascii">
0.000000000000000e+00
0.000000000000000e+00
0.000000000000000e+00
</DataArray>
<DataArray type="Float64" Name="ele_length" format="ascii">
9.999999999999998e-02
2.549509756796393e-01
2.549509756796393e-01
</DataArray>
<DataArray type="Float64" Name="ele_radius" format="ascii">
2.500000000000000e-02
2.500000000000000e-02
2.500000000000000e-02
</DataArray>
<DataArray type="Float64" Name="ele_volflow" format="ascii">
9.508462906928656e-03
4.754231453464181e-03
4.754231453464448e-03
9.508462906978045e-03
4.754231453489330e-03
4.754231453488762e-03
</DataArray>
</CellData>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,28 +37,33 @@
<PointData>
<DataArray type="Float64" Name="pressure" format="ascii">
1.200000000000000e+00
1.212397108206685e+00
1.212397108206685e+00
1.243389878723394e+00
1.212397108206685e+00
1.243389878723399e+00
1.212397108206601e+00
1.212397108206601e+00
1.243389878723104e+00
1.212397108206601e+00
1.243389878723102e+00
</DataArray>
</PointData>
<CellData>
<DataArray type="Float64" Name="Owner" format="ascii">
1.000000000000000e+00
1.000000000000000e+00
1.000000000000000e+00
</DataArray>
<DataArray type="Float64" Name="ele_length" format="ascii">
4.999999999999999e-02
2.500000000000000e-01
2.500000000000000e-01
</DataArray>
<DataArray type="Float64" Name="ele_radius" format="ascii">
2.500000000000000e-02
2.500000000000000e-02
2.500000000000000e-02
</DataArray>
<DataArray type="Float64" Name="ele_volflow" format="ascii">
-9.508462907196888e-03
-4.754231453598051e-03
-4.754231453598800e-03
-9.508462907132682e-03
-4.754231453566442e-03
-4.754231453566135e-03
</DataArray>
</CellData>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,19 @@
2.792432562498998e-01
3.454759569079509e-04
2.792432562498998e-01
3.454759569079510e-04
3.454759569079509e-04
</DataArray>
</PointData>
<CellData>
<DataArray type="Float64" Name="Owner" format="ascii">
2.000000000000000e+00
2.000000000000000e+00
2.000000000000000e+00
</DataArray>
<DataArray type="Float64" Name="ele_length" format="ascii">
9.999999999999998e-02
2.549509756796393e-01
2.549509756796393e-01
</DataArray>
<DataArray type="Float64" Name="ele_radius" format="ascii">
2.500000000000000e-02
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
</PPointData>
<PCellData>
<PDataArray type="Float64" Name="Owner" format="ascii"/>
<PDataArray type="Float64" Name="ele_length" format="ascii"/>
<PDataArray type="Float64" Name="ele_radius" format="ascii"/>
<PDataArray type="Float64" Name="ele_volflow" format="ascii"/>
</PCellData>
Expand Down
7 changes: 4 additions & 3 deletions tests/list_of_tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1443,7 +1443,8 @@ __four_c_test_restart(BASED_ON ${current} SAME_FILE NP 2 RESTART_STEP 1)
four_c_test(TEST_FILE porofluid_pressure_based_3D_tet4.4C.yaml NP 2 RETURN_AS current)
__four_c_test_restart(BASED_ON ${current} SAME_FILE NP 2 RESTART_STEP 14)
four_c_test(TEST_FILE porofluid_pressure_based_elast_2D_quad4_3_fluids_2_volfrac_mono_FD.4C.yaml)
four_c_test(TEST_FILE porofluid_pressure_based_elast_2D_quad4_linebased_artery_coupling_mono_MP_teko.4C.yaml)
four_c_test(TEST_FILE porofluid_pressure_based_elast_2D_quad4_linebased_artery_coupling_mono_MP_teko.4C.yaml RETURN_AS current)
__four_c_test_vtk(BASED_ON ${current} PVD_RESULT xxx-artery.pvd PVD_REFERENCE ref/porofluid_pressure_based_elast_2D_quad4_linebased_artery_coupling_mono_MP_teko-artery.pvd TOLERANCE 1e-08 TIME_STEPS 0.4)
four_c_test(TEST_FILE porofluid_pressure_based_elast_2D_quad4_mono.4C.yaml NP 2 RETURN_AS current)
__four_c_test_restart(BASED_ON ${current} SAME_FILE NP 2 RESTART_STEP 4)
four_c_test(TEST_FILE porofluid_pressure_based_elast_2D_quad4_mono_FD.4C.yaml)
Expand Down Expand Up @@ -1571,8 +1572,8 @@ four_c_test(TEST_FILE reduced_lung_3_aw_2_tu.4C.yaml REQUIRED_DEPENDENCIES VTK)
four_c_test(TEST_FILE reduced_lung_3_aw_2_tu.4C.yaml NP 3 REQUIRED_DEPENDENCIES VTK)
four_c_test(TEST_FILE reduced_lung_3_aw_2_tu_pleural_pressure.4C.yaml REQUIRED_DEPENDENCIES VTK)
four_c_test(
TEST_FILE reduced_lung_3_aw_2_tu_pleural_pressure.4C.yaml NP 3 REQUIRED_DEPENDENCIES VTK
)
TEST_FILE reduced_lung_3_aw_2_tu_pleural_pressure.4C.yaml NP 3 REQUIRED_DEPENDENCIES VTK
)
four_c_test(TEST_FILE reduced_lung_3_aw_2_tu_4elemax_and_kv.4C.yaml REQUIRED_DEPENDENCIES VTK)
four_c_test(TEST_FILE reduced_lung_3_aw_2_tu_4elemax_and_kv.4C.yaml NP 3 REQUIRED_DEPENDENCIES VTK)
four_c_test(TEST_FILE reduced_lung_terminal_unit.4C.yaml REQUIRED_DEPENDENCIES VTK)
Expand Down
Loading